[Python-modules-commits] [sphinx] 01/03: Fix #2676: (latex) Error with verbatim text in captions
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Fri Jul 1 18:03:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch master
in repository sphinx.
commit 4ed04e6d3d7b29cda7b75d7870d3784f826bed47
Author: jfbu <jfbu at free.fr>
Date: Tue Jun 14 10:01:53 2016 +0200
Fix #2676: (latex) Error with verbatim text in captions
Was caused by PR#2627 due to fragile ``\@noligs`` added to ``\code``.
Patch-Name: latex_code_robust.diff
---
sphinx/texinputs/sphinx.sty | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 9b09b2b..1c98654 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -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}}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx.git
More information about the Python-modules-commits
mailing list