summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty
blob: ebec568d503ae4ef3ae0053aa05fa35566ab954c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
%%
%% This is file `lwarp-fancyvrb.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `fancyvrb')
%% This is a generated file.
%% Copyright 2016-2020 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
\AtBeginDocument{\RequirePackage{xcolor}}% for \convertcolorspec

\LWR@ProvidesPackagePass{fancyvrb}[2008/02/07]
\fvset{frame=none}%
\AfterEndPreamble{
\LWR@traceinfo{Patching fancyvrb.}
\def\VerbatimFootnotes{%
\let\@footnotetext\V@footnotetext%
\let\footnote\V@footnote%
\let\LWR@footnotetext\V@footnotetext% lwarp
}
\def\V@@footnotetext{%
\LWR@traceinfo{V@footnotetext}%
\global\setbox\LWR@footnotebox=\vbox\bgroup%
    \unvbox\LWR@footnotebox%
    \protected@edef\@currentlabel{%
        \csname p@footnote\endcsname\@thefnmark%
    }% @currentlabel
    \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}%
    \ifthenelse{%
        \boolean{LWR@doingstartpars} \AND%
        \cnttest{\value{LWR@lateximagedepth}}{=}{0}%
    }%
        {}%
        {\LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline}%
    \@makefntext{}%
  \bgroup%
  \aftergroup{\V@@@footnotetext}%
  \ignorespaces%
}%
\preto\FVB@Verbatim{\LWR@forcenewpage}
\preto\FVB@LVerbatim{\LWR@forcenewpage}
\def\FV@BeginListFrame@Single{%
  \FV@SingleFrameLine{\z@}%
}

\def\FV@EndListFrame@Single{%
  \FV@SingleFrameLine{\@ne}%
}

\def\FV@BeginListFrame@Lines{%
  \FV@SingleFrameLine{\z@}%
}

\def\FV@EndListFrame@Lines{%
    \FV@SingleFrameLine{\@ne}%
}

\renewcommand*{\FV@SingleFrameSep}{}
\def\FV@BUseVerbatim#1{%
    \FV@BVerbatimBegin#1\FV@BVerbatimEnd%
}

\newcommand*{\LWR@FVstyle}{}
\newcommand*{\LWR@fvstartnone}{%
\LWR@traceinfo{fvstartnone}%
\BlockClass[\LWR@FVstyle]{fancyvrb}
\LWR@stoppars
\ifx\FV@LabelPositionTopLine\relax\else
    \ifx\FV@LabelBegin\relax\else
        \FancyVerbRuleColor{\LWR@FVfindbordercolor}
        \LWR@htmltagc{%
            div class="fancyvrblabel" % extra space
                style="color: \LWR@origpound\LWR@tempcolor"%
        }
        \LWR@print@textrm{\FV@LabelBegin}% \textrm preserves emdash
        \LWR@htmltagc{/div}\LWR@orignewline%
    \fi
\fi
\LWR@atbeginverbatim{verbatim}%
}

\newcommand*{\LWR@fvendnone}{%
\LWR@traceinfo{fvendnone}%
\LWR@afterendverbatim%
\LWR@stoppars%
\ifx\FV@LabelPositionBottomLine\relax\else
    \ifx\FV@LabelEnd\relax\else
        \FancyVerbRuleColor{\LWR@FVfindbordercolor}
        \LWR@htmltagc{%
            div class="fancyvrblabel" % extra space
                style="color: \LWR@origpound\LWR@tempcolor"%
        }
        \LWR@print@textrm{\FV@LabelEnd}
        \LWR@htmltagc{/div}\LWR@orignewline%
    \fi
\fi
\endBlockClass
}

\newcommand*{\LWR@fvstartsingle}{%
\LWR@traceinfo{fvstartsingle}%
\LWR@fvstartnone%
\FV@BeginListFrame@Single%
}

\newcommand*{\LWR@fvendsingle}{%
\LWR@traceinfo{fvendsingle}%
\FV@EndListFrame@Single%
\LWR@fvendnone%
}

\newcommand*{\LWR@fvstartline}{%
\LWR@traceinfo{fvstartline}%
\LWR@fvstartnone%
\FV@BeginListFrame@Lines%
}

