Fix #2676: (latex) Error with verbatim text in captions

Was caused by PR#2627 due to fragile ``\@noligs`` added to ``\code``.
This commit is contained in:
jfbu 2016-06-14 10:01:53 +02:00
parent c0df9205e6
commit 8608387585
2 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,8 @@ Release 1.4.5 (in development)
Bugs fixed Bugs fixed
---------- ----------
* #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4
Release 1.4.4 (released Jun 12, 2016) Release 1.4.4 (released Jun 12, 2016)
===================================== =====================================

View File

@ -145,10 +145,10 @@
% Some custom font markup commands. % Some custom font markup commands.
% %
\newcommand{\strong}[1]{{\textbf{#1}}} \newcommand{\strong}[1]{{\textbf{#1}}}
% let \code and \bfcode use straight quotes (\@noligs patched by upquote) % let \code and \bfcode use straight quotes. \@noligs patched by upquote,
% use \scantokens to handle e.g. \item[{\code{'fontenc'}}], too late for % but needs protection in "moving arguments" such as for captions.
% \code to change catcodes. \newcommand{\code}{}% raise error if exists already
\newcommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}} \DeclareRobustCommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
\newcommand{\bfcode}[1]{\code{\bfseries#1}} \newcommand{\bfcode}[1]{\code{\bfseries#1}}
\newcommand{\email}[1]{\textsf{#1}} \newcommand{\email}[1]{\textsf{#1}}
\newcommand{\tablecontinued}[1]{\textsf{#1}} \newcommand{\tablecontinued}[1]{\textsf{#1}}