Skip to content

Commit

Permalink
LaTeX: fix #13007
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jfbu committed Oct 11, 2024
1 parent 2f1d775 commit d1a5390
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
21 changes: 9 additions & 12 deletions sphinx/texinputs/sphinx.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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 %
}%
{%
Expand Down
10 changes: 6 additions & 4 deletions sphinx/texinputs/sphinxlatexadmonitions.sty
Original file line number Diff line number Diff line change
@@ -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:
%
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d1a5390

Please sign in to comment.