From: Brian Powell <powellb@hawaii.edu>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: [PATCH] Re: Inconsistent use of \ref and \eqref in ox-latex and ox-html
Date: Sun, 19 Apr 2020 13:13:50 -1000 [thread overview]
Message-ID: <m28sir3w7l.fsf@hawaii.edu> (raw)
In-Reply-To: <87k12bwy6g.fsf@nicolasgoaziou.fr>
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]
Nicolas, thank you for the feedback, and I apologize for my errors.
On Sun, Apr 19 2020, Nicolas Goaziou wrote:
>
> You need to provide a commit message, using git format-patch
> mechanism.
>
Apologies while I learn the procedure. I have corrected the issues below and generated a commit patch attached. Please let me know if there are any problems.
> However, it would be nice to reference that variable in
>
> Publishing > Configuration > Options for the exporters > HTML specific properties
>
It is now listed in this section and removed from the others.
>
> It might be useful to explicitly state this is a format control string,
> expecting a single argument, the actual reference.
>
>
> It should be "9.4".
>
Both are corrected.
>
> Indentation problem?
>
The indentation problem is in the original org code.
Thank you for all of your help and efforts.
Cheers,
Brian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-add-org-html-equation-reference-format-to-customize-.patch --]
[-- Type: text/x-patch, Size: 3499 bytes --]
From a7c078e4b5f3d97fa7db0e1df192e26e6953ef71 Mon Sep 17 00:00:00 2001
From: Brian Powell <powellb@hawaii.edu>
Date: Sun, 19 Apr 2020 12:59:53 -1000
Subject: [PATCH] add org-html-equation-reference-format to customize MathJax
ref command
---
doc/org-manual.org | 1 +
lisp/ox-html.el | 23 ++++++++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 6d5a34e56..4b1a14ef4 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -15851,6 +15851,7 @@ Settings]]), however, override everything.
| ~:html-link-use-abs-url~ | ~org-html-link-use-abs-url~ |
| ~:html-mathjax-options~ | ~org-html-mathjax-options~ |
| ~:html-mathjax-template~ | ~org-html-mathjax-template~ |
+| ~:html-equation-reference-format~ | ~org-html-equation-reference-format~ |
| ~:html-metadata-timestamp-format~ | ~org-html-metadata-timestamp-format~ |
| ~:html-postamble-format~ | ~org-html-postamble-format~ |
| ~:html-postamble~ | ~org-html-postamble~ |
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index e70b8279b..0565d47f0 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -121,6 +121,7 @@
(:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
(:html-link-up "HTML_LINK_UP" nil org-html-link-up)
(:html-mathjax "HTML_MATHJAX" nil "" space)
+ (:html-equation-reference-format "HTML_EQUATION_REFERENCE_FORMAT" nil org-html-equation-reference-format t)
(:html-postamble nil "html-postamble" org-html-postamble)
(:html-preamble nil "html-preamble" org-html-preamble)
(:html-head "HTML_HEAD" nil org-html-head newline)
@@ -761,6 +762,22 @@ The function should return the string to be exported."
;;;; LaTeX
+(defcustom org-html-equation-reference-format "\\eqref{%s}"
+ "MathJax command to use when referencing equations. This is a
+format controls string, expecting a single argument, the equation
+being referenced that is generated on export.
+
+Default is to wrap equations in parentheses (using \"\\eqref{%s}\)\".
+
+Most common values are:
+
+ \"\\eqref{%s}\" Wrap the equation in parentheses
+ \"\\ref{%s}\" Do not wrap the equation in parentheses"
+ :group 'org-export-html
+ :package-version '(Org . "9.4")
+ :type 'string
+ :safe t)
+
(defcustom org-html-with-latex org-export-with-latex
"Non-nil means process LaTeX math snippets.
@@ -3113,9 +3130,9 @@ INFO is a plist holding contextual information. See
(eq 'latex-environment (org-element-type destination))
(eq 'math (org-latex--environment-type destination)))
;; Caption and labels are introduced within LaTeX
- ;; environment. Use "eqref" macro to refer to those in
- ;; the document.
- (format "\\eqref{%s}"
+ ;; environment. Use "ref" or "eqref" macro, depending on user
+ ;; preference to refer to those in the document.
+ (format (plist-get info :html-equation-reference-format)
(org-export-get-reference destination info))
(let* ((ref (org-export-get-reference destination info))
(org-html-standalone-image-predicate
--
2.26.0
next prev parent reply other threads:[~2020-04-19 23:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 21:56 Inconsistent use of \ref and \eqref in ox-latex and ox-html Brian Powell
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 ` Brian Powell [this message]
2020-04-20 16:40 ` [PATCH] " 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=m28sir3w7l.fsf@hawaii.edu \
--to=powellb@hawaii.edu \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public 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).