emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Markus Huber <markus.huber@b-tu.de>
To: emacs-orgmode@gnu.org
Cc: Markus Huber <markus.huber@b-tu.de>
Subject: [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets
Date: Wed, 26 May 2021 12:06:18 +0200	[thread overview]
Message-ID: <20210526100618.78971-1-markus.huber@b-tu.de> (raw)

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



             reply	other threads:[~2021-05-27  1:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 10:06 Markus Huber [this message]
2021-05-29 20:28 ` [PATCH] ox-latex.el/org-latex--make-option-string: Surround option string with braces if it includes brackets Nicolas Goaziou

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=20210526100618.78971-1-markus.huber@b-tu.de \
    --to=markus.huber@b-tu.de \
    --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).