Skip to content

Commit

Permalink
LaTeX: fix (better) compatibility with "old" LaTeX
Browse files Browse the repository at this point in the history
There was no need for pre-expansion via \expanded and the latter was not
available prior to TL2019
  • Loading branch information
jfbu committed Jul 5, 2022
1 parent afaf57d commit 34fe9d0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sphinx/texinputs/sphinxpackageboxes.sty
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
% First we define some wrapper to be able to use arguments being (only)
% dimensions or dimensional expressions. The \unitlength will always be 1pt.
\def\spx@moveto(#1,#2)%
{\expanded{\noexpand\moveto(\strip@pt\dimexpr#1,\strip@pt\dimexpr#2)}}
{\moveto(\strip@pt\dimexpr#1,\strip@pt\dimexpr#2)}
\def\spx@lineto(#1,#2)%
{\expanded{\noexpand\lineto(\strip@pt\dimexpr#1,\strip@pt\dimexpr#2)}}
{\lineto(\strip@pt\dimexpr#1,\strip@pt\dimexpr#2)}
% attention we use here [2] always; and there are two more mandatory
% arguments, angles, we don't need to worry about them here.
\def\spx@circlearc#1#2#3{\expanded{\noexpand\circlearc[2]%
{\strip@pt\dimexpr#1}{\strip@pt\dimexpr#2}{\strip@pt\dimexpr#3}}%
\def\spx@circlearc#1#2#3{\circlearc[2]%
{\strip@pt\dimexpr#1}{\strip@pt\dimexpr#2}{\strip@pt\dimexpr#3}%
}

% TODO: add top right bottom left padding possibilities.
Expand Down Expand Up @@ -89,12 +89,11 @@
% width, i.e. the line extends by half its width to the exterior of the filled
% path. This explains some 0.5 things below.
\hbox{\setlength{\unitlength}{1pt}% attention to space token here
% work around for "old" LaTeX (2019 or earlier more or less, or we could use
% the "picture" package)
\expanded{\noexpand\begin{picture}%
% work around for "old" LaTeX (we could use the "picture" package, this
% would add another dependency)
\begin{picture}%
(\strip@pt\wd\tw@,\strip@pt\dimexpr\ht\tw@+\dp\tw@)%
(\strip@pt\dimexpr-.5\sphinxverbatimborder,\strip@pt\dimexpr-.5\sphinxverbatimborder)%
}%
\color{VerbatimColor}% color for background
\spx@dopath\fillpath
\color{VerbatimBorderColor}% color for border
Expand Down

0 comments on commit 34fe9d0

Please sign in to comment.