1

According to my reading of the documentation, something like this should work in my org file:

#+NAME: eq:one
\[
x^2+y^2=z^2
\]

You can see, by considering equation [[eq:one]] that a sum of squares...

But it doesn't. I'm getting an error saying: Unable to resolve link: "eq:one". In fact, I'm trying to use several links in this file, but none of them are working, so clearly I'm missing something here.

I believe MathJax allows the usual LaTeX \label and \eqref constructs, but so far I haven't had much luck with them either.

I'm moving from PDF to HTML-based material (all the better for accessibility), and the org file was created by applying pandoc to my original LaTeX file. This has worked before, and I'm quite happy to spend time touching up the org file to ensure a smooth conversion to HTML. But I've never had to wrestle with internal cross-references before.

Thank you!

2
  • I would start by looking into John Kitchin's org-ref - (I am no expert at it, so I hope he might chime in with his opinion).
    – NickD
    Mar 31, 2021 at 14:35
  • I managed in the end by turning equation numbering on as a Mathjax configuration option, which makes "\label", "\ref", "\eqref" to work in org -> html as they would in LaTeX. It turns out that I can manage Mathjax options by using the "#+HTML_HEAD:" function in orgmode. Apr 1, 2021 at 3:11

1 Answer 1

1

I know I'm late to the party, but I suspect it's because, in LaTeX, \[\] are used for non-numbered equations in display mode. Trying to export an example similar to that to PDF didn't assign a number to the equation, so there was no equation number to reference. Probably this distinction is kept also in HTML export, and you cannot see the reference. On my machine, exporting to basic HTML (C-c C-e h o) this snippet:

#+name: eq:einstein
\begin{equation}
E=mc^2
\end{equation}

We can see from [[eq:einstein]] ...

works.


EDIT: turned out in the comments that this is actually a distinction performed by Org mode, not the particular export engine

2
  • 1
    Your solution works, but your suspicion is not correct: Org mode does not know anything about LaTeX (it just copies things blindly). In particular, if you use an equation* environment, the equation will be unnumbered because LaTeX (and MathJax) know about that environment, but the reference will still say 1. The difference is that Org mode syntactically treats the construct \[ .. \] as an inline element (and there are no refs to inline elements) but it treats \begin{equation} (either the unstarred or starred variety) as a latex environment, a block element which can have a ref.
    – NickD
    Aug 25, 2022 at 22:00
  • 1
    These things look like LaTeX to you and me, but the Org mode parser does not care: it deals with them in its own way. There was an extensive discussion about this on the Org mode ML a couple of months back.
    – NickD
    Aug 25, 2022 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.