Fix #3009: Bad rendering of parsed-literals in LaTeX

This reverts the ``\scantokens`` added (commit 86083875) to ``\code``
(aka ``\sphinxcode``), in case it is encountered inside a parsed-literal
directive. Indeed strange interference arise then. The problem would
occur in Verbatim too, but I think ``\sphinxcode`` is not encountered
there.
This commit is contained in:
jfbu 2016-10-05 10:48:54 +02:00
parent d43259f5f7
commit 44f595a63f

View File

@ -163,7 +163,9 @@
% let \sphinxcode and \sphinxbfcode use straight quotes. \@noligs patched by upquote,
% but needs protection in "moving arguments" such as for captions.
% Use \scantokens to handle e.g. \item[{\sphinxcode{'fontenc'}}]
\DeclareRobustCommand{\sphinxcode}[1]{{\@noligs\scantokens{\texttt{#1}\relax}}}
\DeclareRobustCommand{\sphinxcode}[1]{{\def\@tempa{alltt}%
\ifx\@tempa\@currenvir\else\@noligs\endlinechar\m@ne\everyeof{\noexpand}%
\expandafter\scantokens\fi {\texttt{#1}}}}
\newcommand{\sphinxbfcode}[1]{\sphinxcode{\bfseries#1}}
\newcommand{\sphinxemail}[1]{\textsf{#1}}
\newcommand{\sphinxtablecontinued}[1]{\textsf{#1}}
@ -1008,7 +1010,9 @@
}
% robustified case needs special treatment
\newcommand\code{}\let\code\relax
\DeclareRobustCommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}\relax}}}
\DeclareRobustCommand{\code}[1]{{\def\@tempa{alltt}%
\ifx\@tempa\@currenvir\else\@noligs\endlinechar\m@ne\everyeof{\noexpand}%
\expandafter\scantokens\fi {\texttt{#1}}}}
\def\sphinxcode{\code}%
\fi