Search code examples
emacselisporg-mode

Emacs org-mode: increment equation numbers with latex preview


I've noticed that equation numbers, generated with latex preview in Org Mode do not increment above (1). Is there some way to fix this?

Here is my code:

A numbered display equation:

\begin{equation}
y=\int_{-\infty}^{\infty}\frac{1}{1+x}dx\label{eq1}
\end{equation}

A second numbered equation:

\begin{equation}
z=qr^2-2\label{eq2}
\end{equation}

Thanks!

-Adam


Solution

  • The easiest thing is to explicitely \tag the equations. The disadvantage is that there is no automatic numbering the advantage is that this also works for html export with MathJax.

    Even if there is no automatic numbering you can easily correct the numbering with query-replace-regexp by replacing \\tag{[0-9]+} with \\tag{\,(1+ \#)}.

    Your example would look like

    A numbered display equation:
    
    \begin{equation}
    y=\int_{-\infty}^{\infty}\frac{1}{1+x}dx\label{eq1}\tag{1}
    \end{equation}
    
    A second numbered equation:
    
    \begin{equation}
    z=qr^2-2\label{eq2}\tag{2}
    \end{equation}