8000 Closes #15796: latex_elements defined twice in doc/conf.py · matplotlib/matplotlib@8b6e341 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b6e341

Browse files
jfbuQuLogic
authored andcommitted
Closes #15796: latex_elements defined twice in doc/conf.py
This commit reactivates original latex_elements['preamble'] key which was shadowed by the bug about latex_elements being defined twice in the conf.py. It removes from this latex preamble the loading of amsmath, amssymb, amsfonts as this is already added by Sphinx, and of txfonts because this is not compatible with fontspec and the already executed command \setmainfont{DejaVu Serif}. Memo: expdlist package breaks PDF build if a description list ends up in a table cell, as happens actually with Matplotlib.tex file. But, by luck, the enumitem LaTeX package modifications of LaTeX description lists masks the expdlist potential breakage.
1 parent 5184577 commit 8b6e341

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

doc/conf.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,19 @@ def _check_dependencies():
342342
# the title page.
343343
latex_logo = None
344344

345+
# Use Unicode aware LaTeX engine
346+
latex_engine = 'xelatex' # or 'lualatex'
347+
345348
latex_elements = {}
349+
350+
# Keep babel usage also with xelatex (Sphinx default is polyglossia)
351+
# If this key is removed or changed, latex build directory must be cleaned
352+
latex_elements['babel'] = r'\usepackage{babel}'
353+
354+
# Font configuration
355+
# Sphinx default since 2.x is GNU FreeFont
356+
latex_elements['fontpkg'] = r'\setmainfont{DejaVu Serif}'
357+
346358
# Additional stuff for the LaTeX preamble.
347359
latex_elements['preamble'] = r"""
348360
% One line per author on title page
@@ -355,11 +367,6 @@ def _check_dependencies():
355367
\let\latexdescription=\description
356368
\def\description{\latexdescription{}{} \breaklabel}
357369
358-
\usepackage{amsmath}
359-
\usepackage{amsfonts}
360-
\usepackage{amssymb}
361-
\usepackage{txfonts}
362-
363370
% The enumitem package provides unlimited nesting of lists and
364371
% enums. Sphinx may use this in the future, in which case this can
365372
% be removed. See
@@ -393,13 +400,6 @@ def _check_dependencies():
393400

394401
numpydoc_show_class_members = False
395402

396-
latex_engine = 'xelatex' # or 'lualatex'
397-
398-
latex_elements = {
399-
'babel': r'\usepackage{babel}',
400-
'fontpkg': r'\setmainfont{DejaVu Serif}',
401-
}
402-
403403
html4_writer = True
404404

405405
inheritance_node_attrs = dict(fontsize=16)

0 commit comments

Comments
 (0)
0