docs: kerneldoc-preamble: Test xeCJK.sty before loading
authorAkira Yokosawa <akiyks@gmail.com>
Mon, 8 Aug 2022 08:53:57 +0000 (17:53 +0900)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Aug 2022 17:27:55 +0000 (11:27 -0600)
commitcee7db1b0239468b22c295cf04a8c40c34ecd35a
tree98e853e66e5c72a4419df8dfa693e239d9b23023
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868
docs: kerneldoc-preamble: Test xeCJK.sty before loading

On distros whose texlive packaging is fine-grained, texlive-xecjk
can be installed/removed independently of other texlive packages.
Conditionally loading xeCJK depending only on the existence of the
"Noto Sans CJK SC" font might end up in xelatex error of
"xeCJK.sty not found!".

Improve the situation by testing existence of xeCJK.sty before
loading it.

This is useful on RHEL 9 and its clone distros where texlive-xecjk
doesn't work at the moment due to a missing dependency [1].
"make pdfdocs" for non-CJK contents should work after removing
texlive-xecjk.

Link: [1] https://bugzilla.redhat.com/show_bug.cgi?id=2086254
Fixes: 398f7abdcb7e ("docs: pdfdocs: Pull LaTeX preamble part out of conf.py")
Cc: stable@vger.kernel.org # v5.18+
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/c24c2a87-70b2-5342-bcc9-de467940466e@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx/kerneldoc-preamble.sty