6

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

Werner
  • 14,324
  • 7
  • 55
  • 77
Adam
  • 2,137
  • 16
  • 29

1 Answers1

4

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

Adam
  • 2,137
  • 16
  • 29
  • Just wanted to follow up on your question @Adam. Were you able to figure out what is going on here and what was your final solution? thanks! – Rotkiv Sep 30 '18 at 17:17
  • 2
    Hi @Rotkiv - the only way I was able to deal with this is to place the equation numbers on the left. But [John Kitchin](https://emacs.stackexchange.com/users/9134/john-kitchin) has a [script](http://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-LaTeX-fragments-in-org-mode/) that addresses this. – Adam Sep 30 '18 at 21:21