From 85b954714cb6344512c9d55cd2afe9a7c017985d Mon Sep 17 00:00:00 2001 From: jfbu Date: Sat, 1 Oct 2016 17:44:46 +0200 Subject: [PATCH] Fix #2810: Problems with pdflatex in an Italian document Depending on the version of the italian module for LaTeX Babel, the double-quote character may have been or not declared as a babel shorthand. The babel ``\shorthandoff`` macro emits an error which aborts compilation if the character isn't a shorthand. This commits wraps the macro in a conditional to test if the character is active or not. modified: sphinx/writers/latex.py --- sphinx/writers/latex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index a139dfc74..ebd96662b 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -93,7 +93,7 @@ class ExtBabel(Babel): if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', 'es', 'spanish', 'nl', 'dutch', 'pl', 'polish', 'it', 'italian'): - return '\\shorthandoff{"}' + return '\\if\\catcode`\\"\\active\\shorthandoff{"}\\fi' elif shortlang in ('tr', 'turkish'): return '\\shorthandoff{=}' return ''