emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Timothy <tecosaur@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-cite: prevent ' from being an active char in LaTeX export
Date: Mon, 23 Aug 2021 18:27:59 +0800	[thread overview]
Message-ID: <87o89otpq4.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

Hi All,

This is a band-aid over the issue raised in
<https://lists.gnu.org/archive/html/emacs-orgmode/2021-08/msg00342.html>.

      I’ve come across an issue with the `hanging’ package we’re currently using for
      LaTeX exports — it also affects punctuation, and makes `,.’“`?!:;’ active
      characters throughout the entire document. That means a LaTeX snippet like:
      f’(x) Will now fail to compile ☹. See…

By just adding the [notquote] option, ’ is no longer an active char, and so
f’(x) no longer breaks documents. Long-term, I still think that getting rid of
all this active char stuff would be a good idea, by switching out hanging for
use of `\parshape' if possible.

All the best,
Timothy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-oc-csl-Prevent-from-being-a-LaTeX-active-char.patch --]
[-- Type: text/x-patch, Size: 1358 bytes --]

From ad63eb8f4d7d02c9864d5caded0b4f2ee9f54133 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Mon, 23 Aug 2021 18:18:33 +0800
Subject: [PATCH] oc-csl: Prevent ' from being a LaTeX active char

* lisp/oc-csl.el (org-cite-csl-finalizer): The hanging LaTeX package
we're using also affects punctuation and makes `,.'"`?!:;' active
characters throughout the entire document.  That means a LaTeX snippet
like \(f'(x)\) will now make the document fail to compile.
See <https://tex.stackexchange.com/questions/61732/hanging-package-chokes-on-apostrophes>
for more information.  Adding the [notquote] option stops \(f'(x)\) from
being an issue.

In time it could be worth looking into replacing the hanging package
with some use of \parshape.
---
 lisp/oc-csl.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 617bddb7e..36a885641 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -595,7 +595,7 @@ (defun org-cite-csl-finalizer (output _keys _files _style _backend info)
         (goto-char (match-beginning 0))
         (let ((re (rx "\\usepackage" (opt "[" (*? nonl) "]") "{hanging}")))
           (unless (re-search-backward re nil t)
-            (insert "\\usepackage{hanging}\n"))))
+            (insert "\\usepackage[notquote]{hanging}\n"))))
       (buffer-string))))
 
 \f
-- 
2.32.0


             reply	other threads:[~2021-08-23 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 10:27 Timothy [this message]
2021-08-26  8:24 ` [PATCH] org-cite: prevent ' from being an active char in LaTeX export Timothy

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=87o89otpq4.fsf@gmail.com \
    --to=tecosaur@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).