Debian Codegraph @

texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty

raw
1 %%
2 %% This is file `lwarp-fancyvrb.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `fancyvrb')
8 %% This is a generated file.
9 %% Copyright 2016-2026 Brian Dunn
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %% http://www.latex-project.org/lppl.txt
16 %% and version 1.3 or later is part of all distributions of LaTeX
17 %% version 2005/12/01 or later.
18 \AtBeginDocument{\RequirePackage{xcolor}}% for \convertcolorspec
19
20 \LWR@ProvidesPackagePass{fancyvrb}[2024/01/20]
21
22 \newcommand*{\LWR@currentFVbackstyle}{}
23
24 \newcommand*{\LWR@find@currentFVbackstyle}{%
25 \renewcommand*{\LWR@currentFVbackstyle}{}%
26 }%
27
28 \fvset{frame=none}%
29
30 \define@key{FV}{gobble}{%
31 \@tempcnta=#1\relax
32 \ifnum\@tempcnta<\@ne
33 \let\FV@Gobble\relax
34 \else
35 \ifnum\@tempcnta>9
36 \FV@Error{gobble parameter must be less than 10}\FV@eha
37 \else
38 \renewcommand{\FV@@@@Gobble}[\@tempcnta]{}%
39 \let\FV@Gobble\FV@@Gobble%
40 \boolfalse{LWR@HTMLsanitize@tmpb@enable}% lwarp
41 \fi
42 \fi}
43
44 \ifxetexorluatex
45 \def\LWR@HTML@FancyVerbSpace{\textvisiblespace}
46 \else
47 \@ifundefined{verbvisiblespace}%
48 {%
49 \@ifundefined{textvisiblespace}%
50 {\begingroup\catcode`\ =12 \gdef\LWR@HTML@FancyVerbSpace{\tt }\endgroup}
51 {\def\LWR@HTML@FancyVerbSpace{\textvisiblespace}}
52 }%
53 {\def\LWR@HTML@FancyVerbSpace{\verbvisiblespace}}
54 \fi
55 \LWR@formatted{FancyVerbSpace}
56
57 \def\LWR@print@FancyVerbTab{|}
58 \def\LWR@HTML@FancyVerbTab{|}%
59 \LWR@formatted{FancyVerbTab}
60
61 \fvset{tabsize=8,showtabs=false}
62
63 \VerifyCommand[lwarp][fancyvrb]{\FV@CatCodes}{BF2C1F38D5FEF0658C18B636ACBDA40E}
64
65 \def\FV@CatCodes{%
66 \let\do\@makeother\dospecials % The usual stuff.
67 \FV@ActiveWhiteSpace % See below.
68 \FV@FontScanPrep % See below.
69 \FV@CatCodesHook % A style hook.
70 \FancyVerbCodes % A user-defined hook.
71 \catcode`\>=12% % lwarp
72 \catcode`\<=12% % lwarp
73 }
74 \VerifyCommand[lwarp][fancyvrb]{\FV@GetLine}{9B86134119C575F099B5B567A9B65A9F}
75
76 \def\FV@GetLine{%
77 \@noligs%
78 \catcode`\>=12% lwarp, and the next line as well
79 \catcode`\<=12
80 \expandafter\FV@CheckScan\FancyVerbGetLine%
81 }
82
83 \VerifyCommand[lwarp][fancyvrb]{\FancyVerbGetLine}{498B88BACBD0811BAC0791BDF4F3B335}
84
85 \begingroup
86 \catcode`\^^M=\active%
87 \gdef\FancyVerbGetLine#1^^M{%
88 \@nil%
89 \FV@CheckEnd{#1}%
90 \ifx\@tempa\FV@EnvironName% % True if end is found
91 \ifx\@tempb\FV@@@CheckEnd\else\FV@BadEndError\fi%
92 \let\next\FV@EndScanning%
93 \else%
94 \ifbool{LWR@HTMLsanitize@tmpb@enable}% lwarp
95 {\def\FV@Line{\LWR@HTMLsanitize@use@tmpb{#1}}}% lwarp
96 {\def\FV@Line{#1}}% lwarp
97 \def\next{\FV@PreProcessLine\FV@GetLine}%
98 \fi%
99 \next}%
100 \endgroup
101 \VerifyCommand[lwarp][fancyvrb]{\FV@List}{8FB649FAF7C9487B257B76AF4FFB27D1}
102
103 \def\FV@List#1{%
104 \begingroup
105 \FV@UseKeyValues
106 \FV@LeaveVMode
107 \if@inlabel\else\setbox\@labels=\box\voidb@x\fi
108 \FV@ListNesting{#1}%
109 \FV@ListParameterHook
110 \FV@ListVSpace
111 \FV@SetLineWidth
112 \FV@InterLinePenalty
113 \let\FV@ProcessLine\FV@ListProcessLine% lwarp
114 \FV@CatCodes
115 \FV@FormattingPrep
116 \FV@ObeyTabsInit
117 \FV@BeginListFrame}
118 \VerifyCommand[lwarp][fancyvrb]{\FV@ListProcessLine}{660F9938234FC1043ACF7B02B3F37372}
119
120 \def\FV@ListProcessLine#1{%
121 \hbox to \hsize{%
122 \hbox to \VerbatimHTMLWidth {%
123 \ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}%
124 \FV@LeftListNumber%
125 \FancyVerbFormatLine{#1}%
126 \hss%
127 \FV@RightListNumber%
128 }%
129 \hss% required to avoid underfull hboxes
130 }
131 }
132
133 \VerifyCommand[lwarp][fancyvrb]{\FVC@SaveVerb}{68373ED055890622906844A5611810C8}
134
135 \begingroup
136 \catcode`\^^M=\active%
137 \gdef\FVC@SaveVerb#1#2{%
138 \@namedef{FV@SV@#1}{}%
139 \begingroup%
140 \FV@UseKeyValues%
141 \FV@CatCodes%
142 \outer\def^^M{\FV@EOL}%
143 \global\let\@tempg\FancyVerbAfterSave%
144 \catcode`#2=12%
145 \def\@tempa{\def\FancyVerbGetVerb####1####2}%
146 \expandafter\@tempa\string#2{%
147 \endgroup%
148 \@namedef{FV@SV@#1}{%
149 \LWR@HTMLsanitize@use@tmpb{##2}% lwarp
150 }\@tempg%
151 }%
152 \FancyVerbGetVerb\FV@EOL}%
153 \endgroup
154
155 \VerifyCommand[lwarp][fancyvrb]{\FV@UseVerb}{A3A9D802CCDBEC8D2FDAB626346B5EDD}
156
157 \def\FV@UseVerb#1{%
158 \ifbool{LWR@verbtags}% lwarp
159 {\LWR@htmltag{span class=\textquotedbl{}fancyvrb\textquotedbl}}% lwarp
160 {}% lwarp
161 \mbox{\FV@UseKeyValues\FV@FormattingPrep#1}%
162 \ifbool{LWR@verbtags}% lwarp
163 {\LWR@htmltag{/span}}% lwarp
164 {}% lwarp
165 }
166
167 \VerifyCommand[lwarp][fancyvrb]{\FVC@Verb}{806B03D5A78CAB39E0514667991695C9}
168
169 \begingroup
170 \catcode`\^^M=\active%
171 \gdef\FVC@Verb#1{%
172 \begingroup%
173 \FV@UseKeyValues%
174 \FV@FormattingPrep%
175 \FV@CatCodes%
176 \outer\def^^M{}%
177 \catcode`#1=12%
178 \def\@tempa{\def\FancyVerbGetVerb####1####2}%
179 \expandafter\@tempa\string#1{%
180 \ifbool{LWR@verbtags}% lwarp
181 {% lwarp
182 \LWR@htmltag{span class=\textquotedbl{}fancyvrb\textquotedbl}% lwarp
183 \def\tmpb{##2}% lwarp
184 \LWR@HTMLsanitize@tmpb% lwarp
185 \mbox{\tmpb}% lwarp
186 \LWR@htmltag{/span}% lwarp
187 }% lwarp
188 {\mbox{##2}}%
189 \endgroup%
190 }%
191 \FancyVerbGetVerb\FV@EOL%
192 }%
193 \endgroup
194 \VerifyCommand[lwarp][fancyvrb]{\FV@ReadLine}{E5CFCD0096325139ED8443E3A517BC77}
195
196 \begingroup
197 \catcode`\^^M=\active
198 \gdef\FV@ReadLine{%
199 \ifeof\FV@InFile\else
200 \immediate\read\FV@InFile to\tmpb%
201 \LWR@HTMLsanitize@tmpb%
202 \expandafter\FV@@ReadLine\tmpb^^M\relax^^M\@nil%
203 \fi}
204 \endgroup
205 \newcommand*{\LWR@FVstyle}{}
206 \newcommand*{\LWR@new@FVstyle}{\renewcommand*{\LWR@FVstyle}{}}
207 \newcommand*{\LWR@addto@FVstyle}[1]{%
208 \apptocmd{\LWR@FVstyle}{\protect\LWR@indentHTMLtwo#1}%
209 {}%
210 {%
211 \PackageWarning{lwarp}{%
212 \string\LWR@addto@FVstyle\space was not
213 able to patch an HTML style.\MessageBreak
214 Pathching !#1!\MessageBreak%
215 Currently is !\LWR@FVstyle!\MessageBreak%
216 HTML styles may be not be complete%
217 }%
218 }%
219 }
220 \newcommand*{\LWR@addFVtextcolorstyle}{%
221 \LWR@findcurrenttextcolor%
222 \ifdefstring{\LWR@tempcolor}{000000}%
223 {}%
224 {\LWR@addto@FVstyle{color: \LWR@origpound\LWR@tempcolor ; }}%
225 }
226 \newcommand*{\LWR@addFVbackgroundstyle}{%
227 \ifdefempty{\LWR@currentFVbackstyle}%
228 {}%
229 {\LWR@addto@FVstyle{\LWR@currentFVbackstyle}}%
230 }
231
232 \newcommand*{\LWR@addFVborderstyle}[1]{%
233 \LWR@addto@FVstyle{\LWR@FVborderstyle{#1}}%
234 }
235
236 \newcommand*{\LWR@addFVborderstyles}{}
237
238 \AfterEndPreamble{
239
240 \LWR@traceinfo{Patching fancyvrb.}
241
242 \VerifyCommand[lwarp][fancyvrb]{\VerbatimFootnotes}{931C9BE6284EB9D8B1516D566C997A87}
243
244 \def\VerbatimFootnotes{%
245 \let\@footnotetext\V@footnotetext%
246 \let\footnote\V@footnote%
247 \let\LWR@footnotetext\V@footnotetext% lwarp
248 }
249 \VerifyCommand[lwarp][fancyvrb]{\V@@footnotetext}{89E1586855997F951F57C3936CBDF87E}
250
251 \def\V@@footnotetext{%
252 \LWR@traceinfo{V@footnotetext}%
253 \LWR@newautopagelabel{page}%
254 \LWR@ensuredoingapar%
255 \LWR@save@doingapar%
256 \global\setbox\LWR@footnotebox=\vbox\bgroup%
257 \unvbox\LWR@footnotebox%
258 \protected@edef\@currentlabel{%
259 \csname p@footnote\endcsname\@thefnmark%
260 }% @currentlabel
261 \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}%
262 \booltrue{LWR@verbtags}%
263 \booltrue{LWR@HTMLsanitize@tmpb@enable}%
264
265 \LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline%
266 \@makefntext{}%
267 \bgroup%
268 \aftergroup\V@@@footnotetext%
269 \let\LWR@newautopagelabel\LWR@null@newautopagelabel%
270 \ignorespaces%
271 }%
272 \def\V@@@footnotetext{%
273 \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}%
274 {%
275 \LWR@orignobreakspace\LWR@orignewline%
276 \LWR@htmltagc{/\LWR@tagregularparagraph}\LWR@orignewline%
277 }{}%
278 \strut\egroup%
279 \LWR@restore@doingapar%
280 }
281 \preto\FVB@Verbatim{\LWR@forcenewpage}
282 \preto\FVB@LVerbatim{\LWR@forcenewpage}
283 \def\LWR@HTML@FV@BeginListFrame@Single{%
284 \FV@SingleFrameLine{\z@}%
285 }
286 \LWR@formatted{FV@BeginListFrame@Single}
287
288 \def\LWR@HTML@FV@EndListFrame@Single{%
289 \FV@SingleFrameLine{\@ne}%
290 }
291 \LWR@formatted{FV@EndListFrame@Single}
292
293 \def\LWR@HTML@FV@BeginListFrame@Lines{%
294 \FV@SingleFrameLine{\z@}%
295 }
296 \LWR@formatted{FV@BeginListFrame@Lines}
297
298 \def\LWR@HTML@FV@EndListFrame@Lines{%
299 \FV@SingleFrameLine{\@ne}%
300 }
301 \LWR@formatted{FV@EndListFrame@Lines}
302
303 \newcommand*{\LWR@HTML@FV@SingleFrameSep}{}%
304 \LWR@formatted{FV@SingleFrameSep}
305
306 \newcommand*{\LWR@fvstartnone}{%
307 \LWR@traceinfo{fvstartnone}%
308 \LWR@find@currentFVbackstyle% lwarp
309 \LWR@new@FVstyle% lwarp
310 \LWR@addFVtextcolorstyle% lwarp
311 \LWR@addFVbackgroundstyle% lwarp
312 \LWR@addFVborderstyles% lwarp
313 \ifdefempty{\LWR@FVstyle}%
314 {\BlockClass{fancyvrb}}%
315 {\BlockClass[\LWR@FVstyle]{fancyvrb}}%
316 \LWR@stoppars
317 \ifx\FV@LabelPositionTopLine\relax\else
318 \ifx\FV@LabelBegin\relax\else
319 \FancyVerbRuleColor{\LWR@FVfindbordercolor}
320 \ifbool{LWR@verbtags}% lwarp
321 {% lwarp
322 \LWR@findcurrenttextcolor%
323 \LWR@htmltagc{% lwarp
324 div class=\textquotedbl{}fancyvrblabel\textquotedbl\ % space
325 style=\textquotedbl{}%
326 color: \LWR@origpound\LWR@tempcolor%
327 \textquotedbl%
328 }%
329 \LWR@orignewline% lwarp
330 }% lwarp
331 {}% lwarp
332 \LWR@print@textrm{\FV@LabelBegin}% \textrm preserves emdash
333 \LWR@orignewline% lwarp
334 \ifbool{LWR@verbtags}% lwarp
335 {% lwarp
336 \LWR@htmltagc{/div}% lwarp
337 \LWR@orignewline% lwarp
338 }% lwarp
339 {}% lwarp
340 \fi
341 \fi
342 \LWR@atbeginverbatim{verbatim}%
343 }
344
345 \newcommand*{\LWR@fvendnone}{%
346 \LWR@traceinfo{fvendnone}%
347 \LWR@afterendverbatim%
348 \LWR@stoppars%
349 \ifx\FV@LabelPositionBottomLine\relax\else
350 \ifx\FV@LabelEnd\relax\else
351 \FancyVerbRuleColor{\LWR@FVfindbordercolor}% lwarp
352 \ifbool{LWR@verbtags}% lwarp
353 {% lwarp
354 \LWR@findcurrenttextcolor%
355 \LWR@htmltagc{% lwarp
356 div class=\textquotedbl{}fancyvrblabel\textquotedbl\ % space
357 style=\textquotedbl{}%
358 color: \LWR@origpound\LWR@tempcolor%
359 \textquotedbl%
360 }%
361 \LWR@orignewline% lwarp
362 }% lwarp
363 {}% lwarp
364 \LWR@print@textrm{\FV@LabelEnd}% lwarp
365 \LWR@orignewline% lwarp
366 \ifbool{LWR@verbtags}% lwarp
367 {% lwarp
368 \LWR@htmltagc{/div}% lwarp
369 \LWR@orignewline% lwarp
370 }% lwarp
371 {}% lwarp
372 \fi
373 \fi
374 \endBlockClass% lwarp
375 }
376
377 \newcommand*{\LWR@fvstartsingle}{%
378 \LWR@traceinfo{fvstartsingle}%
379 \LWR@fvstartnone%
380 \FV@BeginListFrame@Single%
381 }
382
383 \newcommand*{\LWR@fvendsingle}{%
384 \LWR@traceinfo{fvendsingle}%
385 \FV@EndListFrame@Single%
386 \LWR@fvendnone%
387 }
388
389 \newcommand*{\LWR@fvstartline}{%
390 \LWR@traceinfo{fvstartline}%
391 \LWR@fvstartnone%
392 \FV@BeginListFrame@Lines%
393 }
394
395 \newcommand*{\LWR@fvendline}{%
396 \LWR@traceinfo{fvendline}%
397 \FV@EndListFrame@Lines%
398 \LWR@fvendnone%
399 }
400 \newcommand*{\LWR@FVfindbordercolor}{%
401 \FancyVerbRuleColor%
402 \LWR@findcurrenttextcolor%
403 \color{black}%
404 }
405
406 \newcommand*{\LWR@FVborderstyle}[1]{%
407 padding#1: \strip@pt\dimexpr \FV@FrameSep\relax\relax pt ; % space
408 \LWR@FVfindbordercolor\LWR@indentHTMLtwo%
409 border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt % space
410 solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space
411 }
412 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@none}{C60E1656944AB4C4D2B74410E88FE7C0}
413
414 \def\LWR@HTML@FV@Frame@none{%
415 \let\FV@BeginListFrame\LWR@fvstartnone%
416 \let\FV@LeftListFrame\relax%
417 \let\FV@RightListFrame\relax%
418 \let\FV@EndListFrame\LWR@fvendnone}
419 \LWR@formatted{FV@Frame@none}
420
421 \FV@Frame@none% default values
422 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@single}{CDF78DB9C6408F48D05302D07091C629}
423
424 \def\LWR@HTML@FV@Frame@single{%
425 \renewcommand{\LWR@addFVborderstyles}{\LWR@addFVborderstyle{}}% lwarp
426 \let\FV@BeginListFrame\LWR@fvstartsingle%
427 \let\FV@LeftListFrame\FV@LeftListFrame@Single%
428 \let\FV@RightListFrame\FV@RightListFrame@Single%
429 \let\FV@EndListFrame\LWR@fvendsingle}
430
431 \LWR@formatted{FV@Frame@single}
432 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@lines}{1AADD6691DA93C9A66227F5C5B34EAE4}
433
434 \def\LWR@HTML@FV@Frame@lines{%
435 \renewcommand{\LWR@addFVborderstyles}{%
436 \LWR@addFVborderstyle{-top}%
437 \LWR@addFVborderstyle{-bottom}%
438 }% lwarp
439 \let\FV@BeginListFrame\LWR@fvstartline%
440 \let\FV@LeftListFrame\relax%
441 \let\FV@RightListFrame\relax%
442 \let\FV@EndListFrame\LWR@fvendline}
443
444 \LWR@formatted{FV@Frame@lines}
445 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@topline}{7E102D81F4FD367B398B8E85F48A7754}
446
447 \def\LWR@HTML@FV@Frame@topline{%
448 \renewcommand{\LWR@addFVborderstyles}{\LWR@addFVborderstyle{-top}}% lwarp
449 \let\FV@BeginListFrame\LWR@fvstartline%
450 \let\FV@LeftListFrame\relax%
451 \let\FV@RightListFrame\relax%
452 \let\FV@EndListFrame\LWR@fvendnone}
453
454 \LWR@formatted{FV@Frame@topline}
455 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@bottomline}{A51600F812F57F4211EF9E34F261564A}
456
457 \def\LWR@HTML@FV@Frame@bottomline{%
458 \renewcommand{\LWR@addFVborderstyles}{\LWR@addFVborderstyle{-bottom}}% lwarp
459 \let\FV@BeginListFrame\LWR@fvstartnone%
460 \let\FV@LeftListFrame\relax%
461 \let\FV@RightListFrame\relax%
462 \let\FV@EndListFrame\LWR@fvendline}
463
464 \LWR@formatted{FV@Frame@bottomline}
465 \def\FV@FrameFillLine{}
466 \VerifyCommand[lwarp][fancyvrb]{\FV@Frame@leftline}{2A77982C6520FD64F6DBFA1C03B670BA}
467
468 \def\LWR@HTML@FV@Frame@leftline{%
469 \renewcommand{\LWR@addFVborderstyles}{\LWR@addFVborderstyle{-left}}% lwarp
470 \ifx\FancyVerbFillColor\relax%
471 \let\FV@FrameFillLine\relax%
472 \else%
473 \@tempdima\FV@FrameRule\relax%
474 \multiply\@tempdima-\tw@%
475 \edef\FV@FrameFillLine{%
476 {\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}%
477 \kern-\number\@tempdima sp}}%
478 \fi%
479 \let\FV@BeginListFrame\LWR@fvstartnone%
480 \let\FV@LeftListFrame\FV@LeftListFrame@Single%
481 \let\FV@RightListFrame\relax%
482 \let\FV@EndListFrame\LWR@fvendnone}
483
484 \LWR@formatted{FV@Frame@leftline}
485 \VerifyCommand[lwarp][fancyvrb]{\FV@SingleFrameLine}{2D8B1DAED851500F255E357437FF065C}
486
487 \def\LWR@HTML@FV@SingleFrameLine#1{%
488 \ifnum#1=\z@\relax
489 \let\FV@Label\FV@LabelBegin
490 \else
491 \let\FV@Label\FV@LabelEnd
492 \fi
493 \ifx\FV@Label\relax
494 \else
495 \ifnum#1=\z@
496 \ifx\FV@LabelPositionTopLine\relax
497 \else
498 \fi
499 \else
500 \ifx\FV@LabelPositionBottomLine\relax
501 \else
502 \fi
503 \fi
504 \fi
505 }
506 \LWR@formatted{FV@SingleFrameLine}
507
508 \xpretocmd{\FV@BeginVBox}
509 {%
510 \LWR@forcenewpage%
511 \LWR@atbeginverbatim{bverbatim}%
512 }
513 {}
514 {\LWR@patcherror{fancyvrb}{FV@BeginVBox}}
515
516 \xapptocmd{\FV@EndVBox}
517 {%
518 \LWR@afterendverbatim%
519 }
520 {}
521 {\LWR@patcherror{fancyvrb}{FV@EndVBox}}
522
523 } % \AfterEndPreamble
524
525 \VerifyCommand[lwarp][fancyvrb]{\FVB@VerbatimOut}{A0AC591D2DB283DCEBCCC75968FF88CF}
526
527 \def\FVB@VerbatimOut#1{%
528 \@bsphack
529 \begingroup
530 \FV@UseKeyValues
531 \FV@DefineWhiteSpace
532 \def\FV@Space{\space}%
533 \FV@DefineTabOut
534 \def\FV@ProcessLine{\immediate\write\FV@OutFile}%
535 \immediate\openout\FV@OutFile #1\relax
536 \let\FV@FontScanPrep\relax
537 %% DG/SR modification begin - May. 18, 1998 (to avoid problems with ligatures)
538 \let\@noligs\relax
539 %% DG/SR modification end
540 \boolfalse{LWR@HTMLsanitize@tmpb@enable}% lwarp
541 \FV@Scan}
542
543
544 \endinput
545 %%
546 %% End of file `lwarp-fancyvrb.sty'.