summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/config.rst2
-rw-r--r--sphinx/templates/latex/content.tex_t2
-rw-r--r--sphinx/writers/latex.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/doc/config.rst b/doc/config.rst
index ec26d7b2f..da9892be9 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1768,7 +1768,7 @@ These options influence LaTeX output. See further :doc:`latex`.
``'inputenc'``
"inputenc" package inclusion, defaults to
``'\\usepackage[utf8]{inputenc}'`` when using pdflatex.
- Otherwise unset.
+ Otherwise empty.
.. versionchanged:: 1.4.3
Previously ``'\\usepackage[utf8]{inputenc}'`` was used for all
diff --git a/sphinx/templates/latex/content.tex_t b/sphinx/templates/latex/content.tex_t
index 1581a5822..670a92f46 100644
--- a/sphinx/templates/latex/content.tex_t
+++ b/sphinx/templates/latex/content.tex_t
@@ -15,9 +15,7 @@
\fi \sphinxpxdimen=<%= pxunit %>\relax
<%= passoptionstopackages %>
<%= geometry %>
-<% if latex_engine == 'pdflatex' -%>
<%= inputenc %>
-<% endif -%>
<%= utf8extra %>
<%= cmappkg %>
<%= fontenc %>
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 90d7096cd..84697a4f9 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -102,7 +102,9 @@ DEFAULT_SETTINGS = {
ADDITIONAL_SETTINGS = {
'pdflatex': {
'inputenc': '\\usepackage[utf8]{inputenc}',
- 'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
+ 'utf8extra': ('\\ifdefined\\DeclareUnicodeCharacter\n'
+ ' \\DeclareUnicodeCharacter{00A0}{\\nobreakspace}\n'
+ '\\fi'),
},
'xelatex': {
'latex_engine': 'xelatex',