Package: python-sphinx
Version: 1.4.4-2
Severity: important
Tags: patch upstream

Dear Maintainer,

With sphinx 1.4.4 latex output is broken when handling \code inside places like
\caption{}. This is reported upstream:

  https://github.com/sphinx-doc/sphinx/issues/2676

and fixed in upstream git

  
https://github.com/sphinx-doc/sphinx/commit/8608387585b6d24945a4ba94f80f50714425a6d4

(attached)

Please consider including this patch in the package as this problem causes
the pyx and pyx3 sources to FTBFS.

thanks
Stuart
>From 8608387585b6d24945a4ba94f80f50714425a6d4 Mon Sep 17 00:00:00 2001
From: jfbu <[email protected]>
Date: Tue, 14 Jun 2016 10:01:53 +0200
Subject: [PATCH] Fix #2676: (latex) Error with verbatim text in captions

Was caused by PR#2627 due to fragile ``\@noligs`` added to ``\code``.
---
 CHANGES                     | 2 ++
 sphinx/texinputs/sphinx.sty | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index 3c1b5d9..890d9bd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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)
 =====================================
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}}
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to