ox-latex: Surround option string with braces if it includes brackets

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
This commit is contained in:
Markus Huber 2021-05-26 12:06:18 +02:00 committed by Nicolas Goaziou
parent f4aac6090d
commit 54863e802f
1 changed files with 4 additions and 1 deletions

View File

@ -1494,7 +1494,10 @@ nil."
(pcase-let ((`(,keyword ,value) pair))
(concat keyword
(and (> (length value) 0)
(concat "=" value)))))
(concat "="
(if (string-match-p (rx (any "[]")) value)
(format "{%s}" value)
value))))))
options
","))