Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jfbu opened this issue Jan 6, 2023 · 0 comments
Closed

Comments

@jfbu
Copy link
Contributor

jfbu commented Jan 6, 2023

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

@jfbu jfbu added this to the 6.1.2 milestone Jan 6, 2023
jfbu added a commit to jfbu/sphinx that referenced this issue Jan 6, 2023
@jfbu jfbu changed the title LaTeX: with Sphinx 5.1.0 using shadowsize key of sphinxsetup causes PDF build to crash LaTeX: shadowsize key of sphinxsetup causes PDF build to crash since Sphinx 5.1.0 Jan 6, 2023
@jfbu jfbu closed this as completed in 7945aeb Jan 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant