3
votes

For some reason, org-mode is left-aligning my display equations when I run org-latex-preview (C-c C-x C-l). But the margin between each equation and its equation number is calculated, as if the equation was centered, which ruins the alignment between the equation numbers.

Is it possible to turn on Centering for displayed equations, so that the equation numbers line up (like with AUCTeX)?

Here is a sample .org document with display equations:

A numbered display equation:

\begin{equation}
\frac{\partial u}{\partial t}-\alpha\nabla^2u=0\tag{1}
\end{equation}

A second numbered equation:

\begin{equation}
E=MC^2\tag{2}
\end{equation}

And here is a screenshot of org-mode after running org-latex-preview:

enter image description here

1

1 Answers

3
votes

It looks like the alignment can be altered by editing org-format-latex-header.

Here are three different configurations:

  1. Equations on the left: \documentclass[reqno]{article}

enter image description here

  1. Equations on the right: \documentclass[leqno]{article}

enter image description here

  1. Equations justified: \documentclass[fleqn]{article}

enter image description here

So option (2) actually centers display equations. But only if they are numbered! Option (3) probably looks the cleanest, with equations on the left and numbers aligned on the right. And option (1) for some reason refuses to center...??

I notice however, that enabling Clean Mode M-x org-indent-mode throws everything off. Here we can see how the alignment of the equation numbers in option (3) changes:

enter image description here

It would be great if someone could explain why option (1) does not center and why the unnumbered equations in (2) remain left-aligned... Maybe someone else can offer some eLisp to adjust things for org-indent-mode...?

Best,

-Adam