\newcommand*{\LWR@fvendline}{%
\LWR@traceinfo{fvendline}%
\FV@EndListFrame@Lines%
\LWR@fvendnone%
}
\newcommand*{\LWR@FVfindbordercolor}{%
\FancyVerbRuleColor%
\LWR@findcurrenttextcolor%
\color{black}%
}

\newcommand*{\LWR@FVborderstyle}[1]{%
padding#1: \strip@pt\dimexpr \FV@FrameSep\relax\relax pt ; % space
\LWR@FVfindbordercolor\LWR@indentHTMLtwo%
border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt % space
solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space
}

\def\FV@Frame@none{%
\renewcommand*{\LWR@FVstyle}{\LWR@currenttextcolorstyle}%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}

\FV@Frame@none% default values

\def\FV@Frame@single{%
\renewcommand*{\LWR@FVstyle}{%
    \LWR@currenttextcolorstyle\LWR@indentHTMLtwo%
    \LWR@FVborderstyle{}%
}%
\let\FV@BeginListFrame\LWR@fvstartsingle%
\let\FV@LeftListFrame\FV@LeftListFrame@Single%
\let\FV@RightListFrame\FV@RightListFrame@Single%
\let\FV@EndListFrame\LWR@fvendsingle}

\def\FV@Frame@lines{%
\renewcommand*{\LWR@FVstyle}{%
    \LWR@currenttextcolorstyle\LWR@indentHTMLtwo%
    \LWR@FVborderstyle{-top}%
    \LWR@indentHTMLtwo%
    \LWR@FVborderstyle{-bottom}%
}%
\let\FV@BeginListFrame\LWR@fvstartline%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendline}

\def\FV@Frame@topline{%
\renewcommand*{\LWR@FVstyle}{%
    \LWR@currenttextcolorstyle\LWR@indentHTMLtwo%
    \LWR@FVborderstyle{-top}%
}%
\let\FV@BeginListFrame\LWR@fvstartline%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}

\def\FV@Frame@bottomline{%
\renewcommand*{\LWR@FVstyle}{%
    \LWR@currenttextcolorstyle\LWR@indentHTMLtwo%
    \LWR@FVborderstyle{-bottom}%
}%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\relax%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendline}

\def\FV@Frame@leftline{%
\renewcommand*{\LWR@FVstyle}{%
    \LWR@currenttextcolorstyle\LWR@indentHTMLtwo%
    \LWR@FVborderstyle{-left}%
}%
\ifx\FancyVerbFillColor\relax%
\let\FV@FrameFillLine\relax%
\else%
\@tempdima\FV@FrameRule\relax%
\multiply\@tempdima-\tw@%
\edef\FV@FrameFillLine{%
{\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}%
\kern-\number\@tempdima sp}}%
\fi%
\let\FV@BeginListFrame\LWR@fvstartnone%
\let\FV@LeftListFrame\FV@LeftListFrame@Single%
\let\FV@RightListFrame\relax%
\let\FV@EndListFrame\LWR@fvendnone}
\def\FV@SingleFrameLine#1{%
    \ifnum#1=\z@\relax
      \let\FV@Label\FV@LabelBegin
    \else
      \let\FV@Label\FV@LabelEnd
    \fi
    \ifx\FV@Label\relax
    \else
      \ifnum#1=\z@
        \ifx\FV@LabelPositionTopLine\relax
        \else
        \fi
      \else
        \ifx\FV@LabelPositionBottomLine\relax
        \else
        \fi
      \fi
    \fi
}
\def\FV@ListProcessLine#1{%
   \hbox to \hsize{%
      \hbox to \VerbatimHTMLWidth {%
       \ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}%
        \FV@LeftListNumber%
      \FancyVerbFormatLine{#1}%
      \hss%
      \FV@RightListNumber%
    }%
      \hss% required to avoid underfull hboxes
}
}


\xpretocmd{\FV@BeginVBox}
    {%
        \LWR@forcenewpage% instead of \preto
        \LWR@atbeginverbatim{bverbatim}%
    }
    {}
    {\LWR@patcherror{fancyvrb}{FV@BeginVBox}}

\xapptocmd{\FV@EndVBox}
    {%
        \LWR@afterendverbatim%
    }
    {}
    {\LWR@patcherror{fancyvrb}{FV@EndVBox}}

} % \AfterEndPreamble

\endinput
%%
%% End of file `lwarp-fancyvrb.sty'.