From 83da5df5059b988b6ebc53018790425260bbe74c Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Tue, 29 Dec 2015 14:36:57 -0800 Subject: [PATCH] LaTeX: Disable specific UTF-8 support commands for XeTeX and LuaTeX XeTeX and LuaTeX have builtin UTF-8 support. --- sphinx/writers/latex.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 6f56c5fb0..28410257e 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -249,7 +249,9 @@ class LaTeXTranslator(nodes.NodeVisitor): 'classoptions': '', 'extraclassoptions': '', 'inputenc': '\\usepackage[utf8]{inputenc}', - 'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}', + 'utf8extra': ('\\ifdefined\\DeclareUnicodeCharacter\n' + ' \\DeclareUnicodeCharacter{00A0}{\\nobreakspace}\n' + '\\else\\fi'), 'cmappkg': '\\usepackage{cmap}', 'fontenc': '\\usepackage[T1]{fontenc}', 'babel': '\\usepackage{babel}',