emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets
@ 2021-05-26 10:06 Markus Huber
  2021-05-29 20:28 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Huber @ 2021-05-26 10:06 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Markus Huber

lisp/ox-latex.el (`org-latex--make-option-string'): If `value' of a `pair' from `options' contains a bracket
the whole `value' is surrounded by braces.

In case of LaTeX export using listings the dialect of a language (e.g. [LaTeX]TeX) is surrounded by brackets. For inline
source blocks all options end as optional argument to \lstinline between brackets which breaks the LaTeX parser.
TINYCHANGE
---
 lisp/ox-latex.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index b9ecf070a..2f7bbdf15 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1486,7 +1486,7 @@ nil."
 	       (pcase-let ((`(,keyword ,value) pair))
 		 (concat keyword
 			 (and (> (length value) 0)
-			      (concat "=" value)))))
+			      (concat "=" (if (string-match-p "\\[\\|\\]" value) (format "{%s}" value) value))))))
 	     options
 	     ","))
 
-- 
2.31.1



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

* Re: [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets
  2021-05-26 10:06 [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets Markus Huber
@ 2021-05-29 20:28 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2021-05-29 20:28 UTC (permalink / raw)
  To: Markus Huber; +Cc: emacs-orgmode

Hello,

Markus Huber <markus.huber@b-tu.de> writes:

> lisp/ox-latex.el (`org-latex--make-option-string'): If `value' of a `pair' from `options' contains a bracket
> the whole `value' is surrounded by braces.
>
> In case of LaTeX export using listings the dialect of a language (e.g. [LaTeX]TeX) is surrounded by brackets. For inline
> source blocks all options end as optional argument to \lstinline between brackets which breaks the LaTeX parser.
> TINYCHANGE

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou


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

end of thread, other threads:[~2021-05-29 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 10:06 [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets Markus Huber
2021-05-29 20:28 ` Nicolas Goaziou

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