GNU bug report logs -
#48078
Verbatim environments with key-value arguments
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi,
I am writing styles for the minted and listings libraries of tcolorbox,
which introduce the tcblisting verbatim environment. Here is a small
example showing things:
[tcblisting.tex (text/x-tex, inline)]
\documentclass[preview,svgnames,x11names]{standalone}
\RequirePackage[newfloat]{minted}
\RequirePackage{tcolorbox}
\tcbuselibrary{most,minted}
\begin{document}
\begin{tcblisting}{%
listing only,%
title={Example shell session},
minted language=shell-session,%
minted options={},%
}
$ echo 'Hello, World!'
Hello, World!
\end{tcblisting}
\end{document}
% Local Variables:
% mode: latex
% TeX-command-extra-options: "-shell-escape"
% TeX-master: t
% End:
[Message part 3 (text/plain, inline)]
As you can see, tcblisting takes key-value arguments. This breaks the
"mandatory arguments to verbatim environments" part of
`font-latex-syntactic-keywords', which is defined as:
;; After the optional argument, there may also be
;; another mandatory argument(s) (e.g. with VerbatimOut or
;; the minted envs or defined with `lstnewenvironment').
"\\(?:{[^}]*}\\)*"
Since the key-value arguments _can_ contain braces (e.g., title={Example
shell session}), the regex does not match properly and messes up the
fontification.
Feel free to add "tcblisting" to `LaTeX-verbtaim-environments' and check
out the example above: You will see that everything after title={Example
shell session} is fontified as verbatim.
I would be happy to try and improve the regex so that it handles
key-value arguments, but I first wanted to ask if this is indeed and the
best approach.
Best regards,
--
Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
Key fingerprint = F7C3 734D 2381 DAEB 4C6D 9CF7 744A 4F0B 4F1C 9371
$ gpg --keyserver hkps://hkps.pool.sks-keyservers.net \
--search-keys 744A4F0B4F1C9371
This bug report was last modified 4 years and 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.