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
This commit is contained in:
jfbu 2016-10-01 17:44:46 +02:00
parent ec934d476a
commit 85b954714c

View File

@ -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 ''