Debian Codegraph @

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

raw
1 %%
2 %% This is file `lwarp-keyfloat.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `keyfloat')
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{keyfloat}[2024/01/12]
21
22 \IfPackageAtLeastTF{keyfloat}{2019/09/23}{\relax}{
23 \PackageError{lwarp-keyfloat}
24 {%
25 The keyfloat package is out of date.\MessageBreak
26 Update to keyfloat v2.01 2019/09/23 or later%
27 }
28 {%
29 Please update the keyfloat package. It's worth it!%
30 }
31 }
32
33 \AtBeginDocument{
34
35 \providecommand*{\KFLT@LWR@hook@boxouter}{}
36
37 \renewcommand*{\KFLT@LWR@hook@boxouter}{%
38 \ifbool{KFLT@keywrap}{%
39 }{%
40 \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{%
41 \setlength{\linewidth}{6in}%
42 \setlength{\textwidth}{6in}%
43 \setlength{\textheight}{9in}%
44 }{}%
45 }%
46 \normalcolor%
47 }
48 \LetLtxMacro\KFLT@LWR@hook@keysubfloats\KFLT@LWR@hook@boxouter
49 \let\KFLT@LWR@hook@keyfloatsminipage\relax
50 \let\endKFLT@LWR@hook@keyfloatsminipage\relax
51 \newenvironment*{KFLT@LWR@hook@keyfloatsminipage}[1]{}{}
52 \LetLtxMacro\KFLT@LWR@hook@keyfloats\KFLT@LWR@hook@boxouter
53
54 \VerifyCommand[lwarp][keyfloat]{\KFLT@maybeendfloatrow}
55 {ABD652AC104E3CF79D66B92BC7E4E2D7}
56
57 \renewcommand*{\KFLT@maybeendfloatrow}{%
58 \ifnumless{\value{KFLT@thiscol}}{\value{KFLT@numcols}}%
59 {}% thiscol < numcols
60 {% >=
61 \defcounter{KFLT@thiscol}{0}%
62 }%
63 }%
64
65 \VerifyCommand[lwarp][keyfloat]{\KFLT@trackrows}
66 {8F99A9FB9A491C471A77041CFA37BAE2}
67
68 \renewcommand{\KFLT@trackrows}%
69 {%
70 \ifboolexpr{%
71 test {\ifnumgreater{\value{KFLT@keyfloatdepth}}{0}} or%
72 bool{KFLT@inkeysubfloats}%
73 }%
74 {% nested
75 \KFLT@maybestartfloatrow%
76 \ifnumgreater{\value{KFLT@thiscol}}{1}%
77 {%
78 }%
79 {}%
80 }% nested
81 {}% not nested
82 }
83 \VerifyCommand[lwarp][keyfloat]{\KFLT@onefigureimage}
84 {803E82896F8D49700946B1A6CB132A55}
85
86 \RenewDocumentCommand{\KFLT@onefigureimage}{m}
87 {%
88 \LWR@traceinfo{KFLT@onefigureimage}%
89 \ifthenelse{\NOT\equal{\KFLT@lw}{}}%
90 {%
91 \ifdimgreater{\KFLT@h}{0pt}%
92 {%
93 \KFLT@frame{%
94 \includegraphics%
95 [%
96 scale=\KFLT@s,%
97 width=\KFLT@imagewidth,%
98 height=\KFLT@h,%
99 \KFLT@keepaspectratio,%
100 ]{#1}%
101 }%
102 }%
103 {%
104 \KFLT@frame{\includegraphics%
105 [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
106 }%
107 }%
108 {% not linewidth
109 \ifthenelse{\dimtest{\KFLT@w}{>}{0pt}}%
110 {% width is given
111 \ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
112 {% w and h
113 \KFLT@frame{\includegraphics[%
114 scale=\KFLT@s,%
115 width=\KFLT@imagewidth,%
116 height=\KFLT@h,%
117 \KFLT@keepaspectratio,%
118 ]{#1}}%
119 }% w and h
120 {% only w
121 \KFLT@frame{\includegraphics%
122 [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
123 }% only w
124 }% width is given
125 {% width is not given
126 \ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
127 {%
128 \KFLT@frame{\includegraphics%
129 [scale=\KFLT@s,height=\KFLT@h]{#1}}%
130 }%
131 {%
132 \KFLT@frame{\includegraphics%
133 [scale=\KFLT@s]{#1}}%
134 }%
135 }% width is not given
136 }% not linewidth
137 \LWR@traceinfo{KFLT@onefigureimage: done}%
138 }
139 \VerifyEnvironment[lwarp][keyfloat]{KFLT@boxinner}
140 {44BA9E3F4EA1B3E533F47377BA47F145}{590DE3AADA8DF85EF6E1589B41F0D4F6}
141
142 \RenewDocumentEnvironment{KFLT@boxinner}{}
143 {%
144 \LWR@traceinfo{KFLT@boxinner}%
145 \LWR@stoppars%
146 \minipagefullwidth%
147 \ifboolexpr{bool{KFLT@ft} or bool{KFLT@f}}{%
148 \fminipage{\KFLT@imagewidth}%
149 }{%
150 \minipage{\KFLT@imagewidth}%
151 }%
152 }
153 {%
154 \ifboolexpr{bool{KFLT@ft} or bool{KFLT@f}}{%
155 \endfminipage%
156 }{%
157 \endminipage%
158 }%
159 \LWR@startpars%
160 \LWR@traceinfo{KFLT@boxinner: done}%
161 }
162
163 \newcommand*{\LWR@KFLT@settextalign}[1]{%
164 \def\LWR@KFLT@textalign{justify}%
165 \ifcsstring{KFLT@#1textalign}{\centering}%
166 {\def\LWR@KFLT@textalign{center}}%
167 {}%
168 \ifcsstring{KFLT@#1textalign}{\raggedleft}%
169 {\def\LWR@KFLT@textalign{right}}%
170 {}%
171 \ifcsstring{KFLT@#1textalign}{\raggedright}%
172 {\def\LWR@KFLT@textalign{left}}%
173 {}%
174 }
175
176 \VerifyCommand[lwarp][keyfloat]{\KFLT@addtext}{C086CC818525A9B03EDEACC02609A3BE}
177
178 \renewcommand{\KFLT@addtext}[1]
179 {%
180 \ifcsempty{KFLT@#1t}%
181 {}% no text
182 {% text to add
183 {% local
184 \addvspace{\smallskipamount}%
185 \LWR@KFLT@settextalign{#1}%
186 \begin{BlockClass}[text-align:\LWR@KFLT@textalign]{floatnotes}%
187 \setlength{\parskip}{1.5ex}%
188 \setlength{\parindent}{0em}%
189 \csuse{KFLT@#1t}%
190 \end{BlockClass}%
191 }% local
192 }% text to add
193 }
194
195 \IfPackageLoadedTF{tocdata}
196 {}
197 {% tocdata not loaded
198
199 \newcommand*{\LWR@KFLT@setnamealign}[1]{%
200 \def\LWR@KFLT@textalign{justify}%
201 \ifstrequal{#1}{\centering}%
202 {\def\LWR@KFLT@textalign{center}}%
203 {}%
204 \ifstrequal{#1}{\raggedleft}%
205 {\def\LWR@KFLT@textalign{right}}%
206 {}%
207 \ifstrequal{#1}{\raggedright}%
208 {\def\LWR@KFLT@textalign{left}}%
209 {}%
210 }
211
212 \VerifyCommand[lwarp][keyfloat]{\KFLT@@addartisttext}
213 {35968ED08D9BE09FF1B45E1E40AFE9A7}
214
215 \renewcommand*{\KFLT@@addartisttext}[3]{%
216 \LWR@KFLT@setnamealign{#3}%
217 \begin{BlockClass}[text-align:\LWR@KFLT@textalign]{floatnotes}%
218 \footnotesize\textsc{%
219 \KFLT@optionalname{\csuse{KFLT@#1a#2p}}%
220 \KFLT@optionalname{\csuse{KFLT@#1a#2f}}%
221 \csuse{KFLT@#1a#2l}%
222 \csuse{KFLT@#1a#2s}%
223 }%
224 \end{BlockClass}
225 }
226
227 }% tocdata not loaded
228
229 \DeclareDocumentEnvironment{KFLT@marginfloat}{O{-1.2ex} m}
230 {%
231 \uselengthunit{PT}%
232 \LWR@BlockClassWP%
233 {float:right; width:2in; margin:10pt}%
234 {}%
235 (note)%
236 {marginblock}%
237 \renewcommand*{\@captype}{#2}%
238 \minipage{1.2\LWR@usersmarginparwidth}%
239 \setlength{\marginparwidth}{.95\LWR@usersmarginparwidth}%
240 }
241 {%
242 \endminipage%
243 \endLWR@BlockClassWP%
244 }
245
246 \DeclareDocumentEnvironment{marginfigure}{o}
247 {\begin{KFLT@marginfloat}{figure}}
248 {\end{KFLT@marginfloat}}
249
250 \DeclareDocumentEnvironment{margintable}{o}
251 {\begin{KFLT@marginfloat}{table}}
252 {\end{KFLT@marginfloat}}
253
254 \DeclareDocumentEnvironment{keywrap}{m +m}
255 {%
256 \begin{LWR@setvirtualpage}*
257 \setlength{\LWR@templengthone}{#1}%
258 \begin{LWR@BlockClassWP}%
259 {%
260 float:right; width:\LWR@printlength{\LWR@templengthone}; % extra space
261 margin:10pt%
262 }%
263 {}%
264 (note)%
265 {marginblock}%
266 \setlength{\linewidth}{.95\LWR@templengthone}%
267 \booltrue{KFLT@keywrap}%
268 #2%
269 \end{LWR@BlockClassWP}%
270 \end{LWR@setvirtualpage}%
271 }
272 {}
273 }% AtBeginDocument
274
275
276 \endinput
277 %%
278 %% End of file `lwarp-keyfloat.sty'.