Skip to content

Commit

Permalink
Fix #2676: (latex) Error with verbatim text in captions
Browse files Browse the repository at this point in the history
Was caused by PR#2627 due to fragile ``\@noligs`` added to ``\code``.
  • Loading branch information
jfbu committed Jun 14, 2016
1 parent c0df920 commit 8608387
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -4,6 +4,8 @@ Release 1.4.5 (in development)
Bugs fixed
----------

* #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4


Release 1.4.4 (released Jun 12, 2016)
=====================================
Expand Down
8 changes: 4 additions & 4 deletions sphinx/texinputs/sphinx.sty
Expand Up @@ -145,10 +145,10 @@
% Some custom font markup commands.
%
\newcommand{\strong}[1]{{\textbf{#1}}}
% let \code and \bfcode use straight quotes (\@noligs patched by upquote)
% use \scantokens to handle e.g. \item[{\code{'fontenc'}}], too late for
% \code to change catcodes.
\newcommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
% let \code and \bfcode use straight quotes. \@noligs patched by upquote,
% but needs protection in "moving arguments" such as for captions.
\newcommand{\code}{}% raise error if exists already
\DeclareRobustCommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
\newcommand{\bfcode}[1]{\code{\bfseries#1}}
\newcommand{\email}[1]{\textsf{#1}}
\newcommand{\tablecontinued}[1]{\textsf{#1}}
Expand Down

0 comments on commit 8608387

Please sign in to comment.