fix latex, since 1.4.4 inline literal text is followed by spurious space

ref: a51681b use of ``\scantokens`` has a quirk with adding a space in
some cases which we fix by inserting a ``\relax`` at the end of the
argument.
This commit is contained in:
jfbu 2016-06-24 15:14:37 +02:00
parent fab5911004
commit b6daf6be56
2 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@ Bugs fixed
* #2705: `toctree` generates empty bullet_list if ``:titlesonly:`` specified
* #2479: `sphinx.ext.viewcode` uses python2 highlighter by default
* #2700: HtmlHelp builder has hard coded index.html
* latex, since 1.4.4 inline literal text is followed by spurious space
Release 1.4.4 (released Jun 12, 2016)

View File

@ -168,7 +168,7 @@
% 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}}}}
\DeclareRobustCommand{\sphinxcode}[1]{{\@noligs\scantokens{\texttt{#1}\relax}}}
\newcommand{\sphinxbfcode}[1]{\sphinxcode{\bfseries#1}}
\newcommand{\sphinxemail}[1]{\textsf{#1}}
\newcommand{\sphinxtablecontinued}[1]{\textsf{#1}}
@ -909,6 +909,6 @@
}
% robustified case needs special treatment
\newcommand\code{}\let\code\relax
\DeclareRobustCommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
\DeclareRobustCommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}\relax}}}
\def\sphinxcode{\code}%
\fi