Debian Codegraph @

texmf-dist/tex/generic/tex4ht/fancyvrb.4ht

raw
1 % fancyvrb.4ht (2026-04-22-12:58), generated from tex4ht-4ht.tex
2 % Copyright 1997-2009 Eitan M. Gurari
3 % Copyright 2009-2026 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <https://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2026-04-22-12:58}
21
22
23 \def\:tempa{\let\fv:color\empty
24 \ifx \color\:UnDef\else\Configure{color}{\xdef\fv:color}\fi
25 \o:FV@FormattingPrep:%
26 \a:fancyvrb%
27 \ifx \FV@BeginListFrame\relax\else
28 \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
29 \a:fancyvrbframe
30 \fi
31 \ifx \FV@LeftListFrame\relax\else
32 \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
33 \b:fancyvrbframe
34 \fi
35 \ifx \FV@EndListFrame\relax\else
36 \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
37 \c:fancyvrbframe
38 \fi
39 \ifx \FV@RightListFrame\relax\else
40 \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
41 \d:fancyvrbframe
42 \fi
43 %
44 \bgroup
45 \ifx \fv:color\empty \else{%
46 \let\HColor\fv:color \a:fancyvrbcolor%
47 }\fi
48 \ifx \FancyVerbFillColor\relax \ifx\FancyVerbBackgroundColor\relax\else%
49 \ifdefined\FancyVerbBackgroundColor% this extra check is needed for \BVerbatimInput
50 \:fvcolor \b:fancyvrbcolor \color{\FancyVerbBackgroundColor}!*?: %
51 \fi%
52 \fi\else%
53 \:fvcolor \b:fancyvrbcolor \FancyVerbFillColor!*?: %
54 \fi
55 \ifx \FancyVerbRuleColor\relax \else%
56 \:fvcolor \c:fancyvrbcolor \FancyVerbRuleColor!*?: %
57 \fi
58 \egroup
59 \let\FV@BeginListFrame\relax
60 \let\FV@LeftListFrame\relax
61 \let\FV@RightListFrame\relax
62 \let\FV@EndListFrame\relax
63 %
64 }
65 \HLet\FV@FormattingPrep\:tempa
66 \def\FV@ListProcessLine#1{%
67 \hbox{\c:fancyvrb \anc:lbl r{FancyVerbLine}\FV@LeftListNumber%
68 \FV@LeftListFrame \e:fancyvrb \FancyVerbFormatLine{#1}\f:fancyvrb%
69 \FV@RightListFrame \csname FV@RightListNumber\endcsname %
70 \d:fancyvrb}}
71 \def\FV@ListProcessLine@iii#1{%
72 \box\@tempboxa
73 \setbox\@tempboxa=\FV@ListProcessLine{#1}%
74 \let\FV@ProcessLine\FV@ListProcessLine@iv}
75 \def\FV@ListProcessLine@iv#1{%
76 % we use \nobreak to really prevent unwanted line breaks
77 % see https://github.com/michal-h21/make4ht/issues/104
78 \box\@tempboxa\nobreak%
79 \setbox\@tempboxa=\FV@ListProcessLine{#1}}%
80 \def\FV@ListProcessLastLine{%
81 \ifx\FV@ProcessLine\FV@ListProcessLine@iv
82 \box\@tempboxa
83 \else
84 \ifx\FV@ProcessLine\FV@ListProcessLine@iii
85 \box\@tempboxa
86 \else
87 \ifx\FV@ProcessLine\FV@ListProcessLine@i
88 \FV@Error{Empty verbatim environment}{}%
89 \FV@ProcessLine{}%
90 \fi
91 \fi
92 \fi}
93
94
95 \def\FV@EndList{\FV@ListProcessLastLine \FV@EndListFrame%
96 \IgnorePar\b:fancyvrb\par\@endparenv%
97 \endgroup \@endpetrue}
98 \def\FV@StepLineNo{%
99 \FV@SetLineNo%
100 \def\FV@StepLineNo{\SkipRefstepAnchor\refstepcounter{FancyVerbLine}}%
101 \FV@StepLineNo}
102 \begingroup
103 \catcode`\^^M=\active%
104 \gdef\:tempa#1{%
105 \begingroup%
106 \let\a:fancyvrb\empty%
107 \FV@UseKeyValues%
108 \FV@FormattingPrep%
109 \FV@CatCodes%
110 \outer\def^^M{}%
111 \catcode`#1=12%
112 \def\@tempa{\def\FancyVerbGetVerb####1####2}%
113 \expandafter\@tempa\string#1{\a:verb\hbox{##2}\b:verb\endgroup}%
114 \FancyVerbGetVerb\FV@EOL}%
115 \endgroup
116 \HLet\FVC@Verb\:tempa
117 \def\:tempa#1{\mbox{\FV@UseKeyValues%
118 \let\a:fancyvrb\empty \FV@FormattingPrep%
119 \a:verb #1\b:verb}}
120 \HLet\:tempa\FV@UseVerb
121 \def\:fvcolor#1{\def\a:color##1##2!*?: {%
122 \Configure{SetHColor}#1{##1}}}%
123 \define@key{FV}{framerule}{%
124 \@tempdima=#1\relax%
125 \edef\FV@FrameRule{\number\@tempdima sp\relax}%
126 {\Advance:\fancyvrbNo by 1 \tmp:dim=\FV@FrameRule%
127 \edef\HSize{\the\tmp:dim}%
128 \e:fancyvrbframe}}
129 \define@key{FV}{framesep}{%
130 \@tempdima=#1\relax%
131 \edef\FV@FrameSep{\number\@tempdima sp\relax}%
132 {\Advance:\fancyvrbNo by 1 \tmp:dim=\FV@FrameSep%
133 \edef\HSize{\the\tmp:dim}%
134 \f:fancyvrbframe}}
135 \def\FV@BVerbatimBegin{%
136 \ht:special{t4ht@(}\begingroup%
137 \let\a:fancyvrb\empty\IgnorePar%
138 \FV@UseKeyValues%
139 \FV@BeginVBox%
140 \let\FV@ProcessLine\FV@BProcessLine%
141 \FV@FormattingPrep%
142 \FV@ObeyTabsInit\a:BVerbatimInput\ht:special{t4ht@)}
143 }%
144 \def\FV@BVerbatimEnd{\b:BVerbatimInput\ht:special{t4ht@(}\FV@EndVBox\ht:special{t4ht@)}\endgroup}
145 \def\FV@BProcessLine#1{\hbox{\FancyVerbFormatLine%
146 {\c:BVerbatimInput#1\d:BVerbatimInput}}}
147 \NewConfigure{BVerbatimInput}{4}
148 \def\V@@footnotetext{%
149 \leavevmode%
150 \vbox\bgroup%
151 \leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
152 \protected@edef
153 \@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
154 \anc:lbl f{footnote}%
155 %
156 \a:footnotetext%
157 \b:footnotetext%
158 \csname a:footnotebody\endcsname%
159 \bgroup%
160 \reset@font\footnotesize%
161 \bgroup %
162 \aftergroup\V@@@footnotetext %
163 \ignorespaces%
164 }
165 \def\V@@@footnotetext{%
166 \egroup%
167 \csname b:footnotebody\endcsname%
168 \c:footnotetext%
169 \ht:special{t4ht@[}\egroup\ht:special{t4ht@]}%
170 }
171
172 \NewConfigure{fancyvrb}{6}
173 \NewConfigure{fancyvrbcolor}{3}
174 \NewConfigure{fancyvrbframe}{6}
175
176
177 \Hinput{fancyvrb}
178 \endinput
179