LaTeX: (cont'd) fix of code comments and slight refactoring

This commit is contained in:
Jean-François B 2022-06-29 23:52:31 +02:00
parent 2566f6e757
commit 52d8f3a3bc

View File

@ -284,13 +284,12 @@
% MEMO: usage of original \colorbox would insert a \set@color here
% and this then places a "color pop" at the end of the \box\z@.
% But this could pair erroneously with an unmatched "color push"
% as #1 is maybe only a part (already hboxed) of a codeline.
% as #1 is maybe only a part (already hboxed) of a codeline
% if (default) verbatimwrapslines=true
% (cf \spx@verb@@PreProcessLine; refs: #8686)
% MEMO: formerly we did something with \fboxsep in relation to the LaTeX
% bug graphics/4524 for \colorbox, but as we don't use \colorbox...
% MEMO: the #1 has a \strut so the colored background will have correct
% dimensions
\setbox\z@\hbox{#1}%
\setbox\z@\hb@xt@\linewidth{\strut#1\hss}%
% MEMO: \colorbox would lead to \color{sphinxVerbatimHighlightColor}
% plus \color@block, which results in doubled (a color.sty feature)
% color command send to device driver and more importantly has
@ -307,10 +306,13 @@
% we added a group only for \FV@RightListNumber not be influenced by the
% \current@color, if \fvset has been used to set numbers to the right.
}%
% MEMO: formerly we did \hb@xt@\linewidth{\strut #1\hss}, but there is now
% not much to do as since \spx@verb@@PreProcessLine this #1 is simply
% \box\spx@verb@tempboxb\strut
\newcommand\sphinxVerbatimFormatLine[1]{#1}%
% MEMO: fancyvrb has options obeytabs and tabsize. Anyhow tab characters
% do not make it to the tex file, they have been converted to spaces earlier.
% But, if this was not the case, the support would be implemented here via
% \newcommand\sphinxVerbatimFormatLine[1]{\FV@ObeyTabs{\strut #1}}%
\newcommand\sphinxVerbatimFormatLine[1]{\strut#1}%
% MEMO: if verbatimwrapslines is set to true (default) the #1 above is
% simply \box\spx@verb@tempboxb, from the next two macros.
% The next two macros are a deep hack of fancyvrb.sty core line processing in
% order to wrap too long lines, either at spaces and natural break-points,
% (soft wrap) or optionally at any character (hard wrap). This requires deep
@ -332,7 +334,7 @@
\setbox\spx@verb@tempboxb\lastbox
\ifvoid\spx@verb@tempboxb\else
{\spx@verb@@ProcessLines}%
\FV@ProcessLine{\box\spx@verb@tempboxb\strut}%
\FV@ProcessLine{\box\spx@verb@tempboxb}%
\global\let\FV@ProcessLine\FV@ProcessLine
\global\setbox\@tempboxa=\box\@tempboxa
\aftergroup\spx@verb@@InhibitLineNumber
@ -382,7 +384,7 @@
\setbox\spx@verb@tempboxa=\vtop{\unvbox\spx@verb@tempboxa
\setbox\spx@verb@tempboxb\lastbox
{\spx@verb@@ProcessLines}%
\FV@ProcessLine{\box\spx@verb@tempboxb\strut}%
\FV@ProcessLine{\box\spx@verb@tempboxb}%
\global\let\FV@ProcessLine\FV@ProcessLine
\global\setbox\@tempboxa=\box\@tempboxa
}%