[Top][All Lists]

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

Inconsistent use of \ref and \eqref in ox-latex and ox-html

From: Brian Powell
Subject: Inconsistent use of \ref and \eqref in ox-latex and ox-html
Date: Fri, 10 Apr 2020 11:56:35 -1000

This topic was discussed in 2015:


However, it seems that it we are still stuck with inconsistent exports between 
latex and HTML.

The issue is that when exporting equation numbers with ox-html, it uses 
MathJax's \eqref that wraps the equation in parentheses, for example:

"Refer to (3) for more."

However, when exporting the same document with ox-latex, it uses Latex's \ref 
that does not wrap the equation in parentheses. Would it be possible to add an 
option or variable to ox-html for the user to select whether to use \ref or 
\eqref on export? 

For those of us that publish to HTML and PDF, it is very difficult because you 
end up with either double or no parentheses.

My proposed fix would be a change to ox-html from:

               (format "\\eqref{%s}"
                       (org-export-get-reference destination info))


               (format (if org-html-export-mathjax-ref "\\ref{%s}" 
                       (org-export-get-reference destination info))

The variable org-html-export-mathjax-ref is non-nil to use \ref vs. nil to be 
the default \eqref.


reply via email to

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