From 75055573847339c35c3f06ac623e9d1bf397fdf5 Mon Sep 17 00:00:00 2001 From: jfbu Date: Sun, 6 Nov 2016 13:55:43 +0100 Subject: [PATCH] fix latex inline literals where ``< > -`` gobbled a space --- CHANGES | 1 + sphinx/texinputs/sphinx.sty | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 89bcb4e584..1d4b8ec024 100644 --- a/CHANGES +++ b/CHANGES @@ -34,6 +34,7 @@ Bugs fixed * #777: LaTeX output "too deeply nested" (ref #3096) * Let LaTeX image inclusion obey ``scale`` before textwidth fit (ref #2865, #3059) * #3019: LaTeX fails on description of C function with arguments (ref #3083) +* fix latex inline literals where ``< > -`` gobbled a space Release 1.5 alpha2 (released Oct 17, 2016) ========================================== diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 498118898d..b89ffa64eb 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -245,12 +245,19 @@ \long\protected\def\sphinxcode#1{{\def\@tempa{alltt}% \ifx\@tempa\@currenvir\else \ifspx@opt@inlineliteralwraps - \def\verbatim@nolig@list {\do\`\do\<\do\>\do\'\do\-}% \sphinxbreaksviaactive\let\sphinxafterbreak\empty + % do not overwrite the comma set-up + \let\verbatim@nolig@list\sphinx@literal@nolig@list \fi + % fix a space-gobbling issue due to LaTeX's original \do@noligs + \let\do@noligs\sphinx@do@noligs \@noligs\endlinechar\m@ne\everyeof{\noexpand}% \expandafter\scantokens \fi {\texttt{#1}}}} +\def\sphinx@do@noligs #1{\catcode`#1\active\begingroup\lccode`\~`#1\relax + \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1 }}} +\def\sphinx@literal@nolig@list {\do\`\do\<\do\>\do\'\do\-}% + \long\protected\def\sphinxbfcode#1{\sphinxcode{\bfseries#1}} \long\protected\def\sphinxemail#1{\textsf{#1}} \long\protected\def\sphinxtablecontinued#1{\textsf{#1}}