Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: conf.py: fix some troubles for LaTeX output

While PDF docs work fine on RPM-based distros, it causes conflicts
on Debian & friends.

There are multiple root causes here:

- the latex_elements still resambles the one from Sphinx 1.x
times, where font configurations were stored under
"preamble". It doesn't follow the current recommended way from
Sphinx documentation:

https://www.sphinx-doc.org/en/master/latex.html

- instead of setting the main font, from where other fonts are
derivated, it sets romanfont;

- "fontenc" is not set. This allows the *.tex output file to
contain an UTF-8 incompatible fontset:

\usepackage[T1]{fontenc}

Address such issues to help preventing incompatible usage of
both T1 font and UTF-8 ones that comes from DejaVu font
family.

On some distros, this even generate a LaTeX font warning about
corrupted NFSS tables like this (I got it when running it in
interactive mode):

Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
LaTeX Font Info: Trying to load font information for T1+lmr on input line 11
6.
LaTeX Font Info: No file T1lmr.fd. on input line 116.

LaTeX Font Warning: Font shape `T1/lmr/m/n' undefined
(Font) using `T1/lmr/m/n' instead on input line 116.

! Corrupted NFSS tables.
wrong@fontshape ...message {Corrupted NFSS tables}
error@fontshape else let f...
l.116 ...\familydefault\seriesdefault\shapedefault

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/8104ce56a5ea3509fbb56a8163b779d38a6aaa9c.1755763127.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
d3265de6 e7880da7

+6 -4
+6 -4
Documentation/conf.py
··· 461 461 # Latex figure (float) alignment 462 462 # 'figure_align': 'htbp', 463 463 # Don't mangle with UTF-8 chars 464 + "fontenc": "", 464 465 "inputenc": "", 465 466 "utf8extra": "", 466 467 # Set document margins ··· 477 476 "maxlistdepth": "10", 478 477 # For CJK One-half spacing, need to be in front of hyperref 479 478 "extrapackages": r"\usepackage{setspace}", 480 - # Additional stuff for the LaTeX preamble. 481 - "preamble": dedent(r""" 482 - % Use some font with UTF-8 support with XeLaTeX 479 + "fontpkg": dedent(r""" 483 480 \usepackage{fontspec} 481 + \setmainfont{DejaVu Serif} 484 482 \setsansfont{DejaVu Sans} 485 - \setromanfont{DejaVu Serif} 486 483 \setmonofont{DejaVu Sans Mono} 484 + \newfontfamily\headingfont{DejaVu Serif} 485 + """), 486 + "preamble": dedent(r""" 487 487 % Load kerneldoc specific LaTeX settings 488 488 \input{kerneldoc-preamble.sty} 489 489 """)