emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brian Powell <powellb@hawaii.edu>
To: emacs-orgmode@gnu.org
Subject: Inconsistent use of \ref and \eqref in ox-latex and ox-html
Date: Fri, 10 Apr 2020 11:56:35 -1000	[thread overview]
Message-ID: <A65F9934-C141-4782-988F-11673BB1548E@hawaii.edu> (raw)

This topic was discussed in 2015:

<https://lists.gnu.org/archive/html/emacs-orgmode/2015-02/msg00527.html>

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))

to

               (format (if org-html-export-mathjax-ref "\\ref{%s}" "\\eqref{%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.

Cheers, 
Brian	
	

             reply	other threads:[~2020-04-11  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10 21:56 Brian Powell [this message]
2020-04-18  8:00 ` Nicolas Goaziou
2020-04-19  7:22   ` Brian Powell
2020-04-19 10:46     ` Nicolas Goaziou
2020-04-19 23:13       ` [PATCH] " Brian Powell
2020-04-20 16:40         ` Nicolas Goaziou
2020-04-20 19:52           ` Brian Powell
2020-04-21 17:46             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A65F9934-C141-4782-988F-11673BB1548E@hawaii.edu \
    --to=powellb@hawaii.edu \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Inconsistent use of \ref and \eqref in ox-latex and ox-html' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).