emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Equation references in HTML export


From: Thibault Marin
Subject: [O] Equation references in HTML export
Date: Thu, 04 Jan 2018 23:30:28 -0600
User-agent: mu4e 0.9.18; emacs 25.2.2

Attachment: 0001-ox-html.el-Add-MathJax-label-and-reference-to-equati.patch
Description: Text Data

Hi list,

I am trying to get links to equations to work with HTML export (with Org mode
version 9.1.6 (release_9.1.6-295-ge8cd52 @ /.../org-mode-git/lisp/)).

It currently does not seem to work, as demonstrated by the following example org
file:

#+begin_src org
,#+NAME: eq-test
\begin{align}
1 + 1 = 0
\end{align}

link to equation [[eq-test]]
#+end_src

The relevant part of the resulting HTML is:

#+begin_src html
\begin{align}
1 + 1 = 0
\end{align}

<p>
link to equation <a href="#org0b47727">1</a>
</p>
#+end_src

The =align= block does not have a =label=.  The link could use =\ref= (or
=\eqref=) which is handled by MathJax.  The attached patch attempts to fix
this.  It produces the following (correct?) output:

#+begin_src html
\begin{align}
\label{eq:orgbfedefe}
1 + 1 = 0
\end{align}

<p>
link to equation \eqref{eq:orgbfedefe}
</p>
#+end_src

The patch attempts to re-use functionality from ox-latex.el to avoid code
duplication.  Please let me know if there is a better way to achieve the
same result.

Does this look like something that could eventually be merged?  Let me know if
any change is required.

Thanks,

thibault

reply via email to

[Prev in Thread] Current Thread [Next in Thread]