Debian Codegraph @

texmf-dist/source/latex/caption/ltcaption.dtx

raw
1 % \iffalse meta-comment
2 %
3 % This is file `ltcaption.dtx'.
4 %
5 % Copyright (C) 2007-2023 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 "maintained".
18 %
19 % This Current Maintainer of this work is Axel Sommerfeldt.
20 %
21 % This work consists of the files
22 % caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
23 % caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
24 % caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
25 % caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
26 % the derived files
27 % caption.sty, caption-light.sty, caption2.sty, caption3.sty,
28 % caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
29 % caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
30 % caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
31 %
32 % \fi
33 %
34 % \CheckSum{388}
35 %
36 % \iffalse
37 %<*driver>
38 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
39 \ProvidesFile{ltcaption.drv}[2023/07/10 v1.4 This package fixes caption problems with other-than-centered aligned longtables]
40 %
41 \documentclass{captiondoc}
42 \hypersetup{pdfkeywords={LaTeX, package, ltcaption}}
43 %
44 \usepackage{longtable}
45 \makeatletter\let\LT@makecaption@ORI\LT@makecaption\makeatother
46 %
47 \usepackage{ltcaption}[2007/09/01]
48 %\usepackage[LTcapwidthtotable]{fr-longtable}
49 %
50 \begin{document}
51 \DocInput{ltcaption.dtx}
52 \end{document}
53 %</driver>
54 % \fi
55 %
56 % \def\thispackage{the \pkg{ltcaption} package}
57 % \def\Thispackage{The \pkg{ltcaption} package}
58 %
59 % \GetFileInfo{ltcaption.drv}
60 % \let\docdate\filedate
61 % \let\docversion\fileversion
62 % \GetFileInfo{ltcaption.sty}
63 %
64 % \title{\texorpdfstring{\Thispackage\thanks{%^^A
65 % This package has version number \docversion.}}%^^A
66 % {The ltcaption package}}
67 % \author{Axel Sommerfeldt\\
68 % \url{https://gitlab.com/axelsommerfeldt/caption}}
69 % \date{\docdate}
70 % \maketitle
71 %
72 % \begin{abstract}
73 % \centering
74 % \mbox{This package fixes caption problems with other-than-centered aligned longtables.}\\
75 % (solves \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=tools/3387}%^^A
76 % {\LaTeX\ PR \texttt{tools/3387}})
77 % \end{abstract}
78 %
79 % \tableofcontents
80 %
81 % \clearpage
82 % \section{The user interface}
83 %
84 % The content of \cs{caption} in longtables is usually centered to the content of the
85 % longtable itself.
86 % This is sufficient for centered longtables, but for left or right aligned longtables
87 % this results in captions moved into the left or right page margin.
88 %
89 % To solve this problem just include this package \emph{after} the \pkg{longtable}
90 % package\cite{longtable}, e.g.:
91 % \begin{quote}
92 % |\usepackage{longtable,ltcaption}|
93 % \end{quote}
94 % Afterwards the captions of all longtables should be aligned as expected,
95 % even for not-centered longtables.
96 %
97 % \subsection{Further justification}
98 %
99 % \DescribeMacro{\LTcapskip}
100 % This length is controlling the skip between the caption and the contents
101 % below the caption (which is usually the longtable contents if you place
102 % the caption above the longtable), and it can be altered with
103 % |\setlength\LTcapskip{|\ldots|}|.
104 % When \thispackage\ is loaded it will be set to |\abovecaptionskip| which
105 % usually represents the skip between caption and contents in floating
106 % environments.
107 % (Without this package, the \pkg{longtable} package uses |\baselineskip| here.)
108 %
109 % \DescribeMacro{\LTcapleft}
110 % \DescribeMacro{\LTcapright}
111 % You can alter the centering of the caption box (of width |\LTcapwidth|)
112 % by setting the lengths |\LTcapleft| \& |\LTcapright| to appropriate values.
113 % These are set to |\fill| by default, just like the values |\LTleft| \& |\LTright|.
114 %
115 % \DescribeMacro{\LTcapmarginsfalse}
116 % Another option is the usage of the command |\LTcapmarginsfalse| which makes
117 % \thispackage\ using the values |\LTleft| \& |\LTright| instead of
118 % |\LTcapleft| \& |\LTcapright|.
119 %
120 % \emph{Note:}
121 % If \thispackage\ will be used with one of the \pkg{NTG} document
122 % classes\cite{NTGclasses}, |\CaptionLabelFont| \& |\CaptionTextFont| will
123 % not only be used for |figure| \& |table| captions, but for |longtable|
124 % captions as well.
125 %
126 % \emph{Note:}
127 % These lengths \& commands do not work when \thispackage\ is used with one
128 % of the \KOMAScript\ document classes \cls{scrartcl}, \cls{scrreprt}, or \cls{scrbook}~\cite{KOMAScript},
129 % or used with the \cls{memoir} document class~\cite{memoir}.
130 % The \KOMAScript\ or \cls{memoir} settings for captions are used instead.
131 % Same with the \pkg{caption} package which also uses its own options
132 % and settings.
133 %
134 % \subsection{Bonus features}
135 %
136 % \DescribeMacro{\LTcaptype}
137 % As a bonus feature this package patches the \pkg{longtable} package
138 % so |\LTcaptype| will be used internally instead of the fixed caption type
139 % `table'. So for example this code snipped:
140 % \begin{quote}
141 % |\renewcommand\LTcaptype{figure}|\\
142 % |\begin{longtable}{ll}|\\
143 % |\caption{An example longtable}\\|\\
144 % | A & B \\|\\
145 % |\end{longtable}|
146 % \end{quote}
147 % \pagebreak[3]
148 % will result in a longtable like this:
149 % \pagebreak[3]
150 % \setcounter{figure}{6}
151 % \begingroup
152 % \renewcommand\LTcaptype{figure}
153 % \begin{longtable}{l}
154 % \caption{An example longtable}\\
155 % \ldots \\
156 % \end{longtable}
157 % \endgroup
158 %
159 % \DescribeEnv{longtable*}
160 % Another bonus feature is the addition of the environment |longtable*| which
161 % does not increment the |table| counter. (As a consequence, |\caption| is not
162 % available for such longtables, but |\caption*| still is.)
163 %
164 % \pagebreak[3]
165 % \section{Spot the difference}
166 %
167 % \begin{minipage}{\linewidth}
168 % Without \thispackage:
169 % \makeatletter
170 % \let\LT@makecaption\LT@makecaption@ORI
171 % \makeatother
172 %
173 % \iffalse show textwidth \fi
174 % \noindent\rule{\textwidth}{1pt}
175 %
176 % \begin{longtable}[l]{l}
177 % \caption{Left aligned longtable left aligned longtable left aligned
178 % longtable}\\
179 % This is only a test\\
180 % \end{longtable}
181 %
182 % \begin{longtable}[r]{l}
183 % \caption{Right aligned longtable right aligned longtable right aligned
184 % longtable}\\
185 % This is only a test\\
186 % \end{longtable}
187 %
188 % \begin{longtable}[c]{l}
189 % \caption{Centered longtable centered longtable centered longtable
190 % centered longtable}\\
191 % This is only a test\\
192 % \end{longtable}
193 %
194 % \noindent\rule{\textwidth}{1pt}
195 % \end{minipage}
196 %
197 % \bigskip
198 %
199 % \begin{minipage}{\linewidth}
200 % With \thispackage\ (and the default value of |\LTcapwidth|):
201 %
202 % \noindent\rule{\textwidth}{1pt}
203 %
204 % \begin{longtable}[l]{l}
205 % \caption{Left aligned longtable left aligned longtable left aligned
206 % longtable}\\
207 % This is only a test\\
208 % \end{longtable}
209 %
210 % \begin{longtable}[r]{l}
211 % \caption{Right aligned longtable right aligned longtable right aligned
212 % longtable}\\
213 % This is only a test\\
214 % \end{longtable}
215 %
216 % \begin{longtable}[c]{l}
217 % \caption{Centered longtable centered longtable centered longtable
218 % centered longtable}\\
219 % This is only a test\\
220 % \end{longtable}
221 %
222 % \noindent\rule{\textwidth}{1pt}
223 % \end{minipage}
224 %
225 % \bigskip
226 %
227 % \begin{minipage}{\linewidth}
228 % With \thispackage\ and |\LTcapwidth=\linewidth|:
229 % \LTcapwidth=\linewidth
230 %
231 % \noindent\rule{\textwidth}{1pt}
232 %
233 % \begin{longtable}[l]{l}
234 % \caption{Left aligned longtable left aligned longtable
235 % left aligned longtable left aligned longtable}\\
236 % This is only a test\\
237 % \end{longtable}
238 %
239 % \begin{longtable}[r]{l}
240 % \caption{Right aligned longtable right aligned longtable
241 % right aligned longtable right aligned longtable}\\
242 % This is only a test\\
243 % \end{longtable}
244 %
245 % \begin{longtable}[c]{l}
246 % \caption{Centered longtable centered longtable centered longtable
247 % centered longtable}\\
248 % This is only a test\\
249 % \end{longtable}
250 %
251 % \noindent\rule{\textwidth}{1pt}
252 % \end{minipage}
253 %
254 % \bigskip
255 %
256 % \begin{minipage}{\linewidth}
257 % With \thispackage\ and |\LTcapleft=0pt|
258 % or |\LTcapright=0pt|:
259 %
260 % \noindent\rule{\textwidth}{1pt}
261 %
262 % \LTcapleft=0pt\relax
263 % \LTcapright=\fill
264 % \begin{longtable}[l]{l}
265 % \caption{Left aligned longtable left aligned longtable left aligned
266 % longtable}\\
267 % This is only a test\\
268 % \end{longtable}
269 %
270 % \LTcapleft=\fill
271 % \LTcapright=0pt\relax
272 % \begin{longtable}[r]{l}
273 % \caption{Right aligned longtable right aligned longtable right aligned
274 % longtable}\\
275 % This is only a test\\
276 % \end{longtable}
277 %
278 % \noindent\rule{\textwidth}{1pt}
279 % \end{minipage}
280 %
281 % \bigskip
282 %
283 % \begin{minipage}{\linewidth}
284 % With \thispackage\ and |\LTcapleft=\tabcolsep|\\
285 % or |\LTcapright=\tabcolsep|:
286 %
287 % \noindent\rule{\textwidth}{1pt}
288 %
289 % \LTcapleft=\tabcolsep
290 % \LTcapright=\tabcolsep plus 1fill
291 % \begin{longtable}[l]{l}
292 % \caption{Left aligned longtable left aligned longtable left aligned
293 % longtable}\\
294 % This is only a test\\
295 % \end{longtable}
296 %
297 % \LTcapleft=\tabcolsep plus 1fill
298 % \LTcapright=\tabcolsep
299 % \begin{longtable}[r]{l}
300 % \caption{Right aligned longtable right aligned longtable right aligned
301 % longtable}\\
302 % This is only a test\\
303 % \end{longtable}
304 %
305 % \noindent\rule{\textwidth}{1pt}
306 % \end{minipage}
307 %
308 % \bigskip
309 %
310 % \begin{minipage}{\linewidth}
311 % With \thispackage\ and |\LTcapmarginsfalse|:
312 % \LTcapmarginsfalse
313 %
314 % \noindent\rule{\textwidth}{1pt}
315 %
316 % \begin{longtable}[l]{l}
317 % \caption{Left aligned longtable left aligned longtable left aligned
318 % longtable}\\
319 % This is only a test\\
320 % \end{longtable}
321 %
322 % \begin{longtable}[r]{l}
323 % \caption{Right aligned longtable right aligned longtable right aligned
324 % longtable}\\
325 % This is only a test\\
326 % \end{longtable}
327 %
328 % \begin{longtable}[c]{l}
329 % \caption{Centered longtable centered longtable centered longtable
330 % centered longtable}\\
331 % This is only a test\\
332 % \end{longtable}
333 %
334 % \noindent\rule{\textwidth}{1pt}
335 % \end{minipage}
336 %
337 % \iffalse
338 % --------------------------------------------------------------------------- %
339 % \fi
340 %
341 % \StopEventually{%^^A
342 % \pagebreak[3]
343 % \begin{thebibliography}{9}
344 % \bibitem{longtable}
345 % David Carlisle:
346 % \href{http://www.ctan.org/pkg/longtable}%
347 % {\emph{The longtable package}},
348 % 2004/02/01
349 %
350 % \bibitem{NTGclasses}
351 % Victor Eijkhout:
352 % \href{http://www.ctan.org/pkg/ntgclass}%
353 % {\emph{An introduction to the Dutch \LaTeX\ document classes}},
354 % \mbox{3~September~1989}
355 %
356 % \bibitem{KOMAScript}
357 % Markus Kohm \& Jens-Uwe-Morawski:
358 % \href{http://www.ctan.org/pkg/koma-script}%
359 % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},
360 % 2012-07-22
361 %
362 % \bibitem{memoir}
363 % Peter Wilson, maintained by Lars Madsen:
364 % \href{http://www.ctan.org/pkg/koma-script}%
365 % {\emph{The Memoir Class for Configurable Typesetting}},
366 % 2013-05-30
367 %
368 % \bibitem{floatrow}
369 % Olga Lapko:
370 % \href{http://www.ctan.org/pkg/floatrow}%
371 % {\emph{The floatrow package documentation}},
372 % 2007/08/24
373 % \end{thebibliography}
374 % }
375 %
376 % \iffalse
377 % --------------------------------------------------------------------------- %
378 % \fi
379 %
380 % \DoNotIndex{\\,\_,\ ,\@@par}
381 % \DoNotIndex{\@bsphack}
382 % \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
383 % \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
384 % \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
385 % \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
386 % \DoNotIndex{\if@minipage,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
387 % \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
388 % \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
389 % \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
390 % \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
391 % \DoNotIndex{\@testopt}
392 % \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
393 % \DoNotIndex{\p@,\z@}
394 % \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
395 % \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
396 % \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
397 % \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
398 % \DoNotIndex{\fi,\footnotesize,\global}
399 % \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
400 % \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
401 % \DoNotIndex{\ifx,\ignorespaces,\itshape}
402 % \DoNotIndex{\kernel@ifnextchar}
403 % \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
404 % \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
405 % \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
406 % \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
407 % \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
408 % \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
409 % \DoNotIndex{\providecommand,\quad}
410 % \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
411 % \DoNotIndex{\rightskip,\rmfamily}
412 % \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
413 % \DoNotIndex{\small,\string,\space,\strut}
414 % \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
415 % \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
416 % \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
417 % \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
418 % \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
419 % \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
420 % \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
421 % \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
422 %
423 % \iffalse
424 % --------------------------------------------------------------------------- %
425 % \fi
426 %
427 % \setlength{\parskip}{0pt plus 1pt}
428 % \changes{v1.0}{2007/04/15}{First release}
429 % \changes{v1.1}{2007/07/06}{Support of \cs{LTcaptype} added}
430 %
431 % \iffalse
432 % --------------------------------------------------------------------------- %
433 % \fi
434 %
435 % \clearpage
436 % \section{The Implementation}
437 % \iffalse
438 %<*package>
439 % \fi
440 %
441 % \subsection{Identification}
442 %
443 % We need at least \LaTeX2e\ version 1994/12/01.
444 % \begin{macrocode}
445 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
446 % \end{macrocode}
447 %
448 % Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
449 % (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
450 % \begin{macrocode}
451 \providecommand\DeclareRelease[3]{}
452 \providecommand\DeclareCurrentRelease[2]{}
453 % \end{macrocode}
454 %
455 % Declare all supported releases.
456 % \begin{macrocode}
457 \DeclareCurrentRelease{v1}{2007-04-15}
458 % \end{macrocode}
459 %
460 % Identify the current version of the package.
461 % \begin{macrocode}
462 \ProvidesPackage{ltcaption}[2021/01/08 v1.4c longtable captions (AR)]
463 % \end{macrocode}
464 %
465 % \begin{macrocode}
466 \@ifpackageloaded{longtable}{}{%
467 \PackageError{ltcaption}{longtable package not loaded, aborting}{RTFM}}
468 % \end{macrocode}
469 %
470 % \subsection{User interface}
471 %
472 % \begin{macro}{\LTcaptype}
473 % |\LTcaptype| is preset to |table|.
474 % \begin{macrocode}
475 \providecommand*\LTcaptype{table}
476 \providecommand*\ext@table{lot}
477 % \end{macrocode}
478 % \end{macro}
479 %
480 % \begin{macro}{\ext@lstlisting}
481 % Since the \pkg{listings} package do not define |\ext@lstlisting|,
482 % but we needed it when |\renewcommand\LTcaptype{lstlisting}| was done
483 % by the end user, we define it here.
484 % \begin{macrocode}
485 \@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
486 \@ifpackageloaded{listings}{%
487 \providecommand*\ext@lstlisting{lol}}{}}
488 % \end{macrocode}
489 % \end{macro}
490 %
491 % To save \TeX\ memory some stuff will not be defined if the
492 % \pkg{caption} package is loaded.
493 %
494 % \begin{macrocode}
495 \@ifpackageloaded{caption}{}{%
496 % \end{macrocode}
497 %
498 % \changes{v1.1}{2007/04/20}{The skips will not be defined if the
499 % \pkg{caption} package is loaded}
500 %
501 % \begin{macro}{\LTcapskip}
502 % \changes{v1.2}{2007/03/28}{This skip added}
503 % \begin{macrocode}
504 \newskip\LTcapskip \LTcapskip=\abovecaptionskip
505 % \end{macrocode}
506 % \end{macro}
507 %
508 % \begin{macro}{\LTcapleft}
509 % \begin{macro}{\LTcapright}
510 % \begin{macro}{\ifLTcapmargins}
511 % Our skips and the flag belonging to them.\\
512 % (Default: Use these skips (and not |\LTleft| \& |\LTright|.)\par
513 % \begin{macrocode}
514 \newskip\LTcapleft \LTcapleft=\fill
515 \newskip\LTcapright \LTcapright=\fill
516 \newif\ifLTcapmargins \LTcapmarginstrue
517 % \end{macrocode}
518 % \end{macro}
519 % \end{macro}
520 % \end{macro}
521 %
522 % \changes{v1.1}{2007/05/05}{Usage of \cs{CaptionLabelFont} \&
523 % \cs{CaptionTextFont} added}
524 %
525 % \begin{macro}{\CaptionLabelFont}
526 % \begin{macro}{\CaptionTextFont}
527 % These commands are provided by the \pkg{NTG} document classes.
528 % To make this package work with other document classes as well,
529 % we need to define |\Caption|\-|Label|\-|Font| \& |\Caption|\-|Text|\-|Font| here.
530 % \begin{macrocode}
531 \providecommand*\CaptionLabelFont{}
532 \providecommand*\CaptionTextFont{}
533 % \end{macrocode}
534 % \end{macro}
535 % \end{macro}
536 % \begin{macro}{\CaptionLabelSeparator}
537 % \changes{v1.3}{2011/09/12}{This macro added}
538 % Additionally, we define |\Caption|\-|Label|\-|Separator| which is predefined as colon.
539 % \begin{macrocode}
540 \providecommand*\CaptionLabelSeparator{:}
541 % \end{macrocode}
542 % \end{macro}
543 %
544 % \begin{macrocode}
545 }
546 % \end{macrocode}
547 %
548 % \subsection{The longtable patch}
549 %
550 % \begin{macro}{\LT@array}
551 % \changes{v1.1a}{2008/03/21}{Improved redefinition of \cs{refstepcounter} etc.}
552 % \changes{v1.4b}{2020/05/30}{Re-definition of \cs{captionnewline} added}
553 % We insert our stuff into the definition of |\LT@array| here.
554 % Since the \pkg{hyperref} package patches |\LT@array| as well
555 % and since this only works with the original definition of |\LT@array|,
556 % we have to do this after the \pkg{hyperref} package,
557 % i.e. |\AtBeginDocument|.
558 % \begin{macrocode}
559 \@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
560 \let\ltcaption@ORI@LT@array\LT@array
561 \renewcommand*\LT@array{%
562 % \end{macrocode}
563 % We modify |\ref|\-|step|\-|counter| or |\H@ref|\-|step|\-|counter| and
564 % |\hyper@make|\-|current|, so |\LT|\-|cap|\-|type| is used instead of |table|.
565 % \begin{macrocode}
566 \let\caption@LT@refstepcounter\refstepcounter
567 \def\refstepcounter{%
568 \caption@LTtype\caption@LT@refstepcounter}%
569 \let\caption@LT@Hrefstepcounter\H@refstepcounter
570 \def\H@refstepcounter{%
571 \caption@LTtype\caption@LT@Hrefstepcounter}%
572 \let\caption@LT@makecurrent\hyper@makecurrent
573 \def\hyper@makecurrent{%
574 \caption@LTtype\caption@LT@makecurrent}%
575 % \end{macrocode}
576 % We redefine |\lst@@caption| so |\thelstlisting| will
577 % printout its counter, too.
578 % \begin{macrocode}
579 \def\lst@@caption{\relax}%
580 % \end{macrocode}
581 % Re-define |\caption|\-|newline| so |\par| will be used inside longtables instead of |\\|.
582 % \begin{macrocode}
583 \def\captionnewline{\par}%
584 % \end{macrocode}
585 % \begin{macrocode}
586 \ltcaption@ORI@LT@array}}
587 % \end{macrocode}
588 % \begin{macrocode}
589 \newcommand*\caption@LTtype[2]{%
590 \edef\caption@LT@tempa{#2}%
591 \ifx\caption@LT@tempa\caption@LT@table
592 \caption@LT@type#1%
593 \else
594 #1{#2}%
595 \fi}%
596 % \end{macrocode}
597 % \begin{macrocode}
598 \newcommand*\caption@LT@type[1]{%
599 \expandafter#1\expandafter{\LTcaptype}}
600 % \end{macrocode}
601 % \begin{macrocode}
602 \newcommand*\caption@LT@table{table}%
603 % \end{macrocode}
604 % \end{macro}
605 %
606 % \begin{macro}{\LT@c@ption}
607 % \changes{v1.1a}{2008/01/22}{Bugfix: Made it \cs{long}}
608 % \changes{v1.2a}{2011/01/01}{Bugfix: \cs{ignorespaces} added}
609 % The original implementation:
610 % \begin{verbatim}
611 % \def\LT@c@ption#1[#2]#3{%
612 % \LT@makecaption#1\fnum@table{#3}%
613 % \def\@tempa{#2}%
614 % \ifx\@tempa\@empty\else
615 % {\let\\\space
616 % \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
617 % \fi}
618 % \end{verbatim}%^^A
619 % Our implementation simply uses |\LTcaptype| instead of |{table}|:
620 % \begin{macrocode}
621 \long\def\LT@c@ption#1[#2]#3{%
622 \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
623 \LT@listentry\LTcaptype{#2}}
624 % \end{macrocode}
625 % \end{macro}
626 %
627 % \begin{macro}{\LT@makecaption}
628 % \changes{v1.1}{2007/04/20}{\cs{LT@@makecaption} added}
629 % \changes{v1.1}{2007/06/27}{Adapted to the \pkg{floatrow} package by Olga Lapko}
630 % \changes{v1.2}{2007/03/28}{Uses \cs{LTcapskip} instead of \cs{baselineskip} now}
631 % \changes{v1.3}{2011/09/12}{Usage of \cs{CaptionLabelSeparator} added}
632 % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
633 % \smallskip
634 % Original code:
635 % \begin{verbatim}
636 % \def\LT@makecaption#1#2#3{%
637 % \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
638 % % Based on article class "\@makecaption", "#1" is "\@gobble" in star
639 % % form, and "\@firstofone" otherwise.
640 % \sbox\@tempboxa{#1{#2: }#3}%
641 % \ifdim\wd\@tempboxa>\hsize
642 % #1{#2: }#3%
643 % \else
644 % \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
645 % \fi
646 % \endgraf\vskip\baselineskip}%
647 % \hss}}}
648 % \end{verbatim}%^^A
649 % Our code:\footnote{Adapted to the \pkg{floatrow} package by Olga Lapko}
650 % \begin{macrocode}
651 \renewcommand\LT@makecaption[3]{%
652 \LT@@makecaption{%
653 \sbox\@tempboxa{%
654 #1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3}%
655 \ifdim\wd\@tempboxa>\hsize
656 #1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3%
657 \else
658 \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
659 \fi
660 \endgraf\vskip\LTcapskip}}
661 % \end{macrocode}
662 % \begin{macrocode}
663 \newcommand\LT@@makecaption[1]{%
664 \caption@LT@make{\hb@xt@\hsize{%
665 \ifLTcapmargins
666 \hspace\LTcapleft
667 \FBifLTcapwidth{\advance\LTcapwidth-\LTcapleft}%
668 \else
669 \hspace\LTleft
670 \FBifLTcapwidth{\advance\LTcapwidth-\LTleft}%
671 \fi
672 \FBifLTcapwidth{\advance\LTcapwidth-%
673 \ifLTcapmargins\LTcapright\else\LTright\fi}%
674 \parbox[t]\LTcapwidth{#1}%
675 \ifLTcapmargins
676 \hskip\LTcapright
677 \else
678 \hskip\LTright
679 \fi}}}
680 % \end{macrocode}
681 % This one will be usually defined by the \pkg{fr-longtable} package,
682 % which is part of the \pkg{floatrow} package\cite{floatrow}:
683 % \begin{macrocode}
684 \AtBeginDocument{\providecommand*\FBifLTcapwidth[1]{}}
685 % \end{macrocode}
686 % \end{macro}
687 %
688 % \begin{macro}{\caption@LT@make}
689 % Typesets the caption as |\multicolumn|\ldots
690 % \begin{macrocode}
691 \newcommand\caption@LT@make[1]{%
692 \noalign{\caption@LT@config}%
693 % \end{macrocode}
694 % Note: If used with the \pkg{array} package |\caption@LTfmt| needs
695 % to be expanded, therefore we need some |\expandafter| here.
696 % \begin{macrocode}
697 \expandafter\LT@mcol\expandafter\LT@cols\expandafter{\caption@LTfmt}{%
698 \hb@xt@\z@{%
699 \hspace\caption@LTleft
700 \parbox[t]\linewidth{#1}%
701 \hspace\caption@LTright}}}%
702 % \end{macrocode}
703 % \end{macro}
704 %
705 % \begin{macro}{\caption@LT@config}
706 % |\caption@LT@config| analyses |\LTleft| \& |\LTright|
707 % and set |\caption@LTleft| \& |\caption@LTright| accordingly
708 % to the `opposite' values, e.g., |\LTleft=1cm| will result to
709 % |\caption@LTleft=-1cm| and |\LTleft=0pt plus 1fill|
710 % will result to |\caption@LTleft=0pt minus 1fill|.
711 % Furthermore |\caption@LTfmt| is set to the according
712 % multicolumn format; this is far away from being bulletproof
713 % (e.g., a stretch or shrink will always be treated as `fill')
714 % but will hopefully cover all `real' cases.
715 % \begin{macrocode}
716 \newcommand*\caption@LT@config{%
717 % \end{macrocode}
718 % \begin{macrocode}
719 \caption@LT@parse\LTleft\caption@LTleft\caption@ifLTleft
720 \caption@LT@parse\LTright\caption@LTright\caption@ifLTright
721 % \end{macrocode}
722 % \begin{macrocode}
723 \xdef\caption@LTfmt{%
724 @{}\caption@ifLTleft{\caption@ifLTright{c}{r}}{l}@{}}}
725 % \end{macrocode}
726 % \end{macro}
727 %
728 % \iffalse
729 % \def\@defplusminus#1 #2 #3 #4 #5\@nil{%
730 % \def\@plus{#2}\def\@minus{#4}}
731 % \@tempskipa=1pt plus 1pt minus 1pt\relax
732 % \expandafter\@defplusminus\the\@tempskipa\@nil
733 % \fi
734 %
735 % \begin{macro}{\caption@LT@parse}
736 % Parsing of the skip, we collect a |\@fixpart|, a |@pluspart|,
737 % and a |\@minuspart| and make our definitions based on that.
738 % \begin{macrocode}
739 \newcommand*\caption@LT@parse[3]{%
740 % \end{macrocode}
741 % \begin{macrocode}
742 \let\@pluspart\@undefined
743 \let\@minuspart\@undefined
744 \expandafter\caption@LT@parse@\expandafter\@fixpart\the#1 x %
745 % \end{macrocode}
746 % \begin{macrocode}
747 \xdef#2{-\@fixpart
748 \ifx\@minuspart\@undefined\else
749 \space\@plus\space\@minuspart
750 \fi
751 \ifx\@pluspart\@undefined\else
752 \space\@minus\space\@pluspart
753 \fi}%
754 % \end{macrocode}
755 % \changes{v1.1}{2007/04/17}{Made it 5 token shorter}
756 % \begin{macrocode}
757 \let#3\@firstoftwo
758 \ifx\@pluspart\@undefined
759 \ifx\@minuspart\@undefined
760 \let#3\@secondoftwo
761 \fi
762 \fi}
763 % \end{macrocode}
764 % \begin{macrocode}
765 \def\caption@LT@parse@#1#2 {%
766 % \end{macrocode}
767 % Note: |\def\@tempa{#2}\ifx\@tempa\@plus|\ldots would not work here
768 % because of different catcodes.
769 % \begin{macrocode}
770 \edef\@tempa{\@car#2\@nil}%
771 \if p\@tempa
772 \def\next{\caption@LT@parse@\@pluspart}%
773 \else\if m\@tempa
774 \def\next{\caption@LT@parse@\@minuspart}%
775 \else\if x\@tempa
776 \let\next\relax
777 \else
778 \def#1{#2}%
779 \def\next{\caption@LT@parse@ @}%
780 \fi\fi\fi
781 \next}
782 % \end{macrocode}
783 % \end{macro}
784 %
785 % \begin{macro}{\LT@listentry}
786 % \changes{v1.4}{2018/08/26}{This macro added}
787 % \begin{macrocode}
788 \newcommand*\LT@listentry[2]{%
789 \def\@tempa{#2}%
790 \ifx\@tempa\@empty\else
791 {\let\\\space
792 \addcontentsline{\csname ext@#1\endcsname}{#1}%
793 {\protect\numberline{\csname the#1\endcsname}{#2}}}%
794 \fi
795 \ignorespaces}
796 % \end{macrocode}
797 % \end{macro}
798 %
799 % \subsection{The \texttt{longtable*} environment}
800 % \changes{v1.1}{2007/09/01}{Environment \env{longtable*} added}
801 %
802 % \begin{environment}{longtable*}
803 % \changes{v1.1a}{2008/03/21}{Improved redefinition of \cs{refstepcounter} etc.}
804 % \changes{v1.4c}{2021/01/08}{Improved error message if \cs{caption} is used}
805 % A |longtable| environment without reference counter and hyperlink anchors.
806 % \begin{macrocode}
807 \newenvironment{longtable*}{%
808 % \end{macrocode}
809 % We simply supress anything which has to do with reference counters here.
810 % \begin{macrocode}
811 \let\caption@LT@type\@gobble
812 % \end{macrocode}
813 % Unfortunately this is not so easy with |\Hy@raisedlink| (which actually sets
814 % the hyperlink anchor), so we assume that we have to supress the first usage.
815 % \begin{macrocode}
816 \let\caption@LT@raisedlink\Hy@raisedlink
817 \def\Hy@raisedlink{%
818 \let\Hy@raisedlink\caption@LT@raisedlink
819 \@gobble}%
820 % \end{macrocode}
821 % Finally we are redefining |\caption| so the non-starred variant
822 % issues an error.
823 % \begin{macrocode}
824 \let\ltcaption@ORI@LT@c@ption\LT@c@ption
825 \def\LT@c@ption##1[##2]##3{%
826 \ifx##1\@firstofone
827 \PackageError{ltcaption}%
828 {\noexpand\caption is not available in longtable* environment}%
829 {If you do not understand this error, please take a closer
830 look\MessageBreak at the documentation of the `ltcaption'
831 package.\MessageBreak \@ehc}%
832 \else
833 \ltcaption@ORI@LT@c@ption{##1}[{##2}]{##3}%
834 \fi}%
835 % \end{macrocode}
836 % \begin{macrocode}
837 \longtable}%
838 {\endlongtable}
839 % \end{macrocode}
840 % \end{environment}
841 %
842 % \subsection{Adaption for \texorpdfstring{\KOMAScript}{KOMA Script}}
843 %
844 % \begin{macrocode}
845 \@ifundefined{@komalongtablefalse}{}{%
846 \if@komalongtable
847 % \end{macrocode}
848 % \begin{macrocode}
849 \renewcommand\LT@makecaption[3]{%
850 \noalign{%
851 \if@captionabove
852 \vskip\belowcaptionskip
853 \else
854 \vskip\abovecaptionskip
855 \fi
856 }%
857 \caption@LT@make{%
858 \@@makecaption{#1}{#2}{#3}%
859 \endgraf
860 \if@captionabove
861 \vskip\abovecaptionskip
862 \else
863 \vskip\belowcaptionskip
864 \fi
865 }%
866 }%
867 % \end{macrocode}
868 % \begin{macrocode}
869 \let\LT@@makecaption\@undefined
870 % \end{macrocode}
871 % \begin{macrocode}
872 \fi}
873 % \end{macrocode}
874 %
875 % \subsection{Adaption for \texorpdfstring{Memoir}{Memoir}}
876 %
877 % \begin{macrocode}
878 \@ifclassloaded{memoir}{%
879 \@ifundefined{@@makecaption}{}{%
880 \renewcommand\LT@makecaption[3]{%
881 % \noalign{\vskip\abovecaptionskip}%
882 \caption@LT@make{%
883 \let\@memtempa\relax
884 % starred form -> #1 = \@gobble
885 \ifx#1\@gobble
886 \let\@contnfont\@empty
887 \let\@contdelim\@empty
888 \@@makecaption{}{#3}%
889 \else
890 \@@makecaption{#2}{#3}%
891 \fi
892 \endgraf\vskip\belowcaptionskip}}%
893 % \end{macrocode}
894 % \begin{macrocode}
895 \let\LT@@makecaption\@undefined
896 % \end{macrocode}
897 % \begin{macrocode}
898 }}{}
899 % \end{macrocode}
900 %
901 % \iffalse
902 %</package>
903 % \fi
904 %
905 % \iffalse
906 % --------------------------------------------------------------------------- %
907 % \fi
908 %
909 % \Finale
910 %
911 \endinput