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

Skip to content

Commit 5174f5a

Browse files
committed
Closes matplotlib#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 3d1a1bc commit 5174f5a

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
@@ -307,7 +307,19 @@ def _check_dependencies():
307307
# the title page.
308308
latex_logo = None
309309

310+
# Use Unicode aware LaTeX engine
311+
latex_engine = 'xelatex' # or 'lualatex'
312+
310313
latex_elements = {}
314+
315+
# Keep babel usage also with xelatex (Sphinx default is polyglossia)
316+
# If this key is removed or changed, latex build directory must be cleaned
317+
latex_elements['babel'] = r'\usepackage{babel}'
318+
319+
# Font configuration
320+
# Sphinx default since 2.x is GNU FreeFont
321+
latex_elements['fontpkg'] = r'\setmainfont{DejaVu Serif}'
322+
311323
# Additional stuff for the LaTeX preamble.
312324
latex_elements['preamble'] = r"""
313325
% In the parameters section, place a newline after the Parameters
@@ -317,11 +329,6 @@ def _check_dependencies():
317329
\let\latexdescription=\description
318330
\def\description{\latexdescription{}{} \breaklabel}
319331
320-
\usepackage{amsmath}
321-
\usepackage{amsfonts}
322-
\usepackage{amssymb}
323-
\usepackage{txfonts}
324-
325332
% The enumitem package provides unlimited nesting of lists and
326333
% enums. Sphinx may use this in the future, in which case this can
327334
% be removed. See
@@ -358,13 +365,6 @@ def _check_dependencies():
358365

359366
numpydoc_show_class_members = False
360367

361-
latex_engine = 'xelatex' # or 'lualatex'
362-
363-
latex_elements = {
364-
'babel': r'\usepackage{babel}',
365-
'fontpkg': r'\setmainfont{DejaVu Serif}',
366-
}
367-
368368
html4_writer = True
369369

370370
inheritance_node_attrs = dict(fontsize=16)

0 commit comments

Comments
 (0)
0