Skip to content

LaTeX: shadowsize key of sphinxsetup causes PDF build to crash since Sphinx 5.1.0 #11096

@jfbu

Description

@jfbu

Describe the bug

Attempting to use the legacy shadowsize configuration key for 'sphinxsetup' entry in latex_elements causes a PDF build crash.

! Undefined control sequence.
\@tempc ...e \else \spx@topic@box@withshadowfalse 
                                                  \spx@topic@box@shadow@inse...

This is caused by a typo (wrong name there should not be @box there) in #10648 merged into Sphinx 5.1.0. Besides the relevant LaTeX code

% Suport for legacy shadowsize, the \sphinxshadowsize \dimen register
% is not used anymore and should not even be allocated in future
\define@key{sphinx}{shadowsize}{%
\edef\spx@topic@shadow@xoffset{\number\dimexpr#1\relax sp}%
\let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset
\ifdim\spx@topic@shadow@xoffset=\z@
\spx@topic@box@withshadowtrue
\else
\spx@topic@box@withshadowfalse
\spx@topic@box@shadow@insetfalse
\fi
}%
was wrong for other reasons as the conditional branches are permuted.

Very embarrassing.

And besides the rendering of topic and contents boxes broke backwards compatibility (#11095).

How to Reproduce

latex_elements = {
    'sphinxsetup': 'shadowsize=10pt'
}

Environment Information

not relevant

Sphinx extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions