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

Skip to content

Commit c7c05d3

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 447bdbb commit c7c05d3

File tree

1 file changed

+12
-12
lines changed

1< 8000 !-- --> file changed

+12
-12
lines changed

doc/conf.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,19 @@ def _check_dependencies():
320320
# the title page.
321321
latex_logo = None
322322

323+
# Use Unicode aware LaTeX engine
324+
latex_engine = 'xelatex' # or 'lualatex'
325+
323326
latex_elements = {}
327+
328+
# Keep babel usage also with xelatex (Sphinx default is polyglossia)
329+
# If this key is removed or changed, latex build directory must be cleaned
330+
latex_elements['babel'] = r'\usepackage{babel}'
331+
332+
# Font configuration
333+
# Sphinx default since 2.x is GNU FreeFont
334+
latex_elements['fontpkg'] = r'\setmainfont{DejaVu Serif}'
335+
324336
# Additional stuff for the LaTeX preamble.
325337
latex_elements['preamble'] = r"""
326338
% One line per author on title page
@@ -333,11 +345,6 @@ def _check_dependencies():
333345
\let\latexdescription=\description
334346
\def\description{\latexdescription{}{} \breaklabel}
335347
336-
\usepackage{amsmath}
337-
\usepackage{amsfonts}
338-
\usepackage{amssymb}
339-
\usepackage{txfonts}
340-
341348
% The enumitem package provides unlimited nesting of lists and
342349
% enums. Sphinx may use this in the future, in which case this can
343350
% be removed. See
@@ -371,13 +378,6 @@ def _check_dependencies():
371378

372379
numpydoc_show_class_members = False
373380

374-
latex_engine = 'xelatex' # or 'lualatex'
375-
376-
latex_elements = {
377-
'babel': r'\usepackage{babel}',
378-
'fontpkg': r'\setmainfont{DejaVu Serif}',
379-
}
380-
381381
html4_writer = True
382382

383383
inheritance_node_attrs = dict(fontsize=16)

0 commit comments

Comments
 (0)
0