Debian Codegraph @

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

raw
1 %%
2 %% This is file `lwarp-listings.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `listings')
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
19
20 \LWR@ProvidesPackagePass{listings}[2024/09/23]
21
22 \lst@column@flexible
23 \let\LWR@origlst@Init\lst@Init
24 \let\LWR@origlst@DeInit\lst@DeInit
25
26 \let\LWR@origlsthkEveryPar\lsthk@EveryPar
27
28 \renewcommand{\l@lstlisting}[2]{\hypertocfloat{1}{lstlisting}{lol}{#1}{#2}}
29 \def\lstset@#1{\endgroup%
30 \setkeys{lst}{%
31 #1%
32 ,literate=%
33 {<}{\HTMLentity{lt}}{4}%
34 {>}{\HTMLentity{gt}}{4}%
35 {'}{\HTMLentity{apos}}{6}%
36 {`}{\HTMLentity{grave}}{7}%
37 }%
38 }
39 \VerifyCommand[lwarp][listings]{\lst@Init}{A4D103298A6AC8230F525C61F1E1E541}
40
41 \renewcommand{\lst@Init}[1]{%
42 \LWR@traceinfo{lst@Init}% lwarp
43 \lst@ifdisplaystyle% lwarp
44 \LWR@forcenewpage% lwarp
45 \fi% lwarp
46 \let\lst@ifmathescape\iffalse% lwarp
47 \let\lst@DefEsc\relax% lwarp
48 \def\lst@escapebegin{}% lwarp
49 \def\lst@escapeend{}% lwarp
50 \renewcommand*{\@captype}{lstlisting}% lwarp
51 \let\lst@aboveskip\z@\let\lst@belowskip\z@% lwarp
52 \gdef\lst@boxpos{t}% lwarp
53 \let\lst@frame\@empty% lwarp
54 \let\lst@frametshape\@empty% lwarp
55 \let\lst@framershape\@empty% lwarp
56 \let\lst@framebshape\@empty% lwarp
57 \let\lst@framelshape\@empty% lwarp
58 \lstframe@\lst@frameround ffff\relax% lwarp
59 \lst@multicols\@empty% lwarp
60 \begingroup%
61 \hbadness=10000\relax%
62 \ifx\lst@float\relax\else%
63 \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}%
64 \expandafter\@tempa%
65 \fi%
66 \ifx\lst@multicols\@empty\else%
67 \edef\lst@next{\noexpand\multicols{\lst@multicols}}%
68 \expandafter\lst@next%
69 \fi%
70 \ifhmode\ifinner \lst@boxtrue \fi\fi%
71 \lst@ifbox%
72 \lsthk@BoxUnsafe%
73 \hbox to\z@\bgroup%
74 $\if t\lst@boxpos \vtop%
75 \else \if b\lst@boxpos \vbox%
76 \else \vcenter \fi\fi%
77 \bgroup \par\noindent%
78 \else%
79 \lst@ifdisplaystyle%
80 \lst@EveryDisplay%
81 \par\penalty-50\relax%
82 \vspace\lst@aboveskip%
83 \fi%
84 \fi%
85 \normalbaselines%
86 \abovecaptionskip\lst@abovecaption\relax%
87 \belowcaptionskip\lst@belowcaption\relax%
88 \lst@MakeCaption t%
89 \LWR@traceinfo{lst@Init: defining current label !\@currentlabel!}%
90 \let\LWR@listings@currentlabel\@currentlabel% lwarp
91 \LWR@traceinfo{lst@Init: defining current label !\cref@currentlabel!}%
92 \let\LWR@listings@cref@currentlabel\cref@currentlabel% lwarp
93 \LWR@traceinfo{lst@Init: preinit and init}%
94 \lsthk@PreInit \lsthk@Init%
95 \let\@currentlabel\LWR@listings@currentlabel% lwarp
96 \let\cref@currentlabel\LWR@listings@cref@currentlabel% lwarp
97 \LWR@traceinfo{lst@Init: M}%
98 \lst@ifdisplaystyle
99 \global\let\lst@ltxlabel\@empty
100 \if@inlabel
101 \lst@ifresetmargins
102 \leavevmode
103 \else
104 \xdef\lst@ltxlabel{\the\everypar}%
105 \lst@AddTo\lst@ltxlabel{%
106 \global\let\lst@ltxlabel\@empty
107 \everypar{\lsthk@EveryLine\lsthk@EveryPar}}%
108 \fi
109 \fi
110 \everypar\expandafter{\lst@ltxlabel
111 \lsthk@EveryLine\lsthk@EveryPar}%
112 \else
113 \everypar{}
114 \let\lst@NewLine\@empty
115 \fi
116 \LWR@traceinfo{lst@Init: P}%
117 \lsthk@InitVars \lsthk@InitVarsBOL
118 \lst@Let{13}\lst@MProcessListing
119 \let\lst@Backslash#1%
120 \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}%
121 \lst@InitFinalize%
122 \LWR@traceinfo{lst@Init: S}%
123 \def\lst@framelr{}% lwarp
124 \LWR@traceinfo{lst@Init: finished origlst@Init}%
125 \lst@ifdisplaystyle% lwarp
126 \LWR@traceinfo{lst@Init: About to create verbatim.}% lwarp
127 \let\lsthk@EveryPar\relax% lwarp
128 \LWR@atbeginverbatim{programlisting}% lwarp
129
130 \let\lsthk@EveryPar\LWR@origlsthkEveryPar% lwarp
131 \else% lwarp
132 \ifbool{LWR@verbtags}{\LWR@htmltag{% lwarp
133 span class=\textquotedbl{}inlineprogramlisting\textquotedbl% lwarp
134 }}{}% lwarp
135 \fi% lwarp
136 \LWR@traceinfo{lst@Init: done}%
137 }
138 \def\LWR@listings@synaxdolloar{$}% lwarp editor synax highlighting
139 \xpretocmd{\lst@DeInit}
140 {%
141 \LWR@traceinfo{lst@DeInit}%
142 \lst@ifdisplaystyle%
143 \let\lsthk@EveryPar\relax%
144 \LWR@afterendverbatim%
145 \let\lsthk@EveryPar\LWR@origlsthkEveryPar%
146 \else%
147 \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}%
148 \fi%
149 }
150 {}
151 {\LWR@patcherror{listings}{lst@DeInit}}
152 \VerifyCommand[lwarp][listings]{\lst@MakeCaption}
153 {2B8D898FA33039FBAB7D1772D544153D}
154
155 \def\lst@MakeCaption#1{%
156 \LWR@traceinfo{lst@MakeCaption at #1}%
157 \lst@ifdisplaystyle
158 \LWR@traceinfo{lst@MakeCaption: making a listings display caption}%
159 \ifx #1t%
160 \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
161 \expandafter\refstepcounter
162 \fi {lstlisting}%
163 \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
164 \global\let\lst@name\lst@arg \global\let\lstname\lst@name
165 \lst@ifnolol\else
166 \ifx\lst@@caption\@empty
167 \ifx\lst@caption\@empty
168 \ifx\lst@intname\@empty
169 \else
170 \def\lst@temp{ }%
171 \ifx\lst@intname\lst@temp \else
172 \LWR@traceinfo{lst@MakeCaption: addcontents lst@name: -\lst@name-}%
173 \fi
174 \fi
175 \fi
176 \else
177 \LWR@traceinfo{lst@MakeCaption: addcontents lst@@caption: -\lst@@caption-}%
178 \addcontentsline{\ext@lstlisting}{lstlisting}%
179 {\protect\numberline{\thelstlisting}%
180 {\protect\ignorespaces \LWR@isolate{\lst@@caption} \protect\relax}}%
181 \fi
182 \fi
183 \fi
184 \ifx\lst@caption\@empty\else
185 \LWR@traceinfo{lst@MakeCaption: lst@caption not empty-}%
186 \lst@IfSubstring #1\lst@captionpos
187 {\begingroup
188 \LWR@traceinfo{lst@MakeCaption: at the selected position}%
189 \ifx\lst@title\@empty
190 \LWR@stoppars% lwarp
191 \lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption}
192 \else
193 \LWR@traceinfo{lst@MakeCaption: Making title: \lst@title}%
194 \begin{BlockClass}{lstlistingtitle}% lwarp
195 \lst@maketitle\lst@title% lwarp
196 \end{BlockClass}% lwarp
197 \fi%
198 \LWR@traceinfo{lst@MakeCaption: About to assign label: !\lst@label!}%
199 \ifx\lst@label\@empty\else% lwarp
200 \leavevmode% gets rid of bad space factor error
201 \GetTitleStringExpand{\lst@caption}% lwarp
202 \edef\LWR@lntemp{\GetTitleStringResult}% lwarp
203 \edef\@currentlabelname{\detokenize\expandafter{\LWR@lntemp}}% lwarp
204 \label{\lst@label}\fi% lwarp
205 \LWR@traceinfo{lst@MakeCaption: Finished assigning the label.}% lwarp
206 \endgroup}{}%
207 \fi
208 \LWR@traceinfo{lst@MakeCaption: end of making a listings display caption}%
209 \else
210 \LWR@traceinfo{lst@MakeCaption: INLINE}%
211 \fi
212 \LWR@traceinfo{lst@MakeCaption: done at #1}%
213 }
214
215 \renewcommand{\lst@maketitle}[1]{%
216 \LWR@isolate{#1}%
217 }%
218
219 \lst@Key{numbers}{none}{%
220 \let\lst@PlaceNumber\@empty
221 \lstKV@SwitchCases{#1}%
222 {none:\\%
223 left:\def\lst@PlaceNumber{%
224 \LWR@orignormalfont%
225 \lst@numberstyle{\thelstnumber}\kern\lst@numbersep%
226 }\\%
227 right:\def\lst@PlaceNumber{\LWR@origrlap{\LWR@orignormalfont
228 \kern 6in \kern\lst@numbersep
229 \lst@numberstyle{\thelstnumber}}}%
230 }{\PackageError{lwarp-listings}{Numbers #1 unknown}\@ehc}}
231
232 \endinput
233 %%
234 %% End of file `lwarp-listings.sty'.