summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/caption/caption3.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/caption/caption3.dtx')
-rw-r--r--macros/latex/contrib/caption/caption3.dtx362
1 files changed, 176 insertions, 186 deletions
diff --git a/macros/latex/contrib/caption/caption3.dtx b/macros/latex/contrib/caption/caption3.dtx
index 5011e0d0b3..9f3e21b296 100644
--- a/macros/latex/contrib/caption/caption3.dtx
+++ b/macros/latex/contrib/caption/caption3.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption3.dtx'.
%
-% Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2023 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -31,60 +31,27 @@
%
% \fi
%
-% \CheckSum{3830}
+% \CheckSum{3865}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption3.drv}[2021/01/02 v2.4 Implementation of the caption kernel]
-\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+\ProvidesFile{caption3.drv}[2023/07/10 v2.4 Implementation of the caption kernel]
%\errorcontextlines=3
%
-\documentclass{ltxdoc}
-\setlength\parindent{0pt}
-\setlength\parskip{\smallskipamount}
-%
-\makeatletter % make room for subsections like 2.16.14 in the TOC
-%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
-\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
-\makeatother
-%
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx,courier}
- \usepackage[scaled=0.90]{helvet}
- \addtolength\marginparwidth{15pt}
-\fi
-%
-\usepackage{hypdoc}
-\ifpdf\usepackage{hypdestopt}\fi
-\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
+\documentclass{captiondoc}
+\hypersetup{pdfkeywords={LaTeX, package, caption3}}
%
\usepackage{caption3}[2020/12/22]
%
-\DeclareRobustCommand*\eTeX{\texorpdfstring
- {\leavevmode\hbox{$\varepsilon$}-\TeX}%
- {e-TeX}}
-%
\begin{document}
\DocInput{caption3.dtx}
\end{document}
%</driver>
% \fi
%
-% \def\thispackage{the \package{caption} kernel}
-% \def\Thispackage{The \package{caption} kernel}
-%
-% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-% \let\class\puresf \let\package\puresf
-% \let\cls\puresf \let\pkg\puresf
-% \let\env\purett \let\opt\purett
-%
-% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
-% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
-% \newcommand*\version[2][]{v$#2$}
+% \def\thispackage{the \pkg{caption} kernel}
+% \def\Thispackage{The \pkg{caption} kernel}
%
% \GetFileInfo{caption3.drv}
% \let\docdate\filedate
@@ -113,8 +80,8 @@
% options which can be selected with |\caption|\-|setup|.
% Loading the kernel part do not change the output of a \LaTeX\ document
% -- it just provides functionality which can be used by \LaTeXe\ packages
-% which typesets captions, for example the \package{caption} and
-% \package{subfig} packages.
+% which typesets captions, for example the \pkg{caption} and
+% \pkg{subfig} packages.
% \end{abstract}
%
% \section*{Internal commands}
@@ -124,21 +91,21 @@
% \begin{quote}\begin{tabular}{ll}
% Internal command & Currently used by \\
% \hline
-% |\caption@addcontentsline| & \package{floatrow} \\
-% |\caption@fnun| & \package{floatrow} \\
-% |\caption@getlabel| & \package{subcaption} \\
-% |\caption@gobble| & \package{subcaption} \\
-% |\caption@ifinlist| & \package{floatrow} \\
-% |\caption@iftop| & \package{keyfloat} \\
-% |\caption@make| & \package{subfig} \\
-% |\caption@@make| & \package{floatrow} \\
-% |\caption@setoptions| & \package{floatrow} \\
-% |\caption@setposition| & \package{floatrow} \\
+% |\caption@addcontentsline| & \pkg{floatrow} \\
+% |\caption@fnun| & \pkg{floatrow} \\
+% |\caption@getlabel| & \pkg{subcaption} \\
+% |\caption@gobble| & \pkg{subcaption} \\
+% |\caption@ifinlist| & \pkg{floatrow} \\
+% |\caption@iftop| & \pkg{keyfloat} \\
+% |\caption@make| & \pkg{subfig} \\
+% |\caption@@make| & \pkg{floatrow} \\
+% |\caption@setoptions| & \pkg{floatrow} \\
+% |\caption@setposition| & \pkg{floatrow} \\
% |\caption@switchdefault| & \emph{none} \\
-% |\caption@withoptargs| & \package{subcaption} \\
+% |\caption@withoptargs| & \pkg{subcaption} \\
% \end{tabular}\end{quote}
%
-% If your package wants to use any other internal command of the \package{caption3} package,
+% If your package wants to use any other internal command of the \pkg{caption3} package,
% please write me an e-mail so we can define a proper interface together.
%
% Unfortunately these internal commands are used by other packages and therefore will likely
@@ -147,22 +114,22 @@
% \begin{quote}\begin{tabular}{ll}
% Internal command & Currently used by \\
% \hline
-% |\caption@@@make| & \package{floatrow} \\
-% |\caption@set@bool| & \package{floatrow} \\
-% |\caption@setfont| & \package{floatrow} \\
-% |\caption@setkeys| & \package{floatrow} \\
-% |\caption@setstyle*| & \package{floatrow} \\
+% |\caption@@@make| & \pkg{floatrow} \\
+% |\caption@set@bool| & \pkg{floatrow} \\
+% |\caption@setfont| & \pkg{floatrow} \\
+% |\caption@setkeys| & \pkg{floatrow} \\
+% |\caption@setstyle*| & \pkg{floatrow} \\
% \hline
-% |\caption@hj@|\meta{name} & \package{floatrow} \\
-% |\caption@lsep@|\meta{name} & \package{floatrow} \\
-% |\caption@lsep@default| & \package{babel-hungarian} \\
-% |\caption@sty@|\meta{name} & \package{floatrow} \\
+% |\caption@hj@|\meta{name} & \pkg{floatrow} \\
+% |\caption@lsep@|\meta{name} & \pkg{floatrow} \\
+% |\caption@lsep@default| & \pkg{babel-hungarian} \\
+% |\caption@sty@|\meta{name} & \pkg{floatrow} \\
% \end{tabular}\end{quote}
%
-% Furthermore the \package{floatrow} package uses the undocumented option
+% Furthermore the \pkg{floatrow} package uses the undocumented option
% |position=a| (as abbreviation of |position=auto|).
%
-% The \package{lwarp} package uses a lot of internal commands as well,
+% The \pkg{lwarp} package uses a lot of internal commands as well,
% but we are working on it on the Git branch \texttt{feature/lwarp}:
% \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
%
@@ -226,7 +193,7 @@
% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
%
% \changes{v1.0}{2003/12/20}{Rewritten; many new commands and features}
-% \changes{v1.0c}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
+% \changes{v1.0c}{2004/11/28}{Split into two packages: \pkg{caption} \& \pkg{caption3}}
%
% \iffalse
% --------------------------------------------------------------------------- %
@@ -265,7 +232,7 @@
%
% Identify the current version of the package.
% \begin{macrocode}
-\ProvidesPackage{caption3}[2023/03/12 v2.4 caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2023/07/28 v2.4c caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Generic helpers}
@@ -390,7 +357,7 @@
% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
% \end{quote}
% would expand to |yes|.\par
-% (Note: Since this command is used by the \package{floatrow} package as well
+% (Note: Since this command is used by the \pkg{floatrow} package as well
% its syntax should not change.)
% \begin{macrocode}
\newcommand*\caption@ifinlist{%
@@ -736,7 +703,7 @@
%
% \section{Using the keyval package}
%
-% We need the \package{keyval} package for option handling, so we load it here.\par
+% We need the \pkg{keyval} package for option handling, so we load it here.\par
% \emph{TODO:} Use some recent stuff instead, for example kvdefinekey and kvsetkeys.
% \begin{macrocode}
\RequirePackage{keyval}[1997/11/10]
@@ -1036,7 +1003,7 @@
% |\caption@removefromoptlist|\marg{type}\\
% adds or removes an \meta{type} to the list of unused caption options.
% Note that the catcodes of \meta{type} are sanitized here so removing
-% \meta{type} from the list do not fail when the \package{float} package
+% \meta{type} from the list do not fail when the \pkg{float} package
% is used (since |\float@getstyle| gives a result which tokens have catcode
% 12 $=$ ``other'').
% \begin{macrocode}
@@ -1081,7 +1048,7 @@
% \changes{v2.4}{2022/04/18}{\cs{captionsetup@starfalse} removed}
% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\\
% expands to |\setkeys|\marg{family}\marg{key-values},
-% but lets the error messages not refer to the \package{keyval} package
+% but lets the error messages not refer to the \pkg{keyval} package
% but to the \meta{package} package instead.
% \begin{macrocode}
\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
@@ -1146,7 +1113,7 @@
% processes the given options using the keyval package, so we use this one
% instead of |\Process|\-|Options| offered by \LaTeXe.
% The starred variant does not process the global options.
-% (This code was taken from the \package{hyperref} package\cite{hyperref}
+% (This code was taken from the \pkg{hyperref} package\cite{hyperref}
% \version{6.74} and modified.)
% \begin{macrocode}
\newcommand*\caption@ProcessOptions{%
@@ -1365,7 +1332,7 @@
% to-be-overwritten internal command as argument, so it can be stored (and
% restored later on).
% The main purpose of this command is switching default settings in
-% \package{babel} language packages, e.g.:
+% \pkg{babel} language packages, e.g.:
% \begin{quote}|\caption@switchdefault{labelfont}{\babel@save #1}{sc}|\end{quote}
% \begin{macrocode}
\def\caption@switchdefault#1#2{%
@@ -1413,7 +1380,7 @@
% |\caption@decl@package|\marg{option}\marg{cmd}\oarg{package}\marg{name}\ldots\\
% Helper command to declare a caption package option value which is dependent
% on the existence of a specific package, for example the |font| value
-% |one|\-|half|\-|spacing| which is dependent on the \package{setspace}
+% |one|\-|half|\-|spacing| which is dependent on the \pkg{setspace}
% package.
% \begin{macrocode}
\newcommand*\caption@decl@package[2]{%
@@ -1506,7 +1473,7 @@
% \end{macrocode}
% \end{macro}
%
-% \section{Margin resp. width}
+% \section{Margin or width}
% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
% \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added}
% \changes{v1.2}{2007/11/10}{Option `oneside' added}
@@ -1514,7 +1481,7 @@
% \begin{macro}{\captionmargin}
% |\captionmargin| contains the extra margin used for captions (if different than |0pt|).
% It is just available for user documents to provide compatibility to \version{1.x} of
-% the \package{caption} package where |\set|\-|length\caption|\-|margin{|\ldots|}| was
+% the \pkg{caption} package where |\set|\-|length\caption|\-|margin{|\ldots|}| was
% the way how a caption margin was set.
% \begin{macrocode}
\newdimen\captionmargin
@@ -1584,7 +1551,7 @@
% \changes{v1.1}{2007/08/11}{Starred variant added}
% \changes{v1.1}{2007/08/12}{\cs{setlength}\cs{captionmargin} \& \cs{setlength}\cs{captionmargin@} swapped so `\texttt{margin*=}\cs{captionmargin}' works in singleline options}
% \changes{v1.3}{2010/11/07}{Support for option \opt{calcmargin} added}
-% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionmargin} to \cs{caption@setmargin}; sets \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
+% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionmargin} to \cs{caption@setmargin}; sets \cs{caption@width} or \cs{caption@leftmargin} and \cs{caption@rightmargin} now}
% \changes{v2.3}{2021/01/19}{Only the left or right margin can be set by leaving the other value blank}
% |\caption@setmargin*|\marg{amount}\\
% sets the caption margin to the given \meta{amount}.
@@ -1625,7 +1592,7 @@
% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setwidth} to \cs{setcaptionwidth}}
% \changes{v1.3}{2010/11/07}{Starred variant added}
% \changes{v1.3}{2010/11/07}{Support for option \opt{calcwidth} added}
-% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionwidth} to \cs{caption@setwidth}; sets \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
+% \changes{v2.3}{2021/01/17}{Renamed from \cs{setcaptionwidth} to \cs{caption@setwidth}; sets \cs{caption@width} or \cs{caption@leftmargin} and \cs{caption@rightmargin} now}
% |\caption@setwidth*|\marg{amount}\\
% sets the caption width to the given \meta{amount}.
% \begin{macrocode}
@@ -1752,6 +1719,7 @@
% \changes{v1.1}{2007/09/01}{This macro added}
% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning}}
% \changes{v2.4}{2023/03/12}{The warning refers to \texttt{caption@NUM} instead of \texttt{NUM}}
+% \changes{v2.4a}{2023/03/13}{The warning refers to \texttt{caption NUM} instead of \texttt{caption@NUM}}
% |\caption@pageref|\marg{name}\\
% This command is a modified version of |\page|\-|ref| from \LaTeX2e.
% It will be used inside |\caption@if|\-|odd|\-|page| and |\FP@help|\-|Note|.
@@ -1759,7 +1727,7 @@
\newcommand*\caption@pageref[1]{%
\expandafter\ifx\csname caption@r@#1\endcsname\relax
\G@refundefinedtrue % => 'There are undefined references.'
- \@latex@warning{Reference `caption@#1' on page \thepage \space undefined}%
+ \@latex@warning{Reference `caption #1' on page \thepage \space undefined}%
\else
\expandafter\let\expandafter\caption@thepage\csname caption@r@#1\endcsname
\fi}
@@ -1772,7 +1740,7 @@
% \changes{v2.4}{2023/03/12}{Multiple use for the same counter will be handled correctly}
% Currently this macro uses an own label\ldots ref mechanism,
% but an alternative implementation method would use the
-% \package{refcount} package\cite{refcount} and
+% \pkg{refcount} package\cite{refcount} and
% |\ifodd\get|\-|page|\-|ref|\-|number{|\ldots|}|.
% Maybe we will change that in a later release.
% \Note{This macro re-defines itself so the \texttt{.aux} file will only be used once per group.
@@ -1855,9 +1823,9 @@
{\def\caption@slsty{#2}%
\def\caption@sty{#3}}%
% \end{macrocode}
-% The \package{floatrow} package uses |\@if|\-|undefined{caption@sty@#1}| to
+% The \pkg{floatrow} package uses |\@if|\-|undefined{caption@sty@#1}| to
% determine in |\flrow@set|\-|style| if a caption style is defined or not.
-% Since the \package{floatrow} package is unmaintained we fake the definition
+% Since the \pkg{floatrow} package is unmaintained we fake the definition
% so the test will still work.
% \begin{macrocode}
\@namedef{caption@sty@#1}{\@unused}}
@@ -2033,7 +2001,7 @@
\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
% \end{macrocode}
%
-% `default' usually maps to `none' resp.~`parbox'.
+% `default' usually maps to `none' or `parbox'.
% \begin{macrocode}
\SetCaptionDefault{box}{none}
%\SetCaptionDefault{parbox}{parbox}
@@ -2158,7 +2126,7 @@
{\caption@labelformat@fallback{#1}{#2}}}
% \end{macrocode}
%
-% `default' usually maps to `original' resp. `simple'.
+% `default' usually maps to `original' or `simple'.
% \begin{macrocode}
\SetCaptionDefault{labelformat}{original}
\SetCaptionFallback{labelformat}{simple}
@@ -2211,18 +2179,18 @@
\def\caption@labelsep@name{#2}%
\def\caption@labelsep{#3}}%
% \end{macrocode}
-% Unfortunately |\Declare|\-|Float|\-|Separators| of the \package{floatrow}
+% Unfortunately |\Declare|\-|Float|\-|Separators| of the \pkg{floatrow}
% package mis-uses |\Declare|\-|Caption|\-|Label|\-|Separator| instead of
-% storing the definition on its own. Since the \package{floatrow} package is
+% storing the definition on its own. Since the \pkg{floatrow} package is
% unmaintained we have to store the separator definition inside
-% |\caption@lsep@|\meta{name} for \package{floatrow}, too. (Sigh!)
+% |\caption@lsep@|\meta{name} for \pkg{floatrow}, too. (Sigh!)
% \begin{macrocode}
\@namedef{caption@lsep@#2}{#3}}
% \end{macrocode}
% Since the `default' caption label separator will usually not be defined
% with |\Declare|\-|Caption|\-|Label|\-|Separator|, we need to define
% |\caption@lsep@default| manually.
-% \Note{This definition is used by \package{magyar.ldf} but only needs to be different
+% \Note{This definition is used by \pkg{magyar.ldf} but only needs to be different
% than \cs{caption@lsep} (which is usually undefined).}
% \begin{macrocode}
\newcommand*\caption@lsep@default{\caption@labelseparator@default\caption@labelsep}%
@@ -2290,8 +2258,8 @@
% (taken from \url{https://comp.text.tex.narkive.com/XkJnYryR/figure-without-caption}).
%
% We emulate the behaviour of |\@make|\-|caption| of the base document classes
-% \class{article}, \class{report}, and \class{book} in this regard (in |\caption@@@make|)
-% so these hacks still work if the \package{caption} package is loaded.
+% \cls{article}, \cls{report}, and \cls{book} in this regard (in |\caption@@@make|)
+% so these hacks still work if the \pkg{caption} package is loaded.
%
% These are the label separators used when one or two tokens after the label format
% should be dropped, called `gobble' and `gobbletwo':
@@ -2306,7 +2274,7 @@
% |\captionnewline|\\
% will be used in the caption label separator |new|\-|line|,
% and re-defined for |long|\-|table| environments
-% (in package \package{ltcaption}).
+% (in package \pkg{ltcaption}).
% \begin{macrocode}
\newcommand*\captionnewline{\\\relax}
% \end{macrocode}
@@ -2362,7 +2330,7 @@
% \end{macrocode}
%
% \begin{macro}{\caption@getlabel}
-% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.7}{2015/09/16}{Moved from \pkg{bicaption} package to \pkg{caption3}}
% \changes{v2.0}{2020/08/23}{Syntax changed}
% |\caption@getlabel|\marg{text}\\
% gets the label command out of the given caption text and stores it to
@@ -2403,7 +2371,7 @@
% \end{macro}
%
% \begin{macro}{\caption@clrlabel}
-% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% \changes{v1.7}{2015/09/16}{Moved from \pkg{bicaption} package to \pkg{caption3}}
% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
% \changes{v2.3}{2020/12/26}{Code moved into the new macro \cs{caption@clrlabel}}
% |\caption@clrlabel|\\
@@ -2426,7 +2394,7 @@
% \begin{macro}{\DeclareCaptionFont}
% \changes{v1.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
% \changes{v1.1}{2007/05/07}{Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
-% \changes{v1.8h}{2020/01/03}{Check for \package{ragged2e} package related options added}
+% \changes{v1.8h}{2020/01/03}{Check for \pkg{ragged2e} package related options added}
% \changes{v1.10}{2020/05/10}{Optional argument \opt{package} added}
% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
% \begin{macrocode}
@@ -2559,7 +2527,7 @@
\SetCaptionDefault{textfont}{none}
% \end{macrocode}
%
-% The \package{floatrow} package uses the fonts `footfont` and `@tempa` additionally,
+% The \pkg{floatrow} package uses the fonts `footfont` and `@tempa` additionally,
% so we need to map and define the default value for them, too.
% \begin{macrocode}
\caption@setmapping{footfont}{font}
@@ -2671,10 +2639,10 @@
\newcommand*\DeclareCaptionJustification{%
% \caption@decl@package{justification}{\caption@decl{justification}}} % Because of floatrow it isn't so easy...
% \end{macrocode}
-% Unfortunately the (unmaintained) \package{floatrow} uses the old storage scheme
-% of the \package{caption} package and therefore expects the justification code
+% Unfortunately the (unmaintained) \pkg{floatrow} uses the old storage scheme
+% of the \pkg{caption} package and therefore expects the justification code
% in |\caption@hj@|\meta{name} instead of |\caption@justification@|\meta{name}.
-% For this reason we have to store the code for the \package{floatrow} package
+% For this reason we have to store the code for the \pkg{floatrow} package
% additionally, so |\flrow@FBo|\-|Align| will still work fine.
% \begin{macrocode}
\caption@withoptargs\caption@declare@justification}
@@ -2783,8 +2751,8 @@
%
% These macros handle the right position of the caption.
% Note that the position is actually \emph{not} controlled by the
-% \package{caption3} kernel options, but by the user (or a specific package
-% like the \package{float} package) instead.
+% \pkg{caption3} kernel options, but by the user (or a specific package
+% like the \pkg{float} package) instead.
% The user can put the |\caption| command wherever he likes! So this stuff
% is only to give us a \emph{hint} where to put the right skips, the user
% usually has to take care for himself that this hint actually matches the
@@ -2826,7 +2794,7 @@
% \changes{v2.3}{2021/01/02}{Uses \cs{caption@initposition} additionally}
% |\caption@setposition|\marg{position}\\
% puts |\caption@position| to the right value.
-% (Note: Since this command is used by the \package{floatrow} package as well its syntax should not change.)
+% (Note: Since this command is used by the \pkg{floatrow} package as well its syntax should not change.)
% \begin{macrocode}
\newcommand*\caption@setposition{%
\caption@initposition
@@ -2930,7 +2898,7 @@
% A different solution would be setting the |\space|\-|factor| to something
% not much less than 1000 (for example 994) in |\caption@start| and
% checking this value here by |\ifnum\space|\-|factor=994|.
-% (It's implemented in the \package{threeparttable} package\cite{threeparttable} this way.)
+% (It's implemented in the \pkg{threeparttable} package\cite{threeparttable} this way.)
%
% Another idea would be checking |\@if|\-|mini|\-|page|, but since some packages
% typeset the caption within a simple |\vbox| this does not seem to be a good one.
@@ -3052,7 +3020,7 @@
\DeclareCaptionOption{listformat}{\caption@set{listformat}{#1}}
% \end{macrocode}
%
-% There are seven pre-defined list formats. (The first five were taken from the \package{subfig} package.)
+% There are seven pre-defined list formats. (The first five were taken from the \pkg{subfig} package.)
% \begin{macrocode}
\DeclareCaptionListFormat{empty}{}
\DeclareCaptionListFormat{simple}{#1#2}
@@ -3071,7 +3039,7 @@
% \begin{macro}{\caption@lstfmt}
% \changes{v2.0}{This macro added}
% To provide backward compatibility we still offer \cs{caption@lstfmt}.
-% (\cs{caption@lstfmt} is used in the \package{dgruyter} package.)
+% (\cs{caption@lstfmt} is used in the \pkg{dgruyter} package.)
% \begin{macrocode}
\newcommand*\caption@lstfmt{\caption@listformat}
% \end{macrocode}
@@ -3154,15 +3122,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@ifdocumentclass}
-% Boolean switch which is set if the document class could be detected
-% successfully, i.e. |\caption@document|\-|class| is set to a proper value.
-% (If |\caption@document|\-|class| is already set, this flag will also be set.)
-% \begin{macrocode}
-\caption@setbool{documentclass}{1}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\caption@documentclass}
% \changes{v1.8e}{2018/05/11}{This macro added}
% Determine document class used.
@@ -3217,6 +3176,7 @@
% \LaTeX\ document classes |article|, |report|, or |book|, we assume it's
% either one of them or is compatible to them.
% \begin{macrocode}
+ \def\caption@documentclass{standard}%
\ifx\@makecaption\@undefined
\caption@InfoNoLine{Document class w/o caption stuff detected}%
\else
@@ -3238,24 +3198,41 @@
Unknown document class (or package),\MessageBreak
standard defaults will be used}%
\caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
- \caption@setbool{documentclass}{0}% unknown document class
+ \def\caption@documentclass{unknown}%
\fi
\fi
\fi
\fi
% \end{macrocode}
% \begin{macrocode}
- \let\caption@documentclass\@empty % don't load adaption code later on
}}}}}}}%
}{}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@ifdocumentclass}
+% \changes{v2.4b}{2023/03/14}{This macro redefined}
+% |\caption@ifdocumentclass|\marg{name}\marg{yes-code}\marg{no-code}\\
+% expands the given \meta{yes-code} if |\caption@document|\-|class| matches the given \meta{name}.
+% Otherwise the \meta{no-code} is expanded.
+% \begin{macrocode}
+\newcommand*\caption@ifdocumentclass[1]{%
+ \begingroup
+ \edef\caption@tempa{\caption@documentclass}%
+ \edef\caption@tempb{#1}%
+ \ifx\caption@tempa\caption@tempb
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\AtCaptionPackage}
% \changes{v2.0}{2018/05/14}{This macro added}
% |\AtCaptionPackage|\marg{code}\\
% can be used by the document class adaption packages to execute extra code
-% if the \package{caption} package is loaded (later on).
+% if the \pkg{caption} package is loaded (later on).
% This code will by applied right before the package options are evaluated.
% \begin{macrocode}
\newcommand*\AtCaptionPackage{%
@@ -3272,7 +3249,7 @@
% \changes{v2.1}{2020/09/12}{This macro added}
% |\AfterCaptionPackage|\marg{code}\\
% can be used by the document class adaption packages to execute extra code
-% if the \package{caption} package is loaded (later on).
+% if the \pkg{caption} package is loaded (later on).
% This code will by applied at the very end.
% \begin{macrocode}
\newcommand*\AfterCaptionPackage{%
@@ -3308,9 +3285,9 @@
% \end{macro}
%
% \subsection{The arabic \& farsi babel option}
-% \changes{v1.8}{2018/05/20}{\package{arabic} babel support added}
-% \changes{v2.0}{2020/08/02}{\package{arabic} babel support updated}
-% \changes{v2.0}{2020/08/02}{\package{farsi} babel support added}
+% \changes{v1.8}{2018/05/20}{\pkg{arabic} babel support added}
+% \changes{v2.0}{2020/08/02}{\pkg{arabic} babel support updated}
+% \changes{v2.0}{2020/08/02}{\pkg{farsi} babel support added}
%
% \begin{macrocode}
\DeclareCaptionLabelSeparator{arabi}{\if@rl\space\fi: }
@@ -3357,8 +3334,8 @@
% \end{macrocode}
%
% \subsection{The babel-french package}
-% \changes{v1.1}{2006/05/14}{\package{frenchb} babel support added}
-% \changes{v2.0}{2020/08/01}{\package{french} babel support updated}
+% \changes{v1.1}{2006/05/14}{\pkg{frenchb} babel support added}
+% \changes{v2.0}{2020/08/01}{\pkg{french} babel support updated}
%
% We provide a `french' caption label separator.
% |\caption@french@label|\-|separator| will be defined later on,
@@ -3384,7 +3361,7 @@
\caption@IfBabelFrench{%
% \end{macrocode}
%
-% The \package{babel-french} package uses |\Caption|\-|Separator| as label separator.
+% The \pkg{babel-french} package uses |\Caption|\-|Separator| as label separator.
%
% \begin{macrocode}
\providecommand\caption@french@labelseparator{\CaptionSeparator}%
@@ -3426,8 +3403,8 @@
% \end{macrocode}
%
% \subsection{The frenchle \& frenchpro package}
-% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
-% \changes{v2.0}{2020/08/01}{\package{frenchle/pro} package support updated}
+% \changes{v1.1}{2006/05/14}{\pkg{frenchle/pro} package support added}
+% \changes{v2.0}{2020/08/01}{\pkg{frenchle/pro} package support updated}
%
% \begin{macro}{\caption@IfFrenchLe}
% |\caption@IfFrenchLe|\marg{yes-code}\marg{no-code}
@@ -3445,7 +3422,7 @@
\caption@IfFrenchLe{%
% \end{macrocode}
%
-% The \package{frenchle} package uses |\caption|\-|separator| plus |\space| as label separator.
+% The \pkg{frenchle} package uses |\caption|\-|separator| plus |\space| as label separator.
%
% \begin{macrocode}
\providecommand\caption@french@labelseparator{\captionseparator\space}%
@@ -3465,7 +3442,7 @@
\caption@restoredefault{labelfont}{\caption@original@labelfont}}%
% \end{macrocode}
%
-% Since the \package{frenchle} package overwrites |\caption|\-|font| and |\caption|\-|label|\-|font|
+% Since the \pkg{frenchle} package overwrites |\caption|\-|font| and |\caption|\-|label|\-|font|
% (within |\GOfrench|) we need to save them beforehand and restore them afterwards.
%
% \begin{macrocode}
@@ -3482,10 +3459,10 @@
% \end{macrocode}
%
% \subsection{The babel-hungarian package}
-% \changes{v1.3}{2009/03/29}{\package{magyar} babel support added}
-% \changes{v1.3a}{2011/08/12}{\package{magyar} babel support revised}
-% \changes{v1.8b}{2018/08/26}{\package{magyar} babel support revised}
-% \changes{v2.0}{2020/08/03}{\package{magyar} babel support updated}
+% \changes{v1.3}{2009/03/29}{\pkg{magyar} babel support added}
+% \changes{v1.3a}{2011/08/12}{\pkg{magyar} babel support revised}
+% \changes{v1.8b}{2018/08/26}{\pkg{magyar} babel support revised}
+% \changes{v2.0}{2020/08/03}{\pkg{magyar} babel support updated}
%
% \begin{macrocode}
\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
@@ -3662,8 +3639,8 @@
% \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption@usepackage}}
% \changes{v2.0}{2020/07/27}{This macro revised}
% |\caption@newfloat|\marg{option}\marg{value}\marg{code}\\
-% loads the \package{newfloat} package and executes the given code afterwards.
-% (Note: Since the package might use the crappy \package{keyval}
+% loads the \pkg{newfloat} package and executes the given code afterwards.
+% (Note: Since the package might use the crappy \pkg{keyval}
% package, too, we need to save \& restore some macros here, otherwise this
% recursion won't work properly.)
% \begin{macrocode}
@@ -3703,10 +3680,10 @@
% \changes{v1.2}{2007/11/18}{After-preamble variant added}
% \changes{v1.2a}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
% \changes{v1.2b}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
-% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \pkg{newfloat} package}
% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
% |\caption@SetName|\marg{float}\marg{name}\\
-% loads the \package{newfloat} package and uses |\newfloat@set|\-|name|.
+% loads the \pkg{newfloat} package and uses |\newfloat@set|\-|name|.
% \begin{macrocode}
\newcommand*\caption@SetName[2]{%
\caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
@@ -3740,10 +3717,10 @@
%
% \begin{macro}{\caption@within}
% \changes{v1.2}{2007/12/21}{This macro added}
-% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \pkg{newfloat} package}
% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
% |\caption@within|\marg{float}\marg{value}\\
-% loads the \package{newfloat} package and uses |\newfloat@set|\-|within|.
+% loads the \pkg{newfloat} package and uses |\newfloat@set|\-|within|.
% \begin{macrocode}
\newcommand*\caption@within[2]{%
\caption@newfloat{#1within=#2}{\newfloat@setwithin{#1}{#2}}}
@@ -3761,12 +3738,12 @@
% \end{macrocode}
%
% \subsection{The ragged2e package}
-% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
-% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
-% \changes{v1.9}{2020/05/05}{Enhanced \package{ragged2e} package support}
-% \changes{v1.10}{2020/05/10}{Revised \package{ragged2e} package support}
+% \changes{v1.0b}{2004/05/16}{Improved \pkg{ragged2e} package support}
+% \changes{v1.8h}{2020/01/03}{Revised \pkg{ragged2e} package support}
+% \changes{v1.9}{2020/05/05}{Enhanced \pkg{ragged2e} package support}
+% \changes{v1.10}{2020/05/10}{Revised \pkg{ragged2e} package support}
%
-% We support the upper-case commands offered by the \package{ragged2e}
+% We support the upper-case commands offered by the \pkg{ragged2e}
% package.
% \begin{macrocode}
\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
@@ -3776,17 +3753,17 @@
% \end{macrocode}
%
% \subsection{The sansmath package}
-% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
-% \changes{v1.10}{2020/05/10}{\package{sansmath} package support revised}
+% \changes{v1.3}{2011/01/01}{\pkg{sansmath} package support added}
+% \changes{v1.10}{2020/05/10}{\pkg{sansmath} package support revised}
%
% \begin{macrocode}
\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
% \end{macrocode}
%
% \subsection{The setspace package}
-% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
-% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
-% \changes{v2.3}{2021/11/20}{The font option \opt{stretch} does not require the \package{setspace} package anymore}
+% \changes{v1.0n}{2007/04/02}{\pkg{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{\pkg{setspace} package support revised}
+% \changes{v2.3}{2021/11/20}{The font option \opt{stretch} does not require the \pkg{setspace} package anymore}
%
% \begin{macrocode}
\DeclareCaptionFont{singlespacing}{%
@@ -3804,13 +3781,13 @@
% \end{macrocode}
%
% \subsection{The subfig package}
-% \changes{v1.1}{2007/07/07}{Adaptions to the \package{subfig} package added}
-% \changes{v1.4a}{2011/11/01}{Test for the \package{subfig} package revised}
+% \changes{v1.1}{2007/07/07}{Adaptions to the \pkg{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Test for the \pkg{subfig} package revised}
% \changes{v2.0a}{2020/09/07}{Re-definition of \cs{sf@ifpositiontop} added}
%
-% Since the \package{subfig} package is not maintained anymore,
+% Since the \pkg{subfig} package is not maintained anymore,
% we have to make adaptions to \thispackage~\version{1.1} here.
-% Please note that we only support the version $1.3$ of the \package{subfig} package,
+% Please note that we only support the version $1.3$ of the \pkg{subfig} package,
% so older versions do not work with this version of \thispackage, and newer
% versions are expected to be adapted.
%
@@ -3876,7 +3853,7 @@
% \end{macrocode}
% \end{macro}
%
-% Make the \package{subfig} package documentation compile.
+% Make the \pkg{subfig} package documentation compile.
% \begin{macrocode}
\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
@@ -3892,8 +3869,8 @@
% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} added}
% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
-% \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
-% \changes{v1.8}{2018/09/06}{Adapted to the \package{chkfloat} package}
+% \changes{v1.7}{2015/09/20}{Unfortunately \pkg{subfig} defines and uses \cs{caption@lstfmt} as well, so I replaced the third argument with \cs{captionlisttype}}
+% \changes{v1.8}{2018/09/06}{Adapted to the \pkg{chkfloat} package}
% \changes{v2.3}{2021/01/06}{Usage of \cs{p@xxx} and \cs{thexxx} replaced by \cs{caption@p} and \cs{caption@the}}
% |\caption@addcontentsline|\marg{type}\marg{list entry}\\
% makes an entry in the list-of-whatever, if requested, i.e.~the argument
@@ -3974,7 +3951,7 @@
% \begin{macro}{\caption@belowskip}
% \changes{v2.0}{2020/08/23}{This macro moved from package to kernel}
% |\caption@aboveskip| and |\caption@belowskip|\\
-% typeset the skip above resp.~below the caption.
+% typeset the skip above or below the caption.
% \begin{macrocode}
\newcommand*\caption@aboveskip{%
\vskip\abovecaptionskip}
@@ -4007,7 +3984,7 @@
%
% \begin{macro}{\caption@setfnum}
% \changes{v1.1}{2007/03/10}{This macro added}
-% \changes{v2.0}{2020/08/03}{Adapted to \package{caption3} v2.0}
+% \changes{v2.0}{2020/08/03}{Adapted to \pkg{caption3} v2.0}
% \changes{v2.3}{2022/01/05}{Definition moved from package to kernel}
% |\caption@setfnum|\marg{type}\\
% stores the original definition of |\fnum@|\meta{type} in |\caption@fnum@|\meta{type}
@@ -4059,7 +4036,7 @@
%
% \begin{macro}{\caption@@make}
% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-05: \cs{ifdim}\cs{captionindent=}\cs{z@} added}
-% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of \cs{captionmargin} resp. \cs{captionwidth}; check for \cs{z@} added}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-10-26: Use \cs{@tempdima} instead of \cs{captionmargin} or \cs{captionwidth}; check for \cs{z@} added}
% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{hskip}\cs{captionmargin} to the end of caption added}
% \changes{v1.0c}{2005/02/12}{Bugfix: \cs{strut} moved from here to \cs{caption@@@make}}
% \changes{v1.0c}{2005/02/12}{Single-line-check moved up so it can affect margins now}
@@ -4077,7 +4054,7 @@
% \changes{v1.5}{2012/03/15}{Uses \cs{caption@tempdima} instead of \cs{@tempdima}}
% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption@calcmargin}}
% \changes{v1.6}{2013/05/01}{Usage of \cs{caption@box} added}
-% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
+% \changes{v1.7}{2016/01/31}{Adapted to the \pkg{bicaption} package}
% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
% \changes{v2.3}{2021/01/16}{Some code encapsulated as \cs{caption@make@leftmargin}, \cs{caption@make@parbox}, \cs{caption@make@indention}, and \cs{caption@make@rightmargin}}
% |\caption@@make|\marg{caption label}\marg{caption text}
@@ -4169,7 +4146,7 @@
% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), use \cs{linewidth} instead of \cs{hsize}}
% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
-% \changes{v2.3}{2021/01/17}{Uses \cs{caption@width} resp.~\cs{caption@leftmargin} and \cs{caption@rightmargin} now}
+% \changes{v2.3}{2021/01/17}{Uses \cs{caption@width} or \cs{caption@leftmargin} and \cs{caption@rightmargin} now}
% |\caption@calcmargin|\\
% calculates |\caption|\-|@left|\-|margin|, |\caption|\-|@width|, and |\caption|\-|@right|\-|margin|,
% so all three contain valid values afterwards.
@@ -4317,7 +4294,7 @@
% \changes{v1.0b}{2004/05/16}{Redefinition of \cs{label} \& \cs{@footnotetext} added}
% \changes{v1.0b}{2004/05/16}{Redefine \cs{stepcounter} instead of \cs{footnote(mark)}}
% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption@justification}\cs{relax} added}
-% \changes{v1.0f}{2005/07/09}{Support of \package{endnotes} package added}
+% \changes{v1.0f}{2005/07/09}{Support of \pkg{endnotes} package added}
% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@justification}\cs{relax} moved to \cs{caption@slc}}
% \changes{v1.1}{2007/06/13}{Redefinition of \cs{(H@)refstepcounter} added}
% \changes{v1.1}{2007/08/12}{Redefinition of \cs{label} improved}
@@ -4329,12 +4306,20 @@
% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
% \changes{v2.3}{2021/07/03}{Redefinition of \cs{footnote} and \cs{endnote} stuff revised}
+% \changes{v2.4c}{2023/07/28}{Redefinition of \cs{index} and \cs{glossary} added}
+% \changes{v2.4c}{2023/07/28}{Application of code defined via \cs{GetTitleStringDisableCommands} added}
% |\caption@prepareslc|\\
% re-defines anything which could disturb the single-line-check.
% \begin{macrocode}
\providecommand*\caption@prepareslc{}
\AtCaptionSingleLineCheck{%
+ \let\caption@protect\protect
+ \caption@ifdefined\GTS@DisablePredefinedCmds\GTS@DisablePredefinedCmds\relax
+% \end{macrocode}
+% \begin{macrocode}
\let\label\caption@gobble
+ \let\index\caption@gobble
+ \let\glossary\caption@gobble
\let\hypertarget\@gobbletwo
% \end{macrocode}
% We re-define \cs{footnote} so
@@ -4349,7 +4334,7 @@
\let\footnotetext\caption@footnotetext
\let\@footnotetext\@gobble
% \end{macrocode}
-% Adaption to the \package{hyperref} package
+% Adaption to the \pkg{hyperref} package
% \begin{macrocode}
\let\H@@footnotetext\@gobble
\let\H@@mpfootnotetext\@gobble
@@ -4357,7 +4342,7 @@
{\let\@footnotemark\H@@footnotemark}%
{}%
% \end{macrocode}
-% Adaption to the \package{tablefootnote} package
+% Adaption to the \pkg{tablefootnote} package
% \begin{macrocode}
\let\tablefootnote\caption@footnote
% \end{macrocode}
@@ -4368,22 +4353,27 @@
\let\endnotetext\caption@endnotetext
\let\@endnotetext\@gobble
% \end{macrocode}
-% Adaption to the \package{acronym} package\par
+% Adaption to the \pkg{acronym} package\par
% See also \url{https://tex.stackexchange.com/questions/428788}
% \begin{macrocode}
\let\acused\@gobble
\let\AC@placelabel\@gobble
% \end{macrocode}
-% Adaption to the \package{glossaries} package.\par
+% Adaption to the \pkg{glossaries} package\par
% Please note that while this adaption is usually sufficient
% it could give incorrect measuring results if \cs{gls} is both used
% for the very first time and more than once (for a particular acronym).
% The alternative would be using internal macros of the
-% \package{glossaries} package which I would like to avoid.\par
+% \pkg{glossaries} package which I would like to avoid.\par
% See also \url{https://tex.stackexchange.com/questions/108368}
% \begin{macrocode}
\let\glsunset\@gobble
% \end{macrocode}
+% Execute code defined by |\Get|\-|Title|\-|String|\-|Disable|\-|Commands|
+% \begin{macrocode}
+ \caption@ifdefined\GTS@DisableHook\GTS@DisableHook\relax
+ \let\protect\caption@protect
+% \end{macrocode}
% \begin{macrocode}
}
% \end{macrocode}
@@ -4399,7 +4389,7 @@
% only be incremented temporarily for the single-line-check.
% (In the past we had re-used the original code but with re-defined
% |\step|\-|counter| but this has proofed as non-sufficient when
-% using footnote related packages like the \package{footmisc} package.
+% using footnote related packages like the \pkg{footmisc} package.
% Now we might end up getting a wrong footnote marker, but this code has to
% be sufficient for the single-line-check.))
% \begin{macrocode}
@@ -4526,17 +4516,17 @@
% \changes{v1.7}{2016/02/01}{Bugfix: \cs{relax} added before \cs{caption@lsep} so the label separator will not be gobbled if the label font command ignores spaces, e.g. by usage of \cs{color}}
% \changes{v1.8}{2018/09/12}{\cs{par} replaced by \cs{caption@textend}}
% \changes{v2.2c}{2020/10/10}{Usage of the label separators \opt{gobble} and \opt{gobbletwo} added}
-% \changes{v2.2e}{2020/10/21}{Adaptions to \package{floatrow} package added}
+% \changes{v2.2e}{2020/10/21}{Adaptions to \pkg{floatrow} package added}
% |\caption@@@make|\marg{caption label}\marg{caption text}\\
% This one finally typesets the caption paragraph, without margin and indention.
% \begin{macrocode}
\newcommand\caption@@@make[2]{%
% \end{macrocode}
-% The \package{floatrow} package uses |\caption@@@make|, too,
+% The \pkg{floatrow} package uses |\caption@@@make|, too,
% but without using |\caption@single|\-|line| or |\caption@multi|\-|line|.
% For this reason we must expand |\caption@format| if |\caption@fmt| isn't defined yet.
% Furthermore it uses |\caption@lfmt| as argument which was renamed to
-% |\caption@label|\-|format| in \package{caption3}\version{2.0}.
+% |\caption@label|\-|format| in \pkg{caption3}\version{2.0}.
% \begin{macrocode}
\ifx\caption@fmt\@undefined\caption@format\fi
\let\caption@lfmt\caption@labelformat
@@ -4695,9 +4685,9 @@
% \changes{v1.2b}{2008/08/02}{Support of \cs{float@exts} and \cs{float@addtolists} added}
% \changes{v1.2e}{2010/01/09}{Usage of \cs{caption@DeclareWithinOption} added}
% \changes{v1.3}{2011/08/06}{Definition of \cs{listofXXXes} added}
-% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \pkg{newfloat} package}
% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}\\
-% loads the \package{newfloat} package and uses |\Declare|\-|Floating|\-|Environment|.
+% loads the \pkg{newfloat} package and uses |\Declare|\-|Floating|\-|Environment|.
% \begin{macrocode}
\newcommand*\DeclareCaptionType{%
\caption@loadpackage{newfloat}{declare type}%
@@ -4713,7 +4703,7 @@
% will execute the given code for each (known) floating environment.
% The starred variant will only work for already existing environments,
% i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|
-% (offered by the \package{newfloat} package).
+% (offered by the \pkg{newfloat} package).
% \begin{macrocode}
\newcommand*\ForEachCaptionType{%
\@ifstar
@@ -4736,7 +4726,7 @@
% |\newfloat@addtohook|\marg{code with \#1}\\
% adds code to the hook called in |\Declare|\-|Floating|\-|Environment|.\par
% Note: We use |\provide|\-|command| instead of |\new|\-|command| here since the
-% exact same code is defined in the \package{newfloat} package.
+% exact same code is defined in the \pkg{newfloat} package.
% \begin{macrocode}
\providecommand\newfloat@addtohook[1]{%
\toks@=\expandafter{\newfloat@hook{##1}#1}%
@@ -4807,7 +4797,7 @@
\@namedef{ext@#4}{\csname ext@#3\endcsname}%
\caption@declaresublistentry{#3}%
% \end{macrocode}
-% Support of \package{titletoc} package
+% Support of \pkg{titletoc} package
% \begin{macrocode}
\caption@ifdefined\contentsuse{%
\contentsuse{#4}{\csname ext@#4\endcsname}}{}%
@@ -4957,8 +4947,8 @@
% \changes{v1.5}{2013/05/01}{The macro \cs{caption@savesubcounters} added}
% \changes{v1.13}{2020/07/28}{Uses \cs{caption@for@list} now for iterating the list}
% \changes{v2.2b}{2020/10/06}{This stuff replaced by a patch of \cs{@memresetsubcounter}}
-% The \class{memoir} document class resets the \texttt{subfigure}
-% resp.~\texttt{subtable} counter at the begin of floating environments using
+% The \cls{memoir} document class resets the \texttt{subfigure}
+% or \texttt{subtable} counter at the begin of floating environments using
% |\@mem|\-|reset|\-|sub|\-|counter|.
% As a side-effect |\continued|\-|float| does not work correctly.
% For that reason we need to patch |\@mem|\-|reset|\-|sub|\-|counter| here,
@@ -4976,16 +4966,16 @@
% \section{Execution of options}
%
% \begin{macrocode}
-\ifx\caption@documentclass\@empty\else
- \@pushfilename
- \edef\@currname{caption-\caption@documentclass}
- \edef\@currext{sto}
- \InputIfFileExists
- {\@currname.\@currext}%
- {}%
- {\@missingfileerror\@currname\@currext}%
- \@popfilename
-\fi
+\caption@ifdocumentclass{unknown}{}{%
+ \caption@ifdocumentclass{standard}{}{%
+ \@pushfilename
+ \edef\@currname{caption-\caption@documentclass}
+ \edef\@currext{sto}
+ \InputIfFileExists
+ {\@currname.\@currext}%
+ {}%
+ {\@missingfileerror\@currname\@currext}%
+ \@popfilename}}
% \end{macrocode}
%
% \begin{macrocode}