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

#+LATEX: \caption{Initial risk List}
#+LATEX: \label{tab:risk-list}
#+LATEX: \centering
#+LATEX: \adjustbox{max width=\textwidth}{
#+ATTR_LATEX: :center t :placement [h]
| 1  | 2  |

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
| 1  | 2  |
#+LATEX: \end{adjustbox}

While also including

#+LATEX_HEADER: \usepackage{adjustbox}

At the top of the document.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.