10

I'm exporting a simple org-table through LaTeX to PDF:

| a | b | c |
| 1 | 2 | 3 |

After export with C-c C-e l o the PDF contains a centered table, and I'd rather have it on the left (to be clear, I'm referring here to the table as a whole, not the positioning of elements in individual cells).

I'm not an expert at LaTeX. I've looked at :float and :placement in the Org manual here and haven't been able to affect the outcome. How could I accomplish this?

Steven Arntson
  • 1,333
  • 9
  • 28

2 Answers2

9

#+ATTR_LaTeX: :center nil will cancel centering (by default LaTeX tables inherit alignment from the document)

This is how the table would be exported with default settings:

\begin{center}
\begin{tabular}{rrr}
a & b & c\\
1 & 2 & 3\\
\end{tabular}
\end{center}

This is how it would be exported without centering:

\begin{tabular}{rrr}
a & b & c\\
1 & 2 & 3\\
\end{tabular}

If you need to move it even further to the left, you could add

#+BEGIN_LaTeX
  \hspace{-3cm}
#+END_LaTeX

before the table.

wvxvw
  • 11,342
  • 2
  • 31
  • 56
  • I tried to move the table to the left with the last example, but all I get is the LaTeX string before the table... (command: $ emacs file.org --batch -f org-latex-export-to-pdf --kill) – Pietro Oct 19 '23 at 16:55
1

To make it global, applied to all tables, you can also customize this variable

M-xcustomize-variableorg-latex-tables-centered

and look into options > customize emacs > specific group > org-export-latex for more.

Flint
  • 292
  • 2
  • 10