# Org-Mode How to position tables correctly when exporting to Latex?

I have a document I have written in org-mode which contains several tables. The tables all have the following attributes.

#+begin_table
#+LATEX: \caption{Initial risk List}
#+LATEX: \label{tab:risk-list}
#+LATEX: \centering
#+ATTR_LATEX: :center t :placement [h]
|Col1|Col2|
|----+----|
| 1  | 2  |
|----+----|
#+end_table


The configuration is to allow my tables to scale correctly for my document without running off the page which works, however, the [h] argument isn't being read by LaTeX as all the tables get places on one page together in the pdf document instead of being at their positions in the text where I want them. Am I passing the wrong latex configuration or is it just not picking it up during the parsing? I am using spacemacs by the way I'm not sure if that changes anything.

After looking at the tex file org produced it seems there is no placement values put into the document.

• Does this help? Basically, don't use [h], use [!htbp]. – NickD Dec 10 '18 at 23:52
• Thanks for the help! But unfortunately it did not – Ben Moore Dec 10 '18 at 23:57
• I was using the table environment to keep the adjust box contained to just the table – Ben Moore Dec 11 '18 at 14:52
• I don't know how \adjustbox works, but it seems not the like the center environment that org-export generates around the tabular. There is also a syntax error: you need add a closing brace to close the \adjustbox argument (and of course you need to \usepackage{adjustbox} somehow, but I imagine that's been done). – NickD Dec 11 '18 at 17:42

After looking at the problem for a while I found this solution.

 #+LATEX: \begin{adjustbox}{width={\textwidth},keepaspectratio}
#+ATTR_LATEX: :placement [!h]
#+LATEX: \centering
|Col1|Col2|
|----+----|
| 1  | 2  |
|----+----|

#+LATEX_HEADER: \usepackage{adjustbox}