emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-cite: prevent ' from being an active char in LaTeX export
@ 2021-08-23 10:27 Timothy
  2021-08-26  8:24 ` Timothy
  0 siblings, 1 reply; 2+ messages in thread
From: Timothy @ 2021-08-23 10:27 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-cite: prevent ' from being an active char in LaTeX export
  2021-08-23 10:27 [PATCH] org-cite: prevent ' from being an active char in LaTeX export Timothy
@ 2021-08-26  8:24 ` Timothy
  0 siblings, 0 replies; 2+ messages in thread
From: Timothy @ 2021-08-26  8:24 UTC (permalink / raw)
  To: emacs-orgmode

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

Heyo,

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

As this actually fixes a real annoyance, and is a trivial change, I’m pushing
this as a3ba79cd3a.

All the best,
Timothy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-26  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 10:27 [PATCH] org-cite: prevent ' from being an active char in LaTeX export Timothy
2021-08-26  8:24 ` Timothy

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