Debian Codegraph @

texmf-dist/source/latex/newfloat/fallback/v1.1/newfloat.dtx

raw
1 % \iffalse meta-comment
2 %
3 % This is file `newfloat.dtx'.
4 %
5 % Copyright (C) 2011-2021 Axel Sommerfeldt ([email protected])
6 %
7 % --------------------------------------------------------------------------
8 %
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
16 %
17 % This work has the LPPL maintenance status "unmaintained".
18 %
19 % This work consists of the files newfloat.ins, newfloat.dtx,
20 % and the derived file newfloat.sty.
21 %
22 % \fi
23 % \CheckSum{1634}
24 %
25 % \iffalse
26 %<*driver>
27 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
28 \ProvidesFile{newfloat.drv}[2021/02/27 v1.1 This package offers a command for defining new floating environments]
29 \hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up.
30 %
31 \documentclass{ltxdoc}
32 \setlength\parindent{0pt}
33 \setlength\parskip{\smallskipamount}
34 %
35 \usepackage{ifpdf}
36 \ifpdf
37 \usepackage{mathptmx,courier}
38 \usepackage[scaled=0.90]{helvet}
39 % \addtolength\marginparwidth{15pt}
40 \fi
41 %
42 \usepackage[bottom]{footmisc}
43 %
44 \usepackage{hypdoc}
45 \ifpdf\usepackage{hypdestopt}\fi
46 \hypersetup{pdfkeywords={LaTeX, package, newfloat},pdfstartpage={},pdfstartview={}}
47 %
48 \usepackage{newfloat}
49 %
50 \DeclareRobustCommand*\eTeX{\texorpdfstring
51 {\leavevmode\hbox{$\varepsilon$}-\TeX}%
52 {e-TeX}}
53 \DeclareRobustCommand*\AmS{\texorpdfstring
54 {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
55 {AMS}}
56 \DeclareRobustCommand*\KOMAScript{\texorpdfstring
57 {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
58 {KOMA-Script}}
59 \DeclareRobustCommand*\NTG{NTG}
60 \DeclareRobustCommand*\SmF{SMF}
61 %
62 \begin{document}
63 \DocInput{newfloat.dtx}
64 \end{document}
65 %</driver>
66 % \fi
67 %
68 % \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
69 % \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
70 % \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
71 % \let\class\puresf \let\package\puresf
72 % \let\env\purett \let\opt\purett
73 %
74 % \def\thispackage{the \package{newfloat} package}
75 % \def\Thispackage{The \package{newfloat} package}
76 %
77 % \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
78 % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
79 % \newcommand*\version[2][]{\textit{v#2}}
80 %
81 % \setlength\leftmargini{1.5em}
82 %
83 % \GetFileInfo{newfloat.drv}
84 % \let\docdate\filedate
85 % \let\docversion\fileversion
86 % \GetFileInfo{newfloat.sty}
87 %
88 % \title{\texorpdfstring{\Thispackage\thanks{%^^A
89 % This package has version number \docversion.}}%^^A
90 % {The newfloat package}}
91 % \author{Axel Sommerfeldt\\
92 % \url{https://gitlab.com/axelsommerfeldt/newfloat}}
93 % \date{\docdate}
94 % \maketitle
95 %
96 % \begin{abstract}
97 % \centering
98 % This package offers the command
99 % |\Declare|\-|Floating|\-|Environment| for defining new floating environments
100 % which behave like |figure| and |table|.
101 % \end{abstract}
102 %
103 % \tableofcontents
104 %
105 % \clearpage
106 % \section{Loading the package}
107 %
108 % First of all you need to include this package into your document with
109 % \begin{quote}
110 % |\usepackage|\oarg{options}|{newfloat}|
111 % \end{quote}
112 % where \meta{options} are one or more of
113 % \begin{quote}\begin{tabular}{r@{\,}l}
114 % |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\quad\\
115 % |chapterlistsgap=| & \meta{value}~\footnotemark[1]
116 % \end{tabular}\end{quote}
117 %
118 % The ``within'' counter specifies the counter which will be used to reset
119 % the counter of the floating environments |figure| and |table| .
120 % (Furthermore this setting will be used as default setting for
121 % |\Declare|\-|Floating|\-|Environment|.)
122 %
123 % So for example |within=chapter| will give you a numbering scheme
124 % \meta{chapter}.\meta{x} for floating environments,
125 % while |within=section| will give you a numbering scheme
126 % \meta{chapter}.\meta{section}.\meta{x}, or \meta{section}.\meta{x}
127 % if the document class does not offer |\chapter|.
128 % |within=none| will result in a continuous numbering throughout the document,
129 % i.e.~the numbering scheme will be simply \meta{x}.
130 %
131 % The option |chapterlistsgap=|\meta{value} sets the amount of the
132 % vertical gap inserted into the ``List of Figure'', ``List of Tables'',
133 % and all lists created with |\Declare|\-|Floating|\-|Environment|
134 % when a new chapter will be started.
135 % The default value is |10pt|.
136 % (This option will only be available if the document class used offer
137 % the usage of chapters, e.g.~the |book| or |report| document class.)
138 %
139 % \pagebreak[3]
140 % Both options can be changed later on, too, by using the command
141 % \begin{quote}
142 % |\newfloatsetup|\meta{options}\quad,
143 % \end{quote}
144 %
145 % \pagebreak[3]
146 % \section{\cs{DeclareFloatingEnvironment}}
147 %
148 % After loading \thispackage\ you can define your own floating environments with
149 % \begin{quote}
150 % \iffalse
151 % \setlength{\leftmargin}{6cm}
152 % \fi
153 % |\DeclareFloatingEnvironment|\oarg{options}\marg{type}%
154 % \iffalse
155 % \oarg{name}\oarg{list name}
156 % \fi
157 % \end{quote}
158 % where \meta{options} are one or more of
159 % \begin{quote}\begin{tabular}{r@{\,}l}
160 % |fileext=| & \meta{file extension}\\
161 % |listname=| & \meta{list name}\\
162 % |name=| & \meta{prosa name}\\
163 % |placement=| & \meta{combination of \,\purett{htbp}}\\
164 % |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\\
165 % |chapterlistsgaps=| & \texttt{on} \emph{or} \texttt{off}~\footnotemark[1]
166 % \end{tabular}\end{quote}
167 % \footnotetext[1]{Please note that although \thispackage\ tries hard to offer this
168 % option it may not be available or is working incorrectly in cooperation with
169 % your document class since there is no standard interface which we could use
170 % for that purpose. Therefore we have to try to patch the \cs{chapter} command,
171 % and if this fails, we try to patch \cs{addtocontents} (in an unusual way) instead.}
172 %
173 % If no \meta{options} are given,
174 % ``lo\meta{type}'' will be used as \meta{file extension} for the list,
175 % ``List of \meta{name}s'' as \meta{list name}.
176 % ``\meta{name}'' as \meta{name} (but with the first letter capitalized),
177 % ``|tbp|'' as \meta{placement} specifier,
178 % and ``|chapter|'' resp. ``|none|'' as \meta{``within'' counter},
179 % i.e., the counter which resets the numbering.
180 %
181 % The default value of the |chapterlistsgaps=| option depends on the
182 % ``within'' setting, it is set to |on| if |chapter| or |section| is selected,
183 % otherwise it is set to |off|.
184 % (This option will only be available if the document class used offer
185 % the usage of chapters, e.g.~the |book| or |report| document class.)
186 %
187 % The list will be typeset using the command |\list|\-|of|\meta{type}|s|
188 % resp.~|\list|\-|of|\meta{type}|es|,
189 % analogous to |\list|\-|of|\-|figures| and |\list|\-|of|\-|tables|.
190 %
191 % If the \package{fltpage} package is loaded, an environment called
192 % |FP|\meta{type} will be defined additionally, same for |sideways|\meta{type}
193 % (\package{rotating} package), |SC|\meta{type} (\package{sidecap} package),
194 % and |wrap|\meta{type} (\package{wrapfig} package).
195 %
196 % \bigskip
197 %
198 % \pagebreak[3]
199 % So for example
200 % \begin{quote}
201 % |\DeclareFloatingEnvironment{diagram}|
202 % \end{quote}
203 % will define a new floating environment called |diagram|,
204 % the list will be stored in a file with the extension |lodiagram|, the name
205 % (used for the caption) will be ``Diagram'' and the list name
206 % ``List of Diagrams''.
207 % The list could be typeset with |\list|\-|of|\-|diagrams|.
208 % Dependent on which packages are loaded, the environments |FP|\-|diagram|,
209 % |sideways|\-|diagram|, |SC|\-|diagram|, and |wrap|\-|diagram| will be defined additionally.
210 %
211 % \pagebreak[3]
212 % Another example:
213 % \begin{quote}
214 % |\DeclareFloatingEnvironment[|\\
215 % | fileext=lox,|\\
216 % | listname={List of Matrixes},|\\
217 % | name=Matrix,|\\
218 % | placement=p,|\\
219 % | within=section,|\\
220 % | chapterlistsgaps=off|\\
221 % | ]{matrixx}|
222 % \end{quote}
223 % will define a new floating environment called |matrixx| with the given settings.
224 % Please note that names which contain spaces needs to be enclosed in curly braces.
225 %
226 % \pagebreak[3]
227 % \section{\cs{SetupFloatingEnvironment}}
228 %
229 % While |\DeclareFloatingEnvironment| will create new floating environments,
230 % \begin{quote}
231 % |\SetupFloatingEnvironment|\marg{floating environment}\marg{options}
232 % \end{quote}
233 % will change the settings of existing ones, i.e. either |figure| or |table|,
234 % or a one created with |\Declare|\-|Floating|\-|Environment|,
235 % or a one created with |\new|\-|float| offered by the \package{float} package,
236 % or a one created with |\new|\-|float| offered by the \package{memoir} document class,
237 % or a one created with |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package,
238 % or \ldots
239 %
240 % The \meta{options} are the same as the options for
241 % |\Declare|\-|Floating|\-|Environment|,
242 % but one should avoid changing the file extension
243 % of existing floating environments,
244 % i.e.~using the |fileext=| option within |\Setup|\-|Floating|\-|Environment|
245 % is usually a very bad idea.
246 %
247 % \bigskip
248 %
249 % \pagebreak[3]
250 % An example:
251 % \begin{quote}
252 % |\SetupFloatingEnvironment{lstlisting}{chapterlistsgaps=off}|
253 % \end{quote}
254 % will switch off the chapter lists gaps for |lstlisting| environments
255 % offered by the \package{listings} package.
256 %
257 % \pagebreak[3]
258 % \section{\cs{ForEachFloatingEnvironment}}
259 %
260 % \begin{quote}
261 % |\ForEachFloatingEnvironment|\marg{code with \#1}
262 % \end{quote}
263 % will execute the given \meta{code} for all known floating environments,
264 % and for ones defined with |\Declare|\-|Floating|\-|Environment| later on.
265 %
266 % \pagebreak[3]
267 % So for example the \package{subcaption} packages uses
268 % \begin{quote}
269 % |\ForEachFloatingEnvironment{\DeclareCaptionSubType{#1}}|
270 % \end{quote}
271 % for initializing itself for all floating environments which are
272 % known to \thispackage.
273 %
274 % \medskip
275 %
276 % There is also a starred variant |\For|\-|Each|\-|Floating|\-|Environment*|
277 % which will execute the given code for already existing floating environments
278 % only, i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|.
279 %
280 % \pagebreak[3]
281 % An example:
282 % \begin{quote}
283 % |\ForEachFloatingEnvironment*{\typeout{#1}}|
284 % \end{quote}
285 % will typeout the names of all already known floating environments to the terminal
286 % and log file.
287 %
288 % \pagebreak[3]
289 % \section{\cs{PrepareListOf}}
290 %
291 % Unfortunately there is no standardized way of typesetting and customizing
292 % lists of floating environments, i.e.~every document class offers it's own stuff here,
293 % and there are plenty of \LaTeXe\ packages for this purpose.
294 %
295 % \pagebreak[3]
296 % For that reason the \thispackage\ simply typesets the lists of newly
297 % defined floating environments as ``List of Figure'' internally (using |\list|\-|of|\-|figure|)
298 % but using a different list (the right one, of course) and using a different list name,
299 % the one you have specified with either |\Declare|\-|Floating|\-|Environment| or
300 % |\Setup|\-|Floating|\-|Environment|.\footnote{Please note that this is not the
301 % fact when using a \KOMAScript\ document class, not \cs{listoffigure} but \cs{listoftoc}
302 % will be used here, and therefore no problems should occur.}
303 %
304 % \pagebreak[3]
305 % While this usually results in the same layout as the ``List of Figure'' and
306 % is sufficient for most cases, there are some cases where this might
307 % lead to an unwanted side effect.
308 %
309 % \pagebreak[3]
310 % Therefore the \thispackage\ offers
311 % \begin{quote}
312 % |\PrepareListOf|\marg{floating environment}\marg{code}
313 % \end{quote}
314 % which will execute the given \meta{code} right before actually typesetting the list
315 % with |\list|\-|of|\-|figures| internally.
316 %
317 % \pagebreak[3]
318 % One example:
319 % \begin{quote}
320 % |\PrepareListOf{diagram}{%|\\
321 % | \renewcommand{\cftfigpresnum}{Diagram~}}|
322 % \end{quote}
323 % will change the part typeset in front of the diagram number within the
324 % ``List of Diagrams'' when using the \package{tocloft} package~\cite{tocloft}.
325 % Without the code above you will get the part defined for figures instead.
326 %
327 % \pagebreak[3]
328 % However, when dealing with the \package{tocloft} package it's a better
329 % idea not to use |\Prepare|\-|List|\-|Of| but the customization facilities of that package
330 % instead, e.g.:
331 % \begin{quote}
332 % |\documentclass{book}|\\
333 % \ldots\\
334 % |\usepackage{newfloat,tocloft}|\\
335 % |\newlistof{diagram}{lod}{List of Diagrams}|\\
336 % |\DeclareFloatingEnvironment[name=Diagram,fileext=lod]{diagram}|\\
337 % | % Note: Due of a bug in tocloft the file extension|\\
338 % | % must be repeated at \DeclareFloatingEnvironment,|\\
339 % | % otherwise you will get an empty list.|\\
340 % ||\\
341 % |% Customize `List of Figures'|\\
342 % |\renewcommand{\cftfigpresnum}{Figure~}|\\
343 % |\setlength{\cftfignumwidth}{2cm}|\\
344 % ||\\
345 % |% Customize `List of Diagrams'|\\
346 % |\renewcommand{\cftdiagrampresnum}{Diagram~}|\\
347 % |\setlength{\cftdiagramnumwidth}{2cm}|\\
348 % ||\\
349 % \ldots\\
350 % ||\\
351 % |\begin{document}|\\
352 % \ldots\\
353 % |\listoffigures|\\
354 % |\listofdiagrams|\\
355 % \ldots\\
356 % |\end{document}|
357 % \end{quote}
358 %
359 % \iffalse
360 % \pagebreak[3]
361 % \section{For \LaTeX{} package authors}
362 %
363 % |\For|\-|Each|\-|Floating|\-|Environment| without \package{newfloat} package:
364 % \begin{quote}
365 % |\newcommand\mypackage@foreachfloat[1]{%|\\
366 % | \@ifundefined{ForEachFloatingEnvironment}%|\\
367 % | {\def\@elt##1{#1}%|\\
368 % | \@ifundefined{c@figure}\@gobble\@elt{figure}%|\\
369 % | \@ifundefined{c@table}\@gobble\@elt{table}%|\\
370 % | \let\@elt\relax|\\
371 % | \newfloat@addtohook{#1}}%|\\
372 % | {\ForEachFloatingEnvironment{#1}}}|\\
373 % |\providecommand\newfloat@addtohook[1]{%|\\
374 % | \toks@=\expandafter{\newfloat@hook{##1}#1}%|\\
375 % | \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%|\\
376 % | \@tempa}|\\
377 % |\providecommand*\newfloat@hook[1]{}|
378 % \end{quote}
379 %
380 % \pagebreak[3]
381 % Adding environment to list of floating environments:
382 % \begin{quote}
383 % |\SetupFloatingEnvironment|\marg{environment}|{}|
384 % \end{quote}
385 % or (without \package{newfloat} package loaded):
386 % \begin{quote}
387 % |\providecommand\newfloat@list{}|\\
388 % |\@cons\newfloat@list{|\marg{environment}|}|
389 % \end{quote}
390 % (Please note the doubled curly braces around the environment name.)
391 % \fi
392 %
393 % \iffalse
394 % --------------------------------------------------------------------------- %
395 % \fi
396 %
397 % \StopEventually{%^^A
398 % \pagebreak[4]
399 % \begin{thebibliography}{9}
400 %
401 % \bibitem{memoir}
402 % Peter Wilson:\\
403 % \href{http://www.ctan.org/pkg/memoir}%
404 % {\emph{The Memoir Class for Configurable Typesetting}},\\
405 % 2011/03/06
406 %
407 % \bibitem{NTGclasses}
408 % Victor Eijkhout:\\
409 % \href{http://www.ctan.org/pkg/ntgclass}%
410 % {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
411 % \mbox{3~September~1989}
412 %
413 % \bibitem{KOMAScript}
414 % Markus Kohm \& Jens-Uwe-Morawski:\\
415 % \href{http://www.ctan.org/pkg/koma-script}%
416 % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
417 % 2012-07-22
418 %
419 % \bibitem{float}
420 % Anselm Lingnau:\\
421 % \href{http://www.ctan.org/pkg/float}%
422 % {\emph{An Improved Environment for Floats}},\\
423 % 2001/11/08
424 %
425 % \bibitem{fltpage}
426 % Sebastian Gross:\\
427 % \href{http://www.ctan.org/pkg/fltpage}%
428 % {\emph{Welcome to the beta test of fltpage package!}},\\
429 % 1998/11/13
430 %
431 % \bibitem{rotating}
432 % Sebastian Rahtz and Leonor Barroca:\\
433 % \href{http://www.ctan.org/pkg/rotating}%
434 % {\emph{A style option for rotated objects in \LaTeX}},\\
435 % 1997/09/26
436 %
437 % \bibitem{sidecap}
438 % Rolf Niepraschk \& Hubert G\"a\ss lein:\\
439 % \href{http://www.ctan.org/pkg/sidecap}%
440 % {\emph{The sidecap package}},\\
441 % 2003/06/06
442 %
443 % \bibitem{tocloft}
444 % Peter Wilson, Herries Press, Will Robertson:\\
445 % \href{http://www.ctan.org/pkg/tocloft}%
446 % {\emph{The tocloft package}},\\
447 % 2010/10/13
448 %
449 % \bibitem{wrapfig}
450 % Donald Arseneau:\\
451 % \href{http://www.ctan.org/pkg/wrapfig}%
452 % {\emph{WRAPFIG.STY ver 3.6}},\\
453 % 2003/01/31
454 %
455 % \end{thebibliography}
456 % }
457 %
458 % \iffalse
459 % --------------------------------------------------------------------------- %
460 % \fi
461 %
462 % \DoNotIndex{\\,\_,\ ,\@@par}
463 % \DoNotIndex{\@bsphack}
464 % \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
465 % \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
466 % \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
467 % \DoNotIndex{\@gobble,\@gobbletwo,\@gobblethree,\@gobblefour,\@hangfrom}
468 % \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
469 % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
470 % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
471 % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
472 % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
473 % \DoNotIndex{\@testopt}
474 % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
475 % \DoNotIndex{\p@,\z@}
476 % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
477 % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
478 % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
479 % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
480 % \DoNotIndex{\fi,\footnotesize,\global}
481 % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
482 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
483 % \DoNotIndex{\ifx,\ignorespaces,\itshape}
484 % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
485 % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
486 % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
487 % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
488 % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
489 % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
490 % \DoNotIndex{\providecommand,\quad}
491 % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
492 % \DoNotIndex{\rightskip,\rmfamily}
493 % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
494 % \DoNotIndex{\small,\string,\space,\strut}
495 % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
496 % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
497 % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
498 % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
499 % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
500 % \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
501 % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
502 % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
503 %
504 % \iffalse
505 % --------------------------------------------------------------------------- %
506 % \fi
507 %
508 % \setlength{\parskip}{0pt plus 1pt}
509 % \changes{v1.0}{2011/10/30}{First release as \package{newfloat} package,
510 % outsourced from the \package{caption3} package and revised}
511 % \changes{v1.1}{2013/04/27}{Adapted to the \package{tocloft} package}
512 % \changes{v1.1}{2013/04/27}{New command \cs{PrepareListOf} added}
513 % \changes{v1.1d}{2019/03/16}{Adapted to the \package{dgruyter} package}
514 %
515 % \iffalse
516 % --------------------------------------------------------------------------- %
517 % \fi
518 %
519 % \clearpage
520 % \section{The Implementation}
521 % \iffalse
522 %<*package>
523 % \fi
524 %
525 % \pagebreak[3]
526 % \subsection{Identification}
527 %
528 % We need at least \LaTeX2e\ version 1994/12/01.
529 % \begin{macrocode}
530 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
531 % \end{macrocode}
532 %
533 % Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
534 % (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
535 % \begin{macrocode}
536 \providecommand\DeclareRelease[3]{}
537 \providecommand\DeclareCurrentRelease[2]{}
538 % \end{macrocode}
539 %
540 % Declare all supported releases.
541 % \begin{macrocode}
542 \DeclareRelease{v1.0}{2011-10-30}{newfloat_v1.0.sty}
543 \DeclareCurrentRelease{v1.1}{2013-05-12} % 1st CTAN release of v1.1
544 % \end{macrocode}
545 %
546 % Identify the current version of the package.
547 % \begin{macrocode}
548 \ProvidesPackage{newfloat}[2021/02/27 v1.1p Defining new floating environments (AR)]
549 % \end{macrocode}
550 %
551 % \begin{macro}{\newfloat@Info}
552 % \begin{macro}{\newfloat@InfoNoLine}
553 % |\newfloat@Info|\marg{message}
554 % \begin{macrocode}
555 \newcommand*\newfloat@Info[1]{%
556 \PackageInfo{newfloat}{#1}}
557 \newcommand*\newfloat@InfoNoLine[1]{%
558 \newfloat@Info{#1\@gobble}}
559 % \end{macrocode}
560 % \end{macro}
561 % \end{macro}
562 %
563 % \begin{macro}{\newfloat@Warning}
564 % \begin{macro}{\newfloat@WarningNoLine}
565 % |\newfloat@Warning|\marg{message}
566 % \begin{macrocode}
567 \newcommand*\newfloat@Warning[1]{%
568 \PackageWarning{newfloat}{#1}}
569 \newcommand*\newfloat@WarningNoLine[1]{%
570 \newfloat@Warning{#1\@gobble}}
571 % \end{macrocode}
572 % \end{macro}
573 % \end{macro}
574 %
575 % \begin{macro}{\newfloat@Error}
576 % |\newfloat@Error|\marg{message}
577 % \begin{macrocode}
578 \newcommand*\newfloat@Error[1]{%
579 \PackageError{newfloat}{#1}\newfloat@eh}
580 % \end{macrocode}
581 % \begin{macrocode}
582 \newcommand*\newfloat@eh{%
583 If you do not understand this error, please take a closer look\MessageBreak
584 at the documentation of the `newfloat' package.\MessageBreak\@ehc}
585 % \end{macrocode}
586 % \end{macro}
587 %
588 % \pagebreak[3]
589 % \subsection{Using the keyval package}
590 %
591 % We need the \package{keyval} package for option handling, so we load it here.
592 % \begin{macrocode}
593 \RequirePackage{keyval}[1997/11/10]
594 % \end{macrocode}
595 %
596 % \pagebreak[3]
597 % \subsection{Helper macros}
598 %
599 % \begin{macro}{\newfloat@def}
600 % \changes{v1.1}{2013/04/27}{This macro added}
601 % |\newfloat@def|\marg{macro name}\marg{definition}
602 % \begin{macrocode}
603 \newcommand*\newfloat@def[2]{%
604 \newfloat@ifundefined{#1}{%
605 \@namedef{#1}{#2}}}
606 % \end{macrocode}
607 % \end{macro}
608 %
609 % \begin{macro}{\newfloat@let}
610 % \changes{v1.1}{2013/04/27}{This macro added}
611 % |\newfloat@let|\marg{macro name}\marg{macro}
612 % \begin{macrocode}
613 \newcommand*\newfloat@let[2]{%
614 \newfloat@ifundefined{#1}{%
615 \expandafter\let\csname #1\endcsname#2}}
616 % \end{macrocode}
617 % \end{macro}
618 %
619 % \begin{macro}{\newfloat@ifundefined}
620 % \changes{v1.1}{2013/04/27}{This macro added}
621 % |\newfloat@ifundefined|\marg{macro name}\marg{code}
622 % \begin{macrocode}
623 \newcommand*\newfloat@ifundefined[2]{%
624 \@ifundefined{#1}{#2}{%
625 \newfloat@Info{%
626 \expandafter\string\csname#1\endcsname\space is already defined}}}
627 % \end{macrocode}
628 % \end{macro}
629 %
630 % \pagebreak[3]
631 % \subsection{\cs{DeclareFloatingEnvironment}}
632 %
633 % \begin{macro}{\DeclareFloatingEnvironment}
634 % \changes{v1.0a}{2011/11/16}{Bugfix: Undefines \cs{fst@}\meta{environment} now}
635 % \changes{v1.1}{2013/04/27}{Revised, only defines stuff yet undefined now}
636 % \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@capitalize} now}
637 % \changes{v1.1}{2015/09/16}{Support of \cs{autodot} (offered by the \KOMAScript\ classes) added}
638 % \changes{v1.1}{2018/03/04}{Usage of \cs{ifdefined} replaced by \cs{@ifundefined} to improve compatibility with the \package{listings} package}
639 % \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added}
640 % \changes{v1.1c}{2019/01/10}{Bugfix: Support of \cs{autodot} fixed}
641 % \changes{v1.1k}{2019/09/01}{Adapted to the \class{beamer} document class}
642 % |\DeclareFloatingEnvironment|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
643 % \begin{macrocode}
644 \newcommand*\DeclareFloatingEnvironment{%
645 \@testopt\@DeclareFloatingEnvironment{}}
646 \@onlypreamble\DeclareFloatingEnvironment
647 % \end{macrocode}
648 % \begin{macrocode}
649 \def\@DeclareFloatingEnvironment[#1]#2{%
650 \newfloat@Info{New float `#2' with options `#1'}%
651 % \end{macrocode}
652 % Define a counter with the same name as the floating environment
653 % \begin{macrocode}
654 \newfloat@ifundefined{c@#2}{\newcounter{#2}}%
655 % \end{macrocode}
656 % Set |\ftype@|\meta{type} which contains the type number for floats of type \meta{type}\par
657 % (See also \url{http://tex.stackexchange.com/q/32359/2574})
658 % \begin{macrocode}
659 \@ifundefined{c@float@type}% from float package
660 {\@ifundefined{c@newflo@tctr}% from memoir document class
661 {\ifdefined\newfloat@ftype \else
662 \newcount\newfloat@ftype
663 \newfloat@ftype=8\relax
664 \fi
665 \expandafter\xdef\csname ftype@#2\endcsname{\the\newfloat@ftype}%
666 \advance\newfloat@ftype\newfloat@ftype}%
667 {\expandafter\edef\csname ftype@#2\endcsname{\the\c@newflo@tctr}%
668 \advance\c@newflo@tctr \c@newflo@tctr}}%
669 {\expandafter\edef\csname ftype@#2\endcsname{\the\value{float@type}}%
670 \addtocounter{float@type}{\value{float@type}}}%
671 % \end{macrocode}
672 % \begin{macrocode}
673 \newfloat@Info{float type `#2'=\@nameuse{ftype@#2}}%
674 % \end{macrocode}
675 % Define |\fnum@|\meta{type}, a macro to generate the figure number for a caption
676 % \begin{macrocode}
677 \newfloat@def{fnum@#2}%
678 {\@nameuse{#2name}\nobreakspace\@nameuse{the#2}%
679 \ifdefined\autodot\expandafter\autodot\fi}%
680 % \end{macrocode}
681 % Define |\|\meta{type}|name| used by |\fnum@|\meta{type} as \meta{type},
682 % but with first letter capitalized
683 % \begin{macrocode}
684 \newfloat@capitalize\newfloat@Type{#2}%
685 \newfloat@let{#2name}{\newfloat@Type}%
686 \newfloat@def{fleg#2}{\@nameuse{#2name}}% legend naming (memoir)
687 % \end{macrocode}
688 % Legend name in ToC (memoir document class)
689 % \begin{macrocode}
690 \newfloat@ifundefined{flegtoc#2}{\@namedef{flegtoc#2}##1{}}%
691 % \end{macrocode}
692 % Define the floating environment\par
693 % If the \class{tufte} document class is loaded,
694 % |\@tufte@float| and |\end@tufte@float| will be used instead of
695 % |\@float|, |\end@float|, |\@dblfloat|, and |\end@dblfloat|.\par
696 % If the \class{beamer} document class is loaded,
697 % |\beamer@float| and |\end@beamer@float| will be used.
698 % \begin{macrocode}
699 \ifcsname @tufte@float\endcsname
700 \newenvironment{#2}[1][htbp]%
701 {\begin{@tufte@float}[{##1}]{#2}{}}%
702 {\end{@tufte@float}}%
703 \newenvironment{#2*}[1][htbp]%
704 {\begin{@tufte@float}[{##1}]{#2}{star}}%
705 {\end{@tufte@float}}%
706 \else
707 \@ifclassloaded{beamer}{%
708 \newenvironment{#2}[1][]{\beamer@float{#2}}{\end@beamer@float}%
709 }{%
710 \newenvironment{#2}{\@float{#2}}{\end@float}%
711 \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}%
712 }%
713 \fi
714 % \end{macrocode}
715 % Define the listing command |\listof|\meta{type}(|e|)|s|
716 % \changes{v1.1}{2013/04/27}{Definition of list hook added}
717 % \begin{macrocode}
718 \newfloat@def{listof#2}{\newfloat@listof{#2}}%
719 \newfloat@def{listof#2s}{\@nameuse{listof#2}}%
720 \newfloat@def{listof#2es}{\@nameuse{listof#2s}}%
721 \newfloat@def{newfloat@listof#2@hook}{}%
722 \ifdefined\l@figure
723 \newfloat@let{l@#2}{\l@figure}%
724 \else
725 \newfloat@def{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}%
726 \fi
727 \edef\newfloat@tempa{List of \newfloat@Type s}%
728 \newfloat@let{list#2name}{\newfloat@tempa}%
729 % \end{macrocode}
730 % We undefine |\fst@|\meta{environment} so the new environment
731 % will not be recognized as defined by the \package{float} package.
732 % (|\fst@|\meta{type} use to hold the float style, see \package{float} package
733 % implementation for details.)
734 % \begin{macrocode}
735 \expandafter\let\csname fst@#2\endcsname\@undefined
736 % \end{macrocode}
737 % Set default parameters
738 % \begin{macrocode}
739 \newfloat@ifundefined{fps@#2}{\newfloat@setplacement{#2}{tbp}}%
740 \newfloat@ifundefined{ext@#2}{\newfloat@setfileext{#2}{lo#2}}%
741 % \end{macrocode}
742 % Apply given options
743 % \begin{macrocode}
744 \newfloat@setoptions*{#2}{#1}%
745 % \end{macrocode}
746 % Announce the new floating environment to other packages
747 % \begin{macrocode}
748 \@expandtwoargs\newfloat@announce{#2}{\@nameuse{ext@#2}}%
749 % \end{macrocode}
750 % Apply the last two optional arguments for setting names
751 % \begin{macrocode}
752 \@ifnextchar[\newfloat@DFE@setname\relax}
753 \@onlypreamble\@DeclareFloatingEnvironment
754 % \end{macrocode}
755 % \begin{macrocode}
756 \def\newfloat@DFE@setname[#1]{%
757 \KV@@newfloat@name{#1}%
758 \@ifnextchar[\newfloat@DFE@setlistname\relax}
759 \@onlypreamble\newfloat@DFE@setname
760 % \end{macrocode}
761 % \begin{macrocode}
762 \def\newfloat@DFE@setlistname[#1]{%
763 \KV@@newfloat@listname{#1}}
764 \@onlypreamble\newfloat@DFE@setlistname
765 % \end{macrocode}
766 % \end{macro}
767 %
768 % \begin{macro}{\newfloat@capitalize}
769 % \changes{v1.1}{2013/11/03}{Code extracted from \cs{DeclareFloatingEnvironment}}
770 % \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@tempa} instead of \cs{@tempa} now}
771 % |\newfloat@capitalize|\marg{command}\marg{name}\\
772 % Defines \meta{command} to \meta{name}, but with first letter capitalized.
773 % \begin{macrocode}
774 \newcommand*\newfloat@capitalize[2]{%
775 \edef\newfloat@tempa{\gdef\noexpand#1{\@car#2\@nil}}%
776 \uppercase\expandafter{\newfloat@tempa}%
777 \edef\newfloat@tempa{%
778 \noexpand\g@addto@macro\noexpand#1{\@cdr#2\@nil}}%
779 \newfloat@tempa}
780 % \end{macrocode}
781 % \end{macro}
782 %
783 % \begin{macro}{\newfloat@listof}
784 % \changes{v1.1}{2013/04/27}{Revised}
785 % \changes{v1.1g}{2019/08/28}{Starred variant added}
786 % \changes{v1.1n}{2021/02/27}{Uses \cs{newfloat@ext} now instead of \cs{ext@xxx}}
787 % |\newfloat@listof|\marg{float type}\\
788 % typesets the list, using |\listoffigure| with patched list name and file extension.
789 % \begin{macrocode}
790 \newcommand*\newfloat@listof[1]{%
791 \@ifstar
792 {\newfloat@list@of{#1}*}%
793 {\newfloat@list@of{#1}\relax}}
794 % \end{macrocode}
795 % \begin{macrocode}
796 \newcommand*\newfloat@list@of[1]{%
797 \@expandtwoargs\newfloat@list@of@{#1}{\newfloat@ext{#1}}}
798 % \end{macrocode}
799 % \begin{macrocode}
800 \newcommand*\newfloat@list@of@[3]{%
801 \begingroup
802 \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname
803 \def\ext@figure{#2}%
804 \let\newfloat@starttoc\@starttoc
805 \def\@starttoc##1{\newfloat@starttoc{#2}}%
806 \let\newfloat@listoftoc\listoftoc
807 \def\listoftoc##1{\newfloat@listoftoc{#2}}%
808 \@nameuse{newfloat@listof#1@hook}%
809 \listoffigures#3%
810 \endgroup}
811 % \end{macrocode}
812 % \end{macro}
813 %
814 % \begin{macro}{\newfloat@setoptions}
815 % |\newfloat@setoptions*|\marg{environment}\marg{options}
816 % \begin{macrocode}
817 \newcommand*\newfloat@setoptions{%
818 \@ifstar
819 {\newfloat@@setoptions\@firstofone}%
820 {\newfloat@@setoptions\@gobble}}
821 % \end{macrocode}
822 % \begin{macrocode}
823 \newcommand*\newfloat@@setoptions[3]{%
824 \let\newfloat@within@value\@undefined
825 \let\newfloat@chapterlistsgaps@value\@undefined
826 #1{\KV@@newfloat@within\newfloat@within@default}% set default value for new floats
827 \def\newfloat@type{#2}%
828 \setkeys{@newfloat}{#3}%
829 \ifx\newfloat@within@value\@undefined \else
830 \newfloat@setoption{within}\newfloat@within@value
831 \fi
832 \ifx\newfloat@chapterlistsgaps@value\@undefined \else
833 \newfloat@setoption{chapterlistsgaps}\newfloat@chapterlistsgaps@value
834 \fi}
835 % \end{macrocode}
836 % \end{macro}
837 %
838 % \begin{macro}{\newfloat@within@default}
839 % The default `within' value.
840 % This one will be used if no option |within=|\meta{counter} is given.
841 % \begin{macrocode}
842 \newcommand*\newfloat@within@default{%
843 \ifcsname c@chapter\endcsname chapter\else none\fi}
844 \@onlypreamble\newfloat@within@default
845 % \end{macrocode}
846 % \end{macro}
847 %
848 % \begin{macro}{\newfloat@setoption}
849 % \changes{v1.1}{2015/09/15}{\cs{@expandtwoargs} replaced by own expansion so the option value do not get expanded anymore}
850 % \changes{v1.1m}{2020/10/11}{Usage of \cs{caption@tempa} replaced by \cs{newfloat@tempa}}
851 % |\newfloat@setoption|\marg{option name}{options}
852 % \begin{macrocode}
853 \newcommand*\newfloat@setoption[1]{%
854 \edef\newfloat@tempa{\noexpand\@nameuse{newfloat@set#1}{\newfloat@type}}%
855 \newfloat@tempa}
856 % \end{macrocode}
857 % \end{macro}
858 %
859 % The available \meta{options} are:
860 % |fileext=|\meta{file extension},
861 % |listname=|\meta{list name},
862 % |name=|\meta{prosa name},
863 % |placement=|\meta{htbp},
864 % |within=|\meta{none,chapter,section}, and
865 % |without|.
866 %
867 % \begin{macro}{\newfloat@setfileext}
868 % |\newfloat@setfileext|\marg{environment}\marg{file extension}
869 % \begin{macrocode}
870 \newcommand*\newfloat@setfileext[2]{%
871 \@namedef{ext@#1}{#2}}
872 % \end{macrocode}
873 % \begin{macrocode}
874 \define@key{@newfloat}{fileext}{%
875 \newfloat@setoption{fileext}{#1}}
876 % \end{macrocode}
877 % \end{macro}
878 %
879 % \begin{macro}{\newfloat@setlistname}
880 % |\newfloat@setlistname|\marg{environment}\marg{list name}
881 % \begin{macrocode}
882 \newcommand*\newfloat@setlistname[2]{%
883 \@namedef{list#1name}{#2}}
884 % \end{macrocode}
885 % \begin{macrocode}
886 \define@key{@newfloat}{listname}{%
887 \newfloat@setoption{listname}{#1}}
888 % \end{macrocode}
889 % \end{macro}
890 %
891 % \begin{macro}{\newfloat@setname}
892 % |\newfloat@setname|\marg{environment}\marg{name}
893 % \begin{macrocode}
894 \newcommand*\newfloat@setname[2]{%
895 \newfloat@@setname{#1}{#2}%
896 \begingroup
897 \ifcsname languagename\endcsname
898 \ifcsname captions\languagename\endcsname
899 \expandafter\g@addto@macro\csname captions\languagename\endcsname
900 {\newfloat@@setname{#1}{#2}}%
901 \fi
902 \fi
903 \endgroup}
904 %%\AtBeginDocument{\let\newfloat@setname\newfloat@@setname}
905 % \end{macrocode}
906 % \begin{macrocode}
907 \newcommand*\newfloat@@setname[2]{%
908 \@namedef{#1name}{#2}}
909 % \end{macrocode}
910 % \begin{macrocode}
911 \define@key{@newfloat}{name}{%
912 \newfloat@setoption{name}{#1}}
913 % \end{macrocode}
914 % \end{macro}
915 %
916 % \begin{macro}{\newfloat@setplacement}
917 % |\newfloat@setplacement|\marg{environment}\marg{float placement}
918 % \begin{macrocode}
919 \newcommand*\newfloat@setplacement[2]{%
920 \@namedef{fps@#1}{#2}}
921 % \end{macrocode}
922 % \begin{macrocode}
923 \define@key{@newfloat}{placement}{%
924 \newfloat@setoption{placement}{#1}}
925 % \end{macrocode}
926 % \end{macro}
927 %
928 % \begin{macro}{\newfloat@setwithin}
929 % |\newfloat@setwithin|\marg{environment}\marg{counter}\par
930 % setup the counter for working ``within'' a given counter.
931 % Furthermore the chapters lists gap will be switched on
932 % (if counter $=$ |chapter|) or off (otherwise).
933 % \begin{macrocode}
934 \newcommand*\newfloat@setwithin[2]{%
935 \ifcsname c@chapter\endcsname
936 \@removefromreset{#1}{chapter}%
937 \fi
938 \@removefromreset{#1}{section}%
939 % \end{macrocode}
940 % \begin{macrocode}
941 \edef\@tempa{#2}%
942 \ifx\@tempa\@empty
943 \def\@tempa{none}%
944 \fi
945 \def\@tempb{none}%
946 \ifx\@tempa\@tempb
947 \ifcsname c@chapter\endcsname
948 \@chapterlistsgap@off{#1}%
949 \fi
950 \newfloat@@setwithin{#1}{}{}%
951 \else
952 \def\@tempb{chapter}%
953 \ifx\@tempa\@tempb
954 \@addtoreset{#1}{chapter}%
955 \@chapterlistsgap@on{#1}%
956 \newfloat@@setwithin{#1}{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}%
957 \else
958 \def\@tempb{section}%
959 \ifx\@tempa\@tempb
960 \@addtoreset{#1}{section}%
961 \ifcsname c@chapter\endcsname
962 \@addtoreset{#1}{chapter}%
963 \@chapterlistsgap@on{#1}%
964 \newfloat@@setwithin{#1}{\thesection.}{\theHsection.}%
965 \else
966 \newfloat@@setwithin{#1}{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}%
967 \fi
968 \else
969 \newfloat@Error{Invalid value `#2' for option `within'}%
970 \fi
971 \fi
972 \fi}
973 % \end{macrocode}
974 % Note: Since the \package{hyperref} package with version $<$ 6.82k defines
975 % |\the|\-|H|\-|figure| and |\the|\-|H|\-|table| with |\new|\-|command|,
976 % |\newfloat@@setwithin| will yield to an error message when using with an
977 % old version of \package{hyperref},
978 % e.g. ``\texttt{LaTeX Error: Command \cs{theHfigure} already defined}''.
979 % \begin{macrocode}
980 \newcommand*\newfloat@@setwithin[3]{%
981 \global\@namedef{the#1}{#2\arabic{#1}}%
982 \global\@namedef{theH#1}{#3\arabic{#1}}}
983 % \end{macrocode}
984 % \begin{macrocode}
985 \define@key{@newfloat}{within}{%
986 \def\newfloat@within@value{#1}}
987 % \end{macrocode}
988 % \end{macro}
989 %
990 % \begin{macro}{\newfloat@setwithout}
991 % |\newfloat@setwithout|\marg{environment}
992 % \begin{macrocode}
993 \newcommand*\newfloat@setwithout[1]{%
994 \newfloat@setwithin{#1}{none}}
995 % \end{macrocode}
996 % \begin{macrocode}
997 \define@key{@newfloat}{without}[]{%
998 \def\newfloat@within@value{none}}
999 % \end{macrocode}
1000 % \end{macro}
1001 %
1002 % \begin{macro}{\newfloat@setchapterlistsgaps}
1003 % |\newfloat@setchapterlistsgaps|\marg{environment}\marg{on/off}
1004 % \begin{macrocode}
1005 \newcommand*\newfloat@setchapterlistsgaps[2]{%
1006 \edef\@tempa{#2}%
1007 \newfloat@setchapterlistsgaps@{off}{off}{#1}%
1008 \newfloat@setchapterlistsgaps@{false}{off}{#1}%
1009 \newfloat@setchapterlistsgaps@{on}{on}{#1}%
1010 \newfloat@setchapterlistsgaps@{true}{on}{#1}%
1011 \ifx\@tempa\newfloat@setchapterlistsgaps@ \else
1012 \newfloat@Error{Invalid value `#2' for option `chapterlistsgaps'}%
1013 \fi}
1014 % \end{macrocode}
1015 % \begin{macrocode}
1016 \newcommand*\newfloat@setchapterlistsgaps@[3]{%
1017 \def\@tempb{#1}%
1018 \ifx\@tempa\@tempb
1019 \newfloat@chapterlistsgap@{#2}{#3}%
1020 \let\@tempa\newfloat@setchapterlistsgaps@
1021 \fi}
1022 % \end{macrocode}
1023 % \begin{macrocode}
1024 \newcommand*\newfloat@chapterlistsgap@[1]{%
1025 \@ifundefined{@chapterlistsgap@#1}%
1026 {\@gobble}%
1027 {\@nameuse{@chapterlistsgap@#1}}}
1028 % \end{macrocode}
1029 % \begin{macrocode}
1030 \define@key{@newfloat}{chapterlistsgaps}{%
1031 \def\newfloat@chapterlistsgaps@value{#1}}
1032 % \end{macrocode}
1033 % \end{macro}
1034 %
1035 % \begin{macro}{\@removefromreset}
1036 % This code was taken from the \package{remreset} package
1037 % which is part of the `carlisle' package bundle.
1038 % (Copyright 1997 David Carlisle)
1039 % \begin{macrocode}
1040 \providecommand*\@removefromreset[2]{{%
1041 \expandafter\let\csname c@#1\endcsname\@removefromreset
1042 \def\@elt##1{%
1043 \expandafter\ifx\csname c@##1\endcsname\@removefromreset
1044 \else
1045 \noexpand\@elt{##1}%
1046 \fi}%
1047 \expandafter\xdef\csname cl@#2\endcsname{%
1048 \csname cl@#2\endcsname}}}
1049 % \end{macrocode}
1050 % \end{macro}
1051 %
1052 % \begin{macro}{\newfloat@announce}
1053 % \changes{v1.1n}{2021/02/27}{Defines \cs{newfloat@env@xxx} now instead of \cs{newfloat@ext@xxx}}
1054 % |\newfloat@announce|\marg{environment name}\marg{list file extension}
1055 % \begin{macrocode}
1056 \newcommand*\newfloat@announce[2]{%
1057 % \end{macrocode}
1058 % \begin{macrocode}
1059 \@cons\newfloat@list{{#1}}%
1060 \@cons\newfloat@@list{{#1}}%
1061 % \end{macrocode}
1062 % \begin{macrocode}
1063 \newfloat@ifundefined{newfloat@env@#2}{%
1064 \@namedef{newfloat@env@#2}{#1}%
1065 % \end{macrocode}
1066 % Support of \package{memoir} document class
1067 % \begin{macrocode}
1068 \ifcsname c@lofdepth\endcsname
1069 \newfloat@ifundefined{c@#2depth}{%
1070 \newcounter{#2depth}%
1071 \setcounter{#2depth}{1}}%
1072 \fi
1073 % \end{macrocode}
1074 % Support of \package{tocbasic} package
1075 % \begin{macrocode}
1076 \ifcsname addtotoclist\endcsname
1077 \addtotoclist[float]{#2}%
1078 \newfloat@def{listof#2name}{\@nameuse{list#1name}}%
1079 \fi
1080 % \end{macrocode}
1081 % \begin{macrocode}
1082 }%
1083 % \end{macrocode}
1084 % Support of \package{titletoc} package
1085 % \begin{macrocode}
1086 \ifcsname contentsuse\endcsname
1087 \contentsuse{#1}{#2}%
1088 \fi
1089 % \end{macrocode}
1090 % \begin{macrocode}
1091 \newfloat@hook{#1}}
1092 \@onlypreamble\newfloat@announce
1093 % \end{macrocode}
1094 % \end{macro}
1095 %
1096 % \begin{macro}{\newfloat@ext}
1097 % \changes{v1.1n}{2021/02/27}{This macro added}
1098 % |\newfloat@ext|\marg{environment}
1099 % expands to the file extension used for the given \meta{environment}.
1100 % \begin{macrocode}
1101 \newcommand*\newfloat@ext[1]{\@nameuse{ext@#1}}
1102 % \end{macrocode}
1103 % \end{macro}
1104 %
1105 % \begin{macro}{\newfloat@@list}
1106 % |\newfloat@@list| is an \cs{@elt}-list containing the floating environments defined
1107 % with |\Declare|\-|Floating|\-|Environment| only.
1108 % \begin{macrocode}
1109 \newcommand*\newfloat@@list{}
1110 % \end{macrocode}
1111 % \end{macro}
1112 %
1113 % \pagebreak[3]
1114 % \subsection{\cs{SetupFloatingEnvironment}}
1115 %
1116 % \begin{macro}{\SetupFloatingEnvironment}
1117 % |\SetupFloatingEnvironment|\marg{environment}\marg{options}
1118 % \begin{macrocode}
1119 \newcommand*\SetupFloatingEnvironment[1]{%
1120 \newfloat@addtolist{#1}%
1121 \newfloat@setoptions{#1}}
1122 % \end{macrocode}
1123 % \end{macro}
1124 %
1125 % \pagebreak[3]
1126 % \subsection{\cs{ForEachFloatingEnvironment}}
1127 %
1128 % \begin{macro}{\ForEachFloatingEnvironment}
1129 % |\ForEachFloatingEnvironment|\marg{code with \#1}\par
1130 % will execute the given code for each (known) floating environment.
1131 % The starred variant will only work for already existing environments,
1132 % i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|.
1133 % \begin{macrocode}
1134 \newcommand*\ForEachFloatingEnvironment{%
1135 \@ifstar
1136 {\newfloat@foreach\@gobble}%
1137 {\newfloat@foreach\@iden}}
1138 % \end{macrocode}
1139 % \begin{macrocode}
1140 \newcommand\newfloat@foreach[2]{%
1141 \def\@elt##1{#2}%
1142 \newfloat@list
1143 \let\@elt\relax
1144 #1{\newfloat@addtohook{#2}}}
1145 % \end{macrocode}
1146 % \end{macro}
1147 %
1148 % \begin{macro}{\newfloat@addtohook}
1149 % |\newfloat@addtohook|\marg{code with \#1}\par
1150 % adds code to the hook called in |\Declare|\-|Floating|\-|Environment|.\par
1151 % Note: We use |\provide|\-|command| instead of |\new|\-|command| here since the
1152 % exact same code is defined for |\For|\-|Each|\-|Caption|\-|Type| offered by
1153 % the \package{caption3} package.
1154 % \begin{macrocode}
1155 \providecommand\newfloat@addtohook[1]{%
1156 \toks@=\expandafter{\newfloat@hook{##1}#1}%
1157 \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
1158 \@tempa}
1159 % \end{macrocode}
1160 % \end{macro}
1161 %
1162 % \begin{macro}{\newfloat@hook}
1163 % Hook used in |\Declare|\-|Floating|\-|Environment|.
1164 % \begin{macrocode}
1165 \providecommand*\newfloat@hook[1]{}
1166 % \end{macrocode}
1167 % \end{macro}
1168 %
1169 % \pagebreak[3]
1170 % \subsection{\cs{PrepareListOf}}
1171 %
1172 % \begin{macro}{\PrepareListOf}
1173 % \changes{v1.1}{2013/04/27}{This macro added}
1174 % |\PrepareListOf|\marg{float type}\marg{code}\\
1175 % adds \meta{code} to the one which prepares typesetting the list,
1176 % just before |\listoffigures|.
1177 % \begin{macrocode}
1178 \newcommand\PrepareListOf[1]{%
1179 \expandafter\g@addto@macro\csname newfloat@listof#1@hook\endcsname}
1180 \@onlypreamble\PrepareListOf
1181 % \end{macrocode}
1182 % \end{macro}
1183 %
1184 % \pagebreak[3]
1185 % \subsection{The list of floating environments}
1186 %
1187 % \begin{macro}{\newfloat@list}
1188 % |\newfloat@list| is an \cs{@elt}-list containing the already existising floating
1189 % environments as well the ones defined with |\Declare|\-|Floating|\-|Environment|.
1190 % \begin{macrocode}
1191 \newcommand*\newfloat@list{}
1192 % \end{macrocode}
1193 % \end{macro}
1194 %
1195 % \begin{macro}{\newfloat@addtolist}
1196 % \changes{v1.0b}{2012/05/18}{Bugfix: Definition of \cs{@ifchapterlistsgap@}\meta{environment} added}
1197 % \changes{v1.1n}{2021/02/27}{Defines \cs{newfloat@env@xxx} now instead of \cs{newfloat@ext@xxx}}
1198 % |\newfloat@addtolist|\marg{environment}
1199 % adds an environment to the list of floating environments.
1200 % \begin{macrocode}
1201 \newcommand*\newfloat@addtolist[1]{%
1202 \newfloat@ifinlist{#1}{}{%
1203 \ifcsname ext@#1\endcsname
1204 \@cons\newfloat@list{{#1}}%
1205 \@namedef{newfloat@env@\@nameuse{ext@#1}}{#1}%
1206 \newfloat@let{@ifchapterlistsgap@#1}{\@iden}%
1207 \else
1208 \newfloat@Error{`#1' does not seem to be a floating environment}%
1209 \fi}}
1210 % \end{macrocode}
1211 % \end{macro}
1212 %
1213 % \begin{macro}{\newfloat@ifinlist}
1214 % |\newfloat@ifinlist|\marg{environment}\marg{yes code}\marg{no code}
1215 % tests if an environment is an element of the list of floating environments.
1216 % \begin{macrocode}
1217 \newcommand*\newfloat@ifinlist[1]{%
1218 \let\next\@secondoftwo
1219 \begingroup
1220 \expandafter\let\csname c@#1\endcsname\newfloat@ifinlist
1221 \def\@elt##1{%
1222 \expandafter\ifx\csname c@##1\endcsname\newfloat@ifinlist
1223 \global\let\next\@firstoftwo
1224 \fi}%
1225 \newfloat@list
1226 \endgroup
1227 \next}
1228 % \end{macrocode}
1229 % \end{macro}
1230 %
1231 % Add |figure| and |table| to the list of floating environments.
1232 % \begin{macrocode}
1233 \ifcsname ext@figure\endcsname
1234 \newfloat@addtolist{figure}
1235 \fi
1236 \ifcsname ext@table\endcsname
1237 \newfloat@addtolist{table}
1238 \fi
1239 % \end{macrocode}
1240 %
1241 % \pagebreak[3]
1242 % \subsection{Chapter lists gaps}
1243 %
1244 % \begin{macrocode}
1245 \ifcsname @chapter\endcsname
1246 % \end{macrocode}
1247 %
1248 % \begin{macro}{\@chapterlistsgap}
1249 % The amount of the chapter lists gap, the default one is |10pt|.
1250 % (This command is already defined in \KOMAScript.)
1251 % \begin{macrocode}
1252 \providecommand*\@chapterlistsgap{10\p@}%
1253 % \end{macrocode}
1254 % If the \package{dgruyter} package is loaded, the default gap is |13pt|.
1255 % \begin{macrocode}
1256 \@ifpackageloaded{dgruyter}{\renewcommand*\@chapterlistsgap{13\p@}}{}%
1257 % \end{macrocode}
1258 % \end{macro}
1259 %
1260 % \begin{macro}{\@addchapterlistsgap}
1261 % |\@addchapterlistsgap|\marg{float type}\marg{file extension}\par
1262 % will add the chapter lists gap for the given float type.
1263 % \begin{macrocode}
1264 \providecommand*\@addchapterlistsgap[2]{%
1265 \@nameuse{@ifchapterlistsgap@#1}{% if switched on
1266 \@@addchapterlistsgap{#1}{#2}}}
1267 % \end{macrocode}
1268 % \begin{macrocode}
1269 \providecommand*\@@addchapterlistsgap[2]{%
1270 \@ifundefined{@addchapterlistsgap@#2}{% only once per extension
1271 \@namedef{@addchapterlistsgap@#2}{#1}%
1272 \@@@addchapterlistsgap{#2}}{}}
1273 % \end{macrocode}
1274 % \begin{macrocode}
1275 \providecommand*\@@@addchapterlistsgap[1]{%
1276 \ifdim \@chapterlistsgap>\z@
1277 \addtocontents{#1}{\protect\addvspace{\@chapterlistsgap}}%
1278 \fi}
1279 % \end{macrocode}
1280 % \end{macro}
1281 %
1282 % \begin{macro}{\@addchapterlistsgaps}
1283 % \changes{v1.0b}{2012/05/18}{Bugfix: Group added to make \cs{@addchapterlistsgap} work correctly}
1284 % \changes{v1.1n}{2021/02/27}{Uses \cs{newfloat@ext} now instead of \cs{ext@xxx}}
1285 % |\@addchapterlistsgaps|\par
1286 % will add the chapter lists gaps for all floating environments in |\newfloat@list|.
1287 % \begin{macrocode}
1288 \providecommand*\@addchapterlistsgaps{%
1289 \begingroup
1290 \def\@elt##1{%
1291 \@expandtwoargs\@addchapterlistsgap{##1}{\newfloat@ext{##1}}}%
1292 \newfloat@list
1293 \endgroup}
1294 % \end{macrocode}
1295 % \end{macro}
1296 %
1297 % \begin{macro}{\@chapterlistsgap@off}
1298 % \changes{v1.1n}{2021/02/27}{Uses \cs{newfloat@ext} now instead of \cs{ext@xxx}}
1299 % |\@chapterlistsgap@off|\marg{float type}\par
1300 % switches the chapter lists gap off for the given float type.
1301 % Since \KOMAScript{} (still) supports |\float@exts| we need to handle
1302 % this locally, too, even if |\unsettoc| is offered by the \package{tocbasic} package.
1303 % (Otherwise our handling could be moved into the |\else| branch.)
1304 % \begin{macrocode}
1305 \providecommand*\@chapterlistsgap@off[1]{%
1306 \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@gobble
1307 \ifcsname unsettoc\endcsname
1308 \@expandtwoargs\unsettoc{\newfloat@ext{#1}}{chapteratlist}%
1309 \fi}
1310 % \end{macrocode}
1311 % \end{macro}
1312 %
1313 % \begin{macro}{\@chapterlistsgap@on}
1314 % \changes{v1.1n}{2021/02/27}{Uses \cs{newfloat@ext} now instead of \cs{ext@xxx}}
1315 % |\@chapterlistsgap@off|\marg{float type}\par
1316 % switches the chapter lists gap on for the given float type.
1317 % \begin{macrocode}
1318 \providecommand*\@chapterlistsgap@on[1]{%
1319 \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden
1320 \ifcsname setuptoc\endcsname
1321 \@expandtwoargs\setuptoc{\newfloat@ext{#1}}{chapteratlist}%
1322 \fi}
1323 % \end{macrocode}
1324 % \end{macro}
1325 %
1326 % \begin{macrocode}
1327 \fi
1328 % \end{macrocode}
1329 %
1330 % \pagebreak[3]
1331 % \subsection{Global options}
1332 %
1333 % \begin{macro}{chapterlistsgap=}
1334 % The |chapterlistsgap=| option sets the vertical skip added to each list when
1335 % starting a new chapter.
1336 % \begin{macrocode}
1337 \define@key{newfloat}{chapterlistsgap}{%
1338 \renewcommand*\@chapterlistsgap{#1}}
1339 % \end{macrocode}
1340 % \end{macro}
1341 %
1342 % \begin{macro}{within=}
1343 % The |within=| option redefines the default value and modifies all
1344 % existing floating environments.
1345 % \begin{macrocode}
1346 \define@key{newfloat}{within}{%
1347 \def\newfloat@within@default{#1}% set new default value
1348 \def\@elt##1{\newfloat@setwithin{##1}{#1}}%
1349 \newfloat@list
1350 \let\@elt\relax}
1351 % \end{macrocode}
1352 % \begin{macrocode}
1353 \define@key{newfloat}{without}[]{%
1354 \KV@newfloat@within{none}}
1355 % \end{macrocode}
1356 % \end{macro}
1357 %
1358 % \begin{macro}{figurename=}
1359 % \begin{macro}{listfigurename=}
1360 % \begin{macro}{figurewithin=}
1361 % We define these options not only for |figure| but for all existing floating environments.
1362 % \begin{macrocode}
1363 \def\@elt#1{%
1364 \define@key{newfloat}{#1name}{%
1365 \newfloat@setname{#1}{##1}}%
1366 \define@key{newfloat}{list#1name}{%
1367 \newfloat@setname{list#1}{##1}}%
1368 \define@key{newfloat}{#1within}{%
1369 \newfloat@setwithin{#1}{##1}}%
1370 \define@key{newfloat}{#1without}[]{%
1371 \newfloat@setwithout{#1}}%
1372 }%
1373 \newfloat@list
1374 \let\@elt\relax
1375 % \end{macrocode}
1376 % \end{macro}
1377 % \end{macro}
1378 % \end{macro}
1379 %
1380 % \begin{macro}{planb=}
1381 % \changes{v1.0b}{2012/05/18}{This option added}
1382 % This option switches the `Plan B' on or off. (default$=$true)
1383 % \begin{macrocode}
1384 \define@key{newfloat}{planb}[true]{%
1385 \def\@tempa{#1}%
1386 \def\@tempb{false}%
1387 \ifx\@tempa\@tempb
1388 \let\newfloat@ifplanb\@gobble
1389 \else
1390 \def\@tempb{true}%
1391 \ifx\@tempa\@tempb
1392 \let\newfloat@ifplanb\@iden
1393 \else
1394 \newfloat@Error{Invalid value `#1' for option `planb'}%
1395 \fi
1396 \fi}
1397 % \end{macrocode}
1398 % \end{macro}
1399 % \begin{macro}{planb-filext=}
1400 % \changes{v1.0b}{2012/05/19}{This option added}
1401 % This option sets the file extension used for `Plan B'.
1402 % (default$=$use the 1st one which seem to fit)
1403 % \begin{macrocode}
1404 \define@key{newfloat}{planb-fileext}{%
1405 \newfloat@Info{Setting Plan B file extension to `#1'}
1406 \xdef\newfloat@addtocontents@ext{#1}}
1407 % \end{macrocode}
1408 % \end{macro}
1409 %
1410 % Process the package options:
1411 % We use |\set|\-|keys| here instead of |\Process|\-|Options|.
1412 % \begin{macrocode}
1413 \let\@tempc\relax
1414 \@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}%
1415 \AtEndOfPackage{\let\@unprocessedoptions\relax}
1416 % \end{macrocode}
1417 %
1418 % \begin{macro}{\newfloatsetup}
1419 % |\newfloatsetup|\marg{options}
1420 % sets global options after loading the package.
1421 % \begin{macrocode}
1422 \newcommand*\newfloatsetup{\setkeys{newfloat}}
1423 % \end{macrocode}
1424 % \end{macro}
1425 %
1426 % \pagebreak[3]
1427 % \subsection{Patching \cs{chapter}}
1428 %
1429 % \begin{macro}{\newfloat@replace@chapter}
1430 % \changes{v1.1f}{2019/08/25}{Parameter \meta{class name} added to macro}
1431 % \changes{v1.1i}{2019/08/31}{Local definition of \cs{if@chapnum} added}
1432 % \changes{v1.1o}{2021/02/27}{Support of the \package{algorithm2e} package added}
1433 % |\newfloat@replace@chapter|\marg{class name}\marg{original code}\marg{replacement code}\par
1434 % tries to patch |\@chapter| so |\@add|\-|chapter|\-|lists|\-|gaps| will be supported.
1435 % It checks for |\Hy@org@chapter|, too, since the original code will be stored here
1436 % if the \package{hyperref} package was loaded.
1437 % \begin{macrocode}
1438 \newcommand\newfloat@replace@chapter[3]{%
1439 \begingroup
1440 \let\if@twocolumn\iffalse
1441 \let\if@mainmatter\iffalse
1442 \let\if@thema\iffalse
1443 \let\if@chapnum\iffalse
1444 \def\@tempa[##1]##2{#2}%
1445 \newfloat@replace@chapter@\@chapter{original}{#1}{#3}%
1446 \newfloat@replace@chapter@\Hy@org@chapter{hyperref}{#1}{#3}%
1447 \newfloat@replace@chapter@\algocf@original@chapter{algorithm2e}{#1}{#3}%
1448 \endgroup}
1449 % \end{macrocode}
1450 % \begin{macrocode}
1451 \newcommand\newfloat@replace@chapter@[4]{%
1452 \ifx\@tempa#1%
1453 \newfloat@InfoNoLine{Document class `#3' detected (#2)}%
1454 \global\def#1[##1]##2{#4}%
1455 \global\let\newfloat@replace@chapter\newfloat@dont@replace@chapter
1456 \global\let\newfloat@replace@chapter@\@gobblefour
1457 \fi}
1458 % \end{macrocode}
1459 % \begin{macrocode}
1460 \newcommand\newfloat@dont@replace@chapter[3]{}
1461 % \end{macrocode}
1462 % \begin{macrocode}
1463 \ifcsname @chapter\endcsname \else
1464 \let\newfloat@replace@chapter\newfloat@dont@replace@chapter
1465 \fi
1466 % \end{macrocode}
1467 % \end{macro}
1468 %
1469 % \pagebreak[3]
1470 % \subsubsection{Standard \LaTeX{} document classes}
1471 %
1472 % \begin{macrocode}
1473 % report.cls [2005/09/16 v1.4f Standard LaTeX document class]
1474 \newfloat@replace@chapter{report}{%
1475 \ifnum \c@secnumdepth >\m@ne
1476 \refstepcounter{chapter}%
1477 \typeout{\@chapapp\space\thechapter.}%
1478 \addcontentsline{toc}{chapter}%
1479 {\protect\numberline{\thechapter}#1}%
1480 \else
1481 \addcontentsline{toc}{chapter}{#1}%
1482 \fi
1483 \chaptermark{#1}%
1484 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1485 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1486 \if@twocolumn
1487 \@topnewpage[\@makechapterhead{#2}]%
1488 \else
1489 \@makechapterhead{#2}%
1490 \@afterheading
1491 \fi
1492 }{%
1493 \ifnum \c@secnumdepth >\m@ne
1494 \refstepcounter{chapter}%
1495 \typeout{\@chapapp\space\thechapter.}%
1496 \addcontentsline{toc}{chapter}%
1497 {\protect\numberline{\thechapter}#1}%
1498 \else
1499 \addcontentsline{toc}{chapter}{#1}%
1500 \fi
1501 \chaptermark{#1}%
1502 \@addchapterlistsgaps
1503 \if@twocolumn
1504 \@topnewpage[\@makechapterhead{#2}]%
1505 \else
1506 \@makechapterhead{#2}%
1507 \@afterheading
1508 \fi}
1509 % \end{macrocode}
1510 %
1511 % \begin{macrocode}
1512 % book.cls [2005/09/16 v1.4f Standard LaTeX document class]
1513 \newfloat@replace@chapter{book}{%
1514 \ifnum \c@secnumdepth >\m@ne
1515 \if@mainmatter
1516 \refstepcounter{chapter}%
1517 \typeout{\@chapapp\space\thechapter.}%
1518 \addcontentsline{toc}{chapter}%
1519 {\protect\numberline{\thechapter}#1}%
1520 \else
1521 \addcontentsline{toc}{chapter}{#1}%
1522 \fi
1523 \else
1524 \addcontentsline{toc}{chapter}{#1}%
1525 \fi
1526 \chaptermark{#1}%
1527 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1528 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1529 \if@twocolumn
1530 \@topnewpage[\@makechapterhead{#2}]%
1531 \else
1532 \@makechapterhead{#2}%
1533 \@afterheading
1534 \fi
1535 }{%
1536 \ifnum \c@secnumdepth >\m@ne
1537 \if@mainmatter
1538 \refstepcounter{chapter}%
1539 \typeout{\@chapapp\space\thechapter.}%
1540 \addcontentsline{toc}{chapter}%
1541 {\protect\numberline{\thechapter}#1}%
1542 \else
1543 \addcontentsline{toc}{chapter}{#1}%
1544 \fi
1545 \else
1546 \addcontentsline{toc}{chapter}{#1}%
1547 \fi
1548 \chaptermark{#1}%
1549 \@addchapterlistsgaps
1550 \if@twocolumn
1551 \@topnewpage[\@makechapterhead{#2}]%
1552 \else
1553 \@makechapterhead{#2}%
1554 \@afterheading
1555 \fi}
1556 % \end{macrocode}
1557 %
1558 % \pagebreak[3]
1559 % \subsubsection{\AmS{} \& \SmF{} document classes}
1560 %
1561 % \begin{macrocode}
1562 % amsbook.cls [2004/08/06 v2.20]
1563 % smfbook.cls [1999/11/15 v1.2f Classe LaTeX pour les monographies editees par la SMF]
1564 \newfloat@replace@chapter{amsbook}{%
1565 \refstepcounter{chapter}%
1566 \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
1567 \else \let\@secnumber\thechapter \fi
1568 \typeout{\chaptername\space\@secnumber}%
1569 \def\@toclevel{0}%
1570 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
1571 \else \@tocwriteb\tocchapter{chapter}{#2}\fi
1572 \chaptermark{#1}%
1573 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1574 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1575 \@makechapterhead{#2}\@afterheading
1576 }{%
1577 \refstepcounter{chapter}%
1578 \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
1579 \else \let\@secnumber\thechapter \fi
1580 \typeout{\chaptername\space\@secnumber}%
1581 \def\@toclevel{0}%
1582 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
1583 \else \@tocwriteb\tocchapter{chapter}{#2}\fi
1584 \chaptermark{#1}%
1585 \@addchapterlistsgaps
1586 \@makechapterhead{#2}\@afterheading}
1587 % \end{macrocode}
1588 %
1589 % \pagebreak[3]
1590 % \subsubsection{\KOMAScript{} document classes}
1591 %
1592 % If a \KOMAScript{} document class or the \package{tocbasic} package is used
1593 % we don't need to patch anything.
1594 % Instead we use |\setup|\-|toc| and |\un|\-|set|\-|toc| to setup the
1595 % chapters gap in |\@chapter|\-|lists|\-|gap@on| and |\@chapter|\-|lists|\-|gap@off|.
1596 % \begin{macrocode}
1597 \@ifpackageloaded{tocbasic}{%
1598 \let\newfloat@replace@chapter\newfloat@dont@replace@chapter}{}
1599 % \end{macrocode}
1600 %
1601 % \pagebreak[3]
1602 % \subsubsection{memoir document classes}
1603 %
1604 % If the \package{memoir} document class is used,
1605 % replacing |\insert|\-|chapter|\-|space| by |\@add|\-|chapter|\-|lists|\-|gaps| is sufficient.
1606 % \begin{macrocode}
1607 \ifcsname insertchapterspace\endcsname
1608 \renewcommand*\insertchapterspace{\@addchapterlistsgaps}
1609 \let\newfloat@replace@chapter\newfloat@dont@replace@chapter
1610 \fi
1611 % \end{macrocode}
1612 %
1613 % \pagebreak[3]
1614 % \subsubsection{NTG document classes}
1615 %
1616 % \begin{macrocode}
1617 % rapport1/3.cls [2004/06/07 v2.1a NTG LaTeX document class]
1618 \newfloat@replace@chapter{rapport}{%
1619 \ifnum \c@secnumdepth >\m@ne
1620 \refstepcounter{chapter}%
1621 \typeout{\@chapapp\space\thechapter.}%
1622 \addcontentsline{toc}{chapter}%
1623 {\protect\numberline{\thechapter}\toc@font0 #1}%
1624 \else
1625 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1626 \fi
1627 \chaptermark{#1}%
1628 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1629 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1630 \if@twocolumn
1631 \@topnewpage[\@makechapterhead{#2}]%
1632 \else
1633 \@makechapterhead{#2}%
1634 \@afterheading
1635 \fi
1636 }{%
1637 \ifnum \c@secnumdepth >\m@ne
1638 \refstepcounter{chapter}%
1639 \typeout{\@chapapp\space\thechapter.}%
1640 \addcontentsline{toc}{chapter}%
1641 {\protect\numberline{\thechapter}\toc@font0 #1}%
1642 \else
1643 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1644 \fi
1645 \chaptermark{#1}%
1646 \@addchapterlistsgaps
1647 \if@twocolumn
1648 \@topnewpage[\@makechapterhead{#2}]%
1649 \else
1650 \@makechapterhead{#2}%
1651 \@afterheading
1652 \fi}
1653 % \end{macrocode}
1654 % \begin{macrocode}
1655 % boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class]
1656 \newfloat@replace@chapter{boek}{%
1657 \ifnum \c@secnumdepth >\m@ne
1658 \if@mainmatter
1659 \refstepcounter{chapter}%
1660 \typeout{\@chapapp\space\thechapter.}%
1661 \addcontentsline{toc}{chapter}%
1662 {\protect\numberline{\thechapter}\toc@font0 #1}%
1663 \else
1664 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1665 \fi
1666 \else
1667 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1668 \fi
1669 \chaptermark{#1}%
1670 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1671 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1672 \if@twocolumn
1673 \@topnewpage[\@makechapterhead{#2}]%
1674 \else
1675 \@makechapterhead{#2}%
1676 \@afterheading
1677 \fi
1678 }{%
1679 \ifnum \c@secnumdepth >\m@ne
1680 \if@mainmatter
1681 \refstepcounter{chapter}%
1682 \typeout{\@chapapp\space\thechapter.}%
1683 \addcontentsline{toc}{chapter}%
1684 {\protect\numberline{\thechapter}\toc@font0 #1}%
1685 \else
1686 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1687 \fi
1688 \else
1689 \addcontentsline{toc}{chapter}{\toc@font0 #1}%
1690 \fi
1691 \chaptermark{#1}%
1692 \@addchapterlistsgaps
1693 \if@twocolumn
1694 \@topnewpage[\@makechapterhead{#2}]%
1695 \else
1696 \@makechapterhead{#2}%
1697 \@afterheading
1698 \fi}
1699 % \end{macrocode}
1700 %
1701 % \pagebreak[3]
1702 % \subsubsection{The thesis document class}
1703 %
1704 % \begin{macrocode}
1705 % thesis.cls [1996/25/01 1.0g LaTeX document class (wm).]
1706 \newfloat@replace@chapter{thesis}{%
1707 \ifnum \c@secnumdepth >\m@ne
1708 \if@mainmatter
1709 \refstepcounter{chapter}%
1710 \typeout{\chaptername\space\thechapter.}
1711 \if@thema
1712 \ifx\@shortauthor\@empty
1713 \addcontentsline{toc}{chapter}{%
1714 \protect\numberline{\thechapter.}#1}%
1715 \else
1716 \addcontentsline{toc}{chapter}{%
1717 \protect\numberline{\thechapter.}%
1718 \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}%
1719 \fi
1720 \else
1721 \addcontentsline{toc}{chapter}{%
1722 \protect\numberline{\thechapter.}#1}%
1723 \fi
1724 \else
1725 \addcontentsline{toc}{chapter}{#1}
1726 \fi
1727 \else
1728 \addcontentsline{toc}{chapter}{#1}
1729 \fi
1730 \chaptermark{#1}
1731 \addtocontents{lof}{\protect\addvspace{10pt}}
1732 \addtocontents{lot}{\protect\addvspace{10pt}}
1733 \if@twocolumn
1734 \@topnewpage[\@makechapterhead{#2}]
1735 \else
1736 \@makechapterhead{#2}
1737 \@afterheading
1738 \fi
1739 }{%
1740 \ifnum \c@secnumdepth >\m@ne
1741 \if@mainmatter
1742 \refstepcounter{chapter}%
1743 \typeout{\chaptername\space\thechapter.}%
1744 \if@thema
1745 \ifx\@shortauthor\@empty
1746 \addcontentsline{toc}{chapter}{%
1747 \protect\numberline{\thechapter.}#1}%
1748 \else
1749 \addcontentsline{toc}{chapter}{%
1750 \protect\numberline{\thechapter.}%
1751 \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}%
1752 \fi
1753 \else
1754 \addcontentsline{toc}{chapter}{%
1755 \protect\numberline{\thechapter.}#1}%
1756 \fi
1757 \else
1758 \addcontentsline{toc}{chapter}{#1}%
1759 \fi
1760 \else
1761 \addcontentsline{toc}{chapter}{#1}%
1762 \fi
1763 \chaptermark{#1}%
1764 \@addchapterlistsgaps
1765 \if@twocolumn
1766 \@topnewpage[\@makechapterhead{#2}]%
1767 \else
1768 \@makechapterhead{#2}%
1769 \@afterheading
1770 \fi}
1771 % \end{macrocode}
1772 %
1773 % \pagebreak[3]
1774 % \subsubsection{The Springer Verlag document classes}
1775 % \changes{v1.1f}{2019/08/25}{Support of \package{svmono} and \package{svmult} document classes added}
1776 %
1777 % \begin{macrocode}
1778 % svmono.cls [2018/06/25 v5.6 Springer Verlag global LaTeX document class for monographs]
1779 % svmult.cls [2018/01/11 v5.5 Springer Verlag global LaTeX document class for multi authored books]
1780 \newfloat@replace@chapter{svmono}{%
1781 \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne
1782 \refstepcounter{chapter}%
1783 \if@mainmatter
1784 \typeout{\@chapapp\space\thechapter.}%
1785 \addcontentsline{toc}{chapter}{\protect
1786 \numberline{\thechapter\thechapterend}#1}%
1787 \else
1788 \addcontentsline{toc}{chapter}{#1}%
1789 \fi
1790 \else
1791 \addcontentsline{toc}{chapter}{#1}%
1792 \fi
1793 \chaptermark{#1}%
1794 \addtocontents{lof}{\protect\addvspace{10\p@}}%
1795 \addtocontents{lot}{\protect\addvspace{10\p@}}%
1796 \if@twocolumn
1797 \@topnewpage[\@makechapterhead{#2}]%
1798 \else
1799 \@makechapterhead{#2}%
1800 \@afterheading
1801 \fi
1802 }{%
1803 \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne
1804 \refstepcounter{chapter}%
1805 \if@mainmatter
1806 \typeout{\@chapapp\space\thechapter.}%
1807 \addcontentsline{toc}{chapter}{\protect
1808 \numberline{\thechapter\thechapterend}#1}%
1809 \else
1810 \addcontentsline{toc}{chapter}{#1}%
1811 \fi
1812 \else
1813 \addcontentsline{toc}{chapter}{#1}%
1814 \fi
1815 \chaptermark{#1}%
1816 \@addchapterlistsgaps
1817 \if@twocolumn
1818 \@topnewpage[\@makechapterhead{#2}]%
1819 \else
1820 \@makechapterhead{#2}%
1821 \@afterheading
1822 \fi}
1823 % \end{macrocode}
1824 %
1825 % \pagebreak[3]
1826 % \subsubsection{The dgruyter package}
1827 % \changes{v1.1j}{2019/08/31}{Extended support of \package{dgruyter} package added}
1828 %
1829 % \begin{macrocode}
1830 % dgruyter.sty [2017/09/19 v2.00 De Gruyter layout]
1831 \newfloat@replace@chapter{dgruyter}{%
1832 \let\thesection\theinchapsection
1833 \let\theequation\theinchapequation
1834 \let\thefigure\theinchapfigure
1835 \let\thetable\theinchaptable
1836 \ifx\bookDOI\@undefined
1837 \else
1838 \@tempcnta\numexpr\componentd@i+\@ne\relax
1839 \xdef\componentd@i{\the\@tempcnta}%
1840 \xdef\@DOI{%
1841 https://doi.org/\bookDOI
1842 -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi
1843 \ifnum\@tempcnta<10 0\fi\componentd@i}%
1844 \fi
1845 \ifnum \c@secnumdepth >\m@ne
1846 \if@mainmatter
1847 \refstepcounter{chapter}%
1848 \typeout{\@chapapp\space\thechapter.}%
1849 \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
1850 \else
1851 \addcontentsline{toc}{schapter}{#1}%
1852 \fi
1853 \else
1854 \addcontentsline{toc}{schapter}{#1}%
1855 \fi
1856 \chaptermark{#1}%
1857 \addtocontents{lof}{\protect\addvspace{13\p@}}%
1858 \addtocontents{lot}{\protect\addvspace{13\p@}}%
1859 \if@twocolumn
1860 \@topnewpage[\@makechapterhead{#2}]%
1861 \else
1862 \@makechapterhead{#2}%
1863 \@afterheading
1864 \fi
1865 }{%
1866 \let\thesection\theinchapsection
1867 \let\theequation\theinchapequation
1868 \let\thefigure\theinchapfigure
1869 \let\thetable\theinchaptable
1870 \ifx\bookDOI\@undefined
1871 \else
1872 \@tempcnta\numexpr\componentd@i+\@ne\relax
1873 \xdef\componentd@i{\the\@tempcnta}%
1874 \xdef\@DOI{%
1875 https://doi.org/\bookDOI
1876 -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi
1877 \ifnum\@tempcnta<10 0\fi\componentd@i}%
1878 \fi
1879 \ifnum \c@secnumdepth >\m@ne
1880 \if@mainmatter
1881 \refstepcounter{chapter}%
1882 \typeout{\@chapapp\space\thechapter.}%
1883 \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
1884 \else
1885 \addcontentsline{toc}{schapter}{#1}%
1886 \fi
1887 \else
1888 \addcontentsline{toc}{schapter}{#1}%
1889 \fi
1890 \chaptermark{#1}%
1891 \@addchapterlistsgaps
1892 \if@twocolumn
1893 \@topnewpage[\@makechapterhead{#2}]%
1894 \else
1895 \@makechapterhead{#2}%
1896 \@afterheading
1897 \fi}
1898 % \end{macrocode}
1899 %
1900 % \pagebreak[3]
1901 % \subsubsection{Compatibility warning}
1902 %
1903 % \begin{macrocode}
1904 \ifx\newfloat@replace@chapter\newfloat@dont@replace@chapter \else
1905 % \end{macrocode}
1906 % If we were not able to patch |\@chapter| an info message is issued
1907 % since we may not be able to support chapter lists gaps then.
1908 % \begin{macrocode}
1909 \newfloat@InfoNoLine{%
1910 Unsupported document class, or \noexpand\@chapter\MessageBreak
1911 was already redefined by another package}
1912 \newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter}
1913 \newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter}
1914 \newfloat@InfoNoLine{\string\algocf@original@chapter\space=\space\meaning\algocf@original@chapter}
1915 % \end{macrocode}
1916 % Plan B: We patch |\add|\-|to|\-|contents| instead, and keep our fingers crossed
1917 % in the hope that this redefinition actually will fit.
1918 % (Note: Since \package{biblatex} patches |\add|\-|to|\-|contents| as well we do
1919 % this using |\At||Begin||Document|.)
1920 % \changes{v1.1f}{2019/08/25}{Plan B will now be done using \cs{AtBeginDocument}}
1921 % \begin{macrocode}
1922 \newfloat@ifplanb{\AtBeginDocument{%
1923 \newfloat@InfoNoLine{Trying Plan B..}%
1924 \let\newfloat@addtocontents@ORI\addtocontents
1925 \long\def\addtocontents#1#2{%
1926 \newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}%
1927 \long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{%
1928 \def\newfloat@tempa{#4}%
1929 \ifx\newfloat@tempa\@empty
1930 \newfloat@addtocontents@ORI{#1}{#2}%
1931 \else
1932 \ifx\newfloat@addtocontents@ext\@undefined
1933 \newfloat@Info{Setting Plan B file extension to `#1'...}%
1934 \xdef\newfloat@addtocontents@ext{#1}%
1935 \fi
1936 \edef\newfloat@tempa{#1}%
1937 \ifx\newfloat@tempa\newfloat@addtocontents@ext
1938 \begingroup
1939 \let\addtocontents\newfloat@addtocontents@ORI
1940 \@addchapterlistsgaps
1941 \endgroup
1942 \fi
1943 \fi}}}
1944 % \end{macrocode}
1945 % \begin{macrocode}
1946 \fi
1947 % \end{macrocode}
1948 %
1949 % \pagebreak[3]
1950 % \subsection{Support of document classes}
1951 %
1952 % \subsubsection{The beamer document class}
1953 %
1954 % \begin{macro}{\beamer@float}
1955 % \changes{v1.1k}{2019/09/01}{This macro added}
1956 % Unfortunately the \class{beamer} document class does not offer
1957 % |\beamer@float| and |\end@beamer@float| (yet), so we have to define them
1958 % for ourself.
1959 % (This code was taken from beamerbaselocalstructure.sty [2019/07/23 v3.56] and adapted.)
1960 % \begin{macrocode}
1961 \ifcsname beamer@float\endcsname \else
1962 % \end{macrocode}
1963 % \begin{macrocode}
1964 \def\beamer@float#1{%
1965 \ifcsname caption@settype\endcsname
1966 \caption@settype{#1}%
1967 \else
1968 \def\@captype{#1}%
1969 \fi
1970 \par\nobreak\begin{center}\nobreak}
1971 % \end{macrocode}
1972 % \begin{macrocode}
1973 \def\end@beamer@float{%
1974 \par\nobreak\end{center}}
1975 % \end{macrocode}
1976 % \begin{macrocode}
1977 \fi
1978 % \end{macrocode}
1979 % \end{macro}
1980 %
1981 % \pagebreak[3]
1982 % \subsection{Support of other packages}
1983 %
1984 % \begin{macro}{\newfloat@IfPackageLoaded}
1985 % \changes{v1.1e}{2019/03/17}{This macro revised}
1986 % \changes{v1.1h}{2019/08/31}{This macro revised again and renamed from \cs{newfloat@ForEachNew} to \cs{newfloat@IfPackageLoaded}}
1987 % |\newfloat@IfPackageLoaded|\marg{package name}\marg{command}\marg{code}
1988 % will execute the given code for every floating environment defined with
1989 % |\Declare|\-|Floating|\-|Environment| if \meta{command} is not defined yet.
1990 % (If \meta{command} is already defined a warning will be issued.)
1991 % This will be tried |\At|\-|Begin|\-|Document| additionally so the affected package could
1992 % be loaded after \thispackage.
1993 % \begin{macrocode}
1994 \newcommand\newfloat@IfPackageLoaded[3]{%
1995 \@ifpackageloaded{#1}{%
1996 \newfloat@@IfPackageLoaded{#1}{#2}{#3}%
1997 }{%
1998 \AtBeginDocument{%
1999 \@ifpackageloaded{#1}{%
2000 \newfloat@@IfPackageLoaded{#1}{#2}{#3}%
2001 }{}}%
2002 }}
2003 \@onlypreamble\newfloat@IfPackageLoaded
2004 % \end{macrocode}
2005 % \begin{macrocode}
2006 \newcommand\newfloat@@IfPackageLoaded[3]{%
2007 \newfloat@InfoNoLine{`#1' package detected}%
2008 % Execute code for every previous \DeclareFloatingEnvironment
2009 \def\@elt##1{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}%
2010 \newfloat@@list
2011 \let\@elt\relax
2012 % Execute code for every future \DeclareFloatingEnvironment
2013 \newfloat@addtohook{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}}
2014 \@onlypreamble\newfloat@@IfPackageLoaded
2015 % \end{macrocode}
2016 % \begin{macrocode}
2017 \newcommand\newfloat@@@IfPackageLoaded[3]{%
2018 \ifcsname#2\endcsname
2019 \newfloat@WarningNoLine{%
2020 Command \@backslashchar#2 already defined.\MessageBreak
2021 (`#1' package support)}%
2022 \else
2023 #3%
2024 \fi}
2025 \@onlypreamble\newfloat@@@IfPackageLoaded
2026 % \end{macrocode}
2027 % \end{macro}
2028 %
2029 % \pagebreak[3]
2030 % \subsubsection{\package{dgruyter}}
2031 %
2032 % The De Gruyter layout package (for preparing books for Walter de Gruyter GmbH)
2033 % is defining |\plist@figure| and |\plist@table|, and expects this to be
2034 % defined for other floating environments as well.
2035 % (This will be used as prefix for the ``List of''.)
2036 % \begin{macrocode}
2037 \newfloat@IfPackageLoaded{dgruyter}{plist@#1}{%
2038 \expandafter\newcommand\csname plist@#1\endcsname{%
2039 \@nameuse{#1name}\space}}
2040 % \end{macrocode}
2041 %
2042 % \pagebreak[3]
2043 % \subsubsection{\package{float}}
2044 %
2045 % If the \package{float} package is used we fill up |\float@exts| with our file
2046 % extensions, too. Since this list will be used for inserting chapters gaps
2047 % we only add the ones which are configured for chapters gaps on.\par
2048 % Note: This has to be done |\At|\-|Begin|\-|Document| so the settings for
2049 % chapter gaps could be changed by the user within the preamble of the document.
2050 % \begin{macrocode}
2051 \AtBeginDocument{%
2052 \ifcsname float@exts\endcsname
2053 \newfloat@@IfPackageLoaded{float}{newfloat@undefined}{%
2054 \@nameuse{@ifchapterlistsgap@#1}{% if switched on
2055 \let\float@do=\relax
2056 \edef\@tempa{%
2057 \noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#1}}}}%
2058 \@tempa}}%
2059 \fi}
2060 % \end{macrocode}
2061 %
2062 % \pagebreak[3]
2063 % \subsubsection{\package{fltpage}}
2064 %
2065 % We define a FP-variant of new floating environments here.
2066 % \begin{macrocode}
2067 \newfloat@IfPackageLoaded{fltpage}{FP#1}{%
2068 \newcounter{FP@#1C}%
2069 \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}
2070 % \end{macrocode}
2071 %
2072 % \pagebreak[3]
2073 % \subsubsection{\package{listings}}
2074 %
2075 % \begin{macro}{\ext@lstlisting}
2076 % Since the \package{listings} package do not define |\ext@lst|\-|listing|
2077 % but we needed it when |Setup|\-|Floating|\-|Environment{lst|\-|listing}{|\ldots|}|
2078 % will be done by the end user, we define it here.
2079 % \begin{macrocode}
2080 \providecommand*\ext@lstlisting{lol}%
2081 % \end{macrocode}
2082 % \end{macro}
2083 %
2084 % \pagebreak[3]
2085 % \subsubsection{\package{rotating}}
2086 %
2087 % We define a sideways-variant of new floating environments here.
2088 % \begin{macrocode}
2089 \newfloat@IfPackageLoaded{rotating}{sideways#1}{%
2090 \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}%
2091 \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}
2092 % \end{macrocode}
2093 %
2094 % \pagebreak[3]
2095 % \subsubsection{\package{sidecap}}
2096 %
2097 % We define a SC-variant of new floating environments here.
2098 % \begin{macro}{\SC@float}
2099 % \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added}
2100 % \begin{macrocode}
2101 \newcommand*\newfloat@For@SC[2]{%
2102 \def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6)
2103 \newenvironment{SC#2}%
2104 {\SC@float[{#1}]{#2}}{\endSC@float}%
2105 \newenvironment{SC#2*}%
2106 {\SC@dblfloat[{#1}]{#2}}{\endSC@dblfloat}}
2107 \@onlypreamble\newfloat@For@SC
2108 % \end{macrocode}
2109 % \begin{macrocode}
2110 \newfloat@IfPackageLoaded{sidecap}{SC#1}{%
2111 \expandafter\newfloat@For@SC\csname SC@#1@vpos\endcsname{#1}}
2112 % \end{macrocode}
2113 % \end{macro}
2114 %
2115 % \pagebreak[3]
2116 % \subsubsection{\package{wrapfig}}
2117 %
2118 % We define a wrap-variant of new floating environments here.
2119 % \begin{macrocode}
2120 \newfloat@IfPackageLoaded{wrapfig}{wrap#1}{%
2121 \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}}
2122 % \end{macrocode}
2123 %
2124 % \iffalse
2125 %</package>
2126 % \fi
2127 %
2128 % \iffalse
2129 % --------------------------------------------------------------------------- %
2130 % \fi
2131 %
2132 % \Finale
2133 %
2134 \endinput
2135