lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8104ce56a5ea3509fbb56a8163b779d38a6aaa9c.1755763127.git.mchehab+huawei@kernel.org>
Date: Thu, 21 Aug 2025 10:16:42 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>,
	Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
	"Mauro Carvalho Chehab" <mchehab+huawei@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: [PATCH v2 06/14] 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@...tshape ...message {Corrupted NFSS tables}
                                                  error@...tshape else let f...
	l.116 ...\familydefault\seriesdefault\shapedefault

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
 Documentation/conf.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 628af81e6879..5888e2988b4f 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -461,6 +461,7 @@ latex_elements = {
     # Latex figure (float) alignment
     # 'figure_align': 'htbp',
     # Don't mangle with UTF-8 chars
+    "fontenc": "",
     "inputenc": "",
     "utf8extra": "",
     # Set document margins
@@ -476,13 +477,14 @@ latex_elements = {
     "maxlistdepth": "10",
     # For CJK One-half spacing, need to be in front of hyperref
     "extrapackages": r"\usepackage{setspace}",
-    # Additional stuff for the LaTeX preamble.
-    "preamble": dedent(r"""
-        % Use some font with UTF-8 support with XeLaTeX
+    "fontpkg": dedent(r"""
         \usepackage{fontspec}
+        \setmainfont{DejaVu Serif}
         \setsansfont{DejaVu Sans}
-        \setromanfont{DejaVu Serif}
         \setmonofont{DejaVu Sans Mono}
+        \newfontfamily\headingfont{DejaVu Serif}
+    """),
+    "preamble": dedent(r"""
         % Load kerneldoc specific LaTeX settings
         \input{kerneldoc-preamble.sty}
     """)
-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