0

I'm very new to Latex or PDF-export. I try to export an Org-document with tables. The problem is, that I cannot (or better: don't know how to) place them left aligned. The problem seems to come from some default Latex command at the exported .tex:

\begin{center}
\begin{tabular}{lll}
...
\end{tabular}
\end{center}

Does anyone know how to override this 'center'ing w/o any time editing the generated .tex?

Best regards, Chris.

0

If you want all tables to be always left-aligned, then setting org-latex-tables-centeredas @gigiair's answer suggests is the right way to go: you customize it once and never worry about it again.

If you want to change the centering behavior only for a single file, then the way to do it is to use the #+BIND mechanism. Add the following line to the top of your file:

#+BIND: org-latex-tables-centered nil

That will set the local value of org-latex-tables-centered to nil during export only.

In order for this to work however, you will have to enable the BIND mechanism by setting (or customizing) the variable org-export-allow-bind-keywords to t. I find the BIND mechanism useful, so I set it permanently.

Finally, if you want to change the centering of a single table, you can set an attribute for that table only:

#+NAME: cubes
#+ATTR_LATEX: :center nil
|  a | a^{3} |
|----+-------|
|  1 |     1 |
|  2 |     8 |
...
2
  • Thank you, Nick. Now it works perfect! That is the cool way to do it with the 'BIND' keyword. I wasn't aware of that feature in Org. That may be helpful also in other situations where I don't want to change variables globally. – chris-tian Mar 18 at 19:12
  • @chris-tian: if this or any other answer that has been provided has indeed answered your question satisfactorily, please accept it. To find out more about how the site works, click on the ? icon in the upper right of the page and read the topics in the Help Center. – NickD Mar 19 at 18:33
0

You can eval

(setq org-latex-tables-centered nil)

or customize the variable org-latex-tables-centered

To customize the latex export, you can browse Org Export LaTeX

(customize-group "org-export-latex")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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