mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: (cont'd) fix of code comments and slight refactoring
This commit is contained in:
parent
2566f6e757
commit
52d8f3a3bc
@ -284,13 +284,12 @@
|
|||||||
% MEMO: usage of original \colorbox would insert a \set@color here
|
% 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@.
|
% and this then places a "color pop" at the end of the \box\z@.
|
||||||
% But this could pair erroneously with an unmatched "color push"
|
% 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)
|
% (cf \spx@verb@@PreProcessLine; refs: #8686)
|
||||||
% MEMO: formerly we did something with \fboxsep in relation to the LaTeX
|
% MEMO: formerly we did something with \fboxsep in relation to the LaTeX
|
||||||
% bug graphics/4524 for \colorbox, but as we don't use \colorbox...
|
% 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
|
\setbox\z@\hb@xt@\linewidth{\strut#1\hss}%
|
||||||
% dimensions
|
|
||||||
\setbox\z@\hbox{#1}%
|
|
||||||
% MEMO: \colorbox would lead to \color{sphinxVerbatimHighlightColor}
|
% MEMO: \colorbox would lead to \color{sphinxVerbatimHighlightColor}
|
||||||
% plus \color@block, which results in doubled (a color.sty feature)
|
% plus \color@block, which results in doubled (a color.sty feature)
|
||||||
% color command send to device driver and more importantly has
|
% 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
|
% 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.
|
% \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
|
% MEMO: fancyvrb has options obeytabs and tabsize. Anyhow tab characters
|
||||||
% not much to do as since \spx@verb@@PreProcessLine this #1 is simply
|
% do not make it to the tex file, they have been converted to spaces earlier.
|
||||||
% \box\spx@verb@tempboxb\strut
|
% But, if this was not the case, the support would be implemented here via
|
||||||
\newcommand\sphinxVerbatimFormatLine[1]{#1}%
|
% \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
|
% 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,
|
% 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
|
% (soft wrap) or optionally at any character (hard wrap). This requires deep
|
||||||
@ -332,7 +334,7 @@
|
|||||||
\setbox\spx@verb@tempboxb\lastbox
|
\setbox\spx@verb@tempboxb\lastbox
|
||||||
\ifvoid\spx@verb@tempboxb\else
|
\ifvoid\spx@verb@tempboxb\else
|
||||||
{\spx@verb@@ProcessLines}%
|
{\spx@verb@@ProcessLines}%
|
||||||
\FV@ProcessLine{\box\spx@verb@tempboxb\strut}%
|
\FV@ProcessLine{\box\spx@verb@tempboxb}%
|
||||||
\global\let\FV@ProcessLine\FV@ProcessLine
|
\global\let\FV@ProcessLine\FV@ProcessLine
|
||||||
\global\setbox\@tempboxa=\box\@tempboxa
|
\global\setbox\@tempboxa=\box\@tempboxa
|
||||||
\aftergroup\spx@verb@@InhibitLineNumber
|
\aftergroup\spx@verb@@InhibitLineNumber
|
||||||
@ -382,7 +384,7 @@
|
|||||||
\setbox\spx@verb@tempboxa=\vtop{\unvbox\spx@verb@tempboxa
|
\setbox\spx@verb@tempboxa=\vtop{\unvbox\spx@verb@tempboxa
|
||||||
\setbox\spx@verb@tempboxb\lastbox
|
\setbox\spx@verb@tempboxb\lastbox
|
||||||
{\spx@verb@@ProcessLines}%
|
{\spx@verb@@ProcessLines}%
|
||||||
\FV@ProcessLine{\box\spx@verb@tempboxb\strut}%
|
\FV@ProcessLine{\box\spx@verb@tempboxb}%
|
||||||
\global\let\FV@ProcessLine\FV@ProcessLine
|
\global\let\FV@ProcessLine\FV@ProcessLine
|
||||||
\global\setbox\@tempboxa=\box\@tempboxa
|
\global\setbox\@tempboxa=\box\@tempboxa
|
||||||
}%
|
}%
|
||||||
|
Loading…
Reference in New Issue
Block a user