From d1a5390d0f4dcff50127bfde288c83fca1ddf0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20B?= <2589111+jfbu@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:21:16 +0200 Subject: [PATCH 1/2] LaTeX: fix #13007 A change at 8.1.0 related to the rendering in PDF of admonitions broke the build if user LaTeX installation was lacking both of fontawesome5.sty and fontawesome.sty. This was due to a missing change to some auxiliary LateX in sphinx.sty related to rendering of title bar icons. --- sphinx/texinputs/sphinx.sty | 21 +++++++++------------ sphinx/texinputs/sphinxlatexadmonitions.sty | 10 ++++++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 0d9a5ddc747..0d52676c4fe 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -9,7 +9,7 @@ % by the Sphinx LaTeX writer. \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sphinx}[2024/07/28 v8.1.0 Sphinx LaTeX package (sphinx-doc)] +\ProvidesPackage{sphinx}[2024/10/11 v8.1.1 Sphinx LaTeX package (sphinx-doc)] % provides \ltx@ifundefined % (many packages load ltxcmds: graphicx does for pdftex and lualatex but @@ -885,15 +885,12 @@ {\DeclareStringOption[fontawesome]{iconpackage}} {\DeclareStringOption[none]{iconpackage}}% }% -\newcommand\spx@faIcon[3][]{}% -% The hacky definition of \spx@faIcon above is to let it by default swallow -% the icon macro and the \sphinxtitlerowaftericonspacecmd (see -% \sphinxdotitlerowwithicon in sphinxlatexadmonitions.sty) which inserts -% a space between it and title. See how \spx@faIcon is used below. -% -% If user sets a title-icon key to some LaTeX code of their own, of course -% \spx@faIcon is not executed and the inserted space will thus be there, as -% expected. +\newcommand\spx@faIcon[2][]{}% +% The above \spx@faIcon which gobbles one mandatory and one optional +% argument is put into use only if both fontawesome5 and fontawesome +% LaTeX packages are not available, as part of the defaults for the +% div.*_title-icon keys (these keys can be redefined via the sphinxsetup +% interface). % \def\spxstring@fontawesome{fontawesome} \def\spxstring@fontawesomev{fontawesome5} @@ -920,8 +917,8 @@ \let\faicon@pen\faPencil \fi % if neither has been required, \spx@faIcon will simply swallow - % its argument (and follwing space macro) and it is up to user - % to set the keys appropriately. + % its argument and it is up to user + % to set the various div.*_title-icon keys appropriately. \fi\fi % }% {% diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty index 2d50b2eb313..76fef5a8c4f 100644 --- a/sphinx/texinputs/sphinxlatexadmonitions.sty +++ b/sphinx/texinputs/sphinxlatexadmonitions.sty @@ -1,7 +1,7 @@ %% NOTICES AND ADMONITIONS % % change this info string if making any custom modification -\ProvidesPackage{sphinxlatexadmonitions}[2024/07/28 v8.1.0 admonitions] +\ProvidesPackage{sphinxlatexadmonitions}[2024/10/11 v8.1.1 admonitions] % Provides support for this output mark-up from Sphinx latex writer: % @@ -341,9 +341,11 @@ \ifdim\wd\z@>\z@ \textcolor{sphinx#1TtlFgColor}{% \@nameuse{sphinx#1TtlIcon}% - % This macro is located here and not after the closing brace - % for reasons of fall-back \spx@faIcon definition in sphinx.sty - % in case fontawesome5 package not found. + % The next macro is located here for legacy reasons of earlier + % functioning of \spx@faIcon. When fontawesome{5,}.sty both + % are unavailable, it (formerly) gobbled this next macro. + % We leave it here now although it could be moved to after + % the closing brace. \sphinxtitlerowaftericonspacecmd }% \fi From 245f20b239ff07f06eca35e19aaab674abef3d2b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:57:02 +0100 Subject: [PATCH 2/2] CHANGES --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 6269353c799..a9817fa3c25 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,10 @@ Bugs fixed * Use the preferred https://www.cve.org/ URL for the :rst:role:`cve` role. Patch by Hugo van Kemenade. +* #13007: LaTeX: Improve resiliency when the required + ``fontawesome`` or ``fontawesome5`` packages are not installed. + Patch by Jean-François B. + Release 8.1.0 (released Oct 10, 2024) =====================================