From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 1/SqMVvbnF72awAA0tVLHw (envelope-from ) for ; Sun, 19 Apr 2020 23:14:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8DoMHmDbnF7HJwAAB5/wlQ (envelope-from ) for ; Sun, 19 Apr 2020 23:14:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 09165941CBA for ; Sun, 19 Apr 2020 23:14:39 +0000 (UTC) Received: from localhost ([::1]:52914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJ93-0007cf-ET for larch@yhetil.org; Sun, 19 Apr 2020 19:14:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33818 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJ8c-0007cQ-6M for emacs-orgmode@gnu.org; Sun, 19 Apr 2020 19:14:10 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQJ8b-0003DZ-9Z for emacs-orgmode@gnu.org; Sun, 19 Apr 2020 19:14:09 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:33609) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQJ8a-00037d-Nd for emacs-orgmode@gnu.org; Sun, 19 Apr 2020 19:14:08 -0400 Received: by mail-pj1-x1031.google.com with SMTP id 7so3895940pjo.0 for ; Sun, 19 Apr 2020 16:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hawaii-edu.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=psYmkX3yLs68W6E0xz1u3IVz4xlV0VRoQRB8r5HEkS8=; b=PCsg/2vDcZfbmejJgJrz5r3uOunh7oiSBV9sEU6Hf9E++J9Gj8ZZIrFNj3j/1N5Mtf k8HTt42jkKWusE1+6grNNvkFnespQ5Pe59Pva03k4TyrT1pex7DZok31/vgrR3mQLeDi Y55GPmcIBJoQ3jJPO5NYSb7yuE7qvp9bGCGYMY6yk5x2aMkUVSyR6W0s0D/uKhjjqsUV 78khKqHLYp4ExFOdiTitDee/uz/FU9M9MGnO5GVywg2NtIEeRDq/PAtKB3S5xZc+sd2s kasH6kQsrHKqC4Zi+SmVZGxE/1/N0AlWNF0rvLOWhshzojCaBkyU2jW8O0tdrEU1y6mj 5bTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=psYmkX3yLs68W6E0xz1u3IVz4xlV0VRoQRB8r5HEkS8=; b=gPG2QNZMO4y7l/tFSaR4b4McVTUFWyW+yzvDyCRItTnsBbE28EItcN+M+UybKT5ZPz bwOruqQvkcWj2ONiRTs+sJiG3EnxH7qV6c7QJlA/IiMetnI8BkBN+zc8amwVscQnAsPa aKq1tZU87VgcrOOtQI0uz8kyKU+nfx8dwquRG9zS+eeY0iYjZ0BdFlP45uwmHtkltiZc 1Cob4hl6fS2+fYoFuLQNey5DhhrgJIXGwO73NR/XqAJ8oROYJBfpOho9iNnggfFKWjI+ n1Hz6klBJb3s0V5GxexjQOhWw39skjBEjrju+GzARcVm35y7WDhYACPV4SKsgEeHjpzS 0Hqw== X-Gm-Message-State: AGi0PuaHGM973dDg4ubrytbdrQLQ5XeuqBnpfVGa11L0Sg6AghE5ySwR ervq0mRTCE/KaM+dgYXdRNfmq6KBIPY= X-Google-Smtp-Source: APiQypKsDQuuuAFWEUrDSdD+6JRHF/2oEvNzo0qbq4IMIHcg03Nzs5adgCKsV+2ansiZKL7Bn5uk4w== X-Received: by 2002:a17:902:8b87:: with SMTP id ay7mr14493870plb.281.1587338046718; Sun, 19 Apr 2020 16:14:06 -0700 (PDT) Received: from localhost ([132.160.7.12]) by smtp.gmail.com with ESMTPSA id x25sm23338126pfm.203.2020.04.19.16.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 16:14:05 -0700 (PDT) References: <87h7xhxlyt.fsf@nicolasgoaziou.fr> <87k12bwy6g.fsf@nicolasgoaziou.fr> User-agent: mu4e 1.2.0; emacs 28.0.50 From: Brian Powell To: Nicolas Goaziou Subject: [PATCH] Re: Inconsistent use of \ref and \eqref in ox-latex and ox-html In-reply-to: <87k12bwy6g.fsf@nicolasgoaziou.fr> Date: Sun, 19 Apr 2020 13:13:50 -1000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=powellb@hawaii.edu; helo=mail-pj1-x1031.google.com X-detected-operating-system: by eggs1p.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1031 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hawaii-edu.20150623.gappssmtp.com header.s=20150623 header.b=PCsg/2vD; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.31 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.57156362435327]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.24), country: US(-0.01), ip: 209.51.188.17(-0.57)]; HAS_ATTACHMENT(0.00)[]; DKIM_TRACE(0.00)[hawaii-edu.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[209.51.188.17:from]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[powellb@hawaii.edu,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[hawaii-edu.20150623.gappssmtp.com:s=20150623]; URIBL_BLOCKED(0.00)[hawaii.edu:email,hawaii-edu.20150623.gappssmtp.com:dkim]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; DMARC_NA(0.00)[hawaii.edu]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: MQUqxh49hAIA --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-add-org-html-equation-reference-format-to-customize-.patch >From a7c078e4b5f3d97fa7db0e1df192e26e6953ef71 Mon Sep 17 00:00:00 2001 From: Brian Powell 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 --=-=-=--