summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-08-30 21:10:24 +0000
committerKarl Berry <karl@freefriends.org>2020-08-30 21:10:24 +0000
commit4e8113d580e4cfb631552c3d78ab6aa413f1f422 (patch)
tree7166c1fd6540ca08943dc75e452cd851655a7f03
parentad35623c7373c69bc3388d72a0c95e9921816e03 (diff)
caption (30aug20)
git-svn-id: svn://tug.org/texlive/trunk@56213 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/caption/CHANGELOG22
-rw-r--r--Master/texmf-dist/doc/latex/caption/README9
-rw-r--r--Master/texmf-dist/doc/latex/caption/caption-deu.pdfbin318839 -> 409837 bytes
-rw-r--r--Master/texmf-dist/doc/latex/caption/caption-eng.pdfbin307635 -> 402305 bytes
-rw-r--r--Master/texmf-dist/doc/latex/caption/caption-light.pdfbin0 -> 67305 bytes
-rw-r--r--Master/texmf-dist/doc/latex/caption/subcaption.pdfbin154507 -> 154563 bytes
-rw-r--r--Master/texmf-dist/doc/latex/caption/totalcount.pdfbin82006 -> 0 bytes
-rw-r--r--Master/texmf-dist/source/latex/caption/bicaption.dtx53
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx254
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-beamer.dtx382
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-deu.tex66
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx208
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-eng.tex304
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-koma.dtx518
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-light.dtx394
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-memoir.dtx226
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-ntg.dtx213
-rw-r--r--Master/texmf-dist/source/latex/caption/caption-thesis.dtx219
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.dtx882
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.ins27
-rw-r--r--Master/texmf-dist/source/latex/caption/caption2.dtx12
-rw-r--r--Master/texmf-dist/source/latex/caption/caption3.dtx3117
-rw-r--r--Master/texmf-dist/source/latex/caption/ltcaption.dtx16
-rw-r--r--Master/texmf-dist/source/latex/caption/subcaption.dtx127
-rw-r--r--Master/texmf-dist/source/latex/caption/totalcount.dtx384
-rw-r--r--Master/texmf-dist/tex/latex/caption/bicaption.sty34
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto54
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-beamer.sto107
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto45
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-koma.sto183
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-light.sty89
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-memoir.sto46
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-ntg.sto48
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption-thesis.sto49
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption.sty377
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption2.sty12
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption3.sty1206
-rw-r--r--Master/texmf-dist/tex/latex/caption/ltcaption.sty12
-rw-r--r--Master/texmf-dist/tex/latex/caption/subcaption.sty57
-rw-r--r--Master/texmf-dist/tex/latex/caption/totalcount.sty98
40 files changed, 6359 insertions, 3491 deletions
diff --git a/Master/texmf-dist/doc/latex/caption/CHANGELOG b/Master/texmf-dist/doc/latex/caption/CHANGELOG
index 1eab8c90a40..d228e251766 100644
--- a/Master/texmf-dist/doc/latex/caption/CHANGELOG
+++ b/Master/texmf-dist/doc/latex/caption/CHANGELOG
@@ -1,7 +1,7 @@
Changes made in the caption package bundle
==========================================
-Please note that this document does not reflect bugfix-releases, and that the dates given are the dates of the release w/o bugfixes.
+Please note that this document does not reflect bugfix-releases (which are marked with a letter after the version number, for example v3.4m), and that the dates given are the dates of the release w/o bugfixes.
If you are interested in a complete changelog -- including bugfixes -- process the dtx files with \RecordChanges and \PrintChanges.
@@ -118,6 +118,18 @@ v3.4 (2019/09/11)
- \ContinuedFloat renamed to \continuedfloat (since this is not a preamble command)
- \caption will always be re-defined now, unless `compatibility' is set to `v1' (or an incompatible package is loaded)
+v3.5 (2020/08/30)
+- If a document class defines \caption@documentclass, an adaption to the caption package will be loaded as caption-<documentclass>.sto
+- New commands \SetCaptionDefault and \AtCaptionPackage for usage in document classes or document class adaptions
+- Document class support re-written (using the new commands above)
+- New commands \caption@switchdefault and \caption@restoredefault for usage in babel language packages
+- Babel language support re-written (using the new commands above); furthermore it's independent on the load order now
+- Support for the babel language option `latvian' added
+- New command \DeclareCaptionSinglelinecheck
+- New commands \ForEachCaptionType and \ForEachCaptionSubType
+- Options "figure*" resp. "table*" will be applied additionally in "figure*" resp. "table*" environments (twocolumn mode only)
+- Option and font option "hypersetup" added which expands to \hypersetup (if defined) resp. nothing (otherwise)
+
bicaption package
-----------------
@@ -172,11 +184,3 @@ v1.2 (2018/05/13)
v1.3 (2019/08/31)
- New command \subfloat for easy transition from the `subfig' package
-
-
-totalcount package
-------------------
-
-v1.0 (2008/03/09)
-- 1st published version
-
diff --git a/Master/texmf-dist/doc/latex/caption/README b/Master/texmf-dist/doc/latex/caption/README
index 721eab665a1..76c478b98fa 100644
--- a/Master/texmf-dist/doc/latex/caption/README
+++ b/Master/texmf-dist/doc/latex/caption/README
@@ -1,7 +1,7 @@
==========================================================================
The `caption' package bundle
-Release 2020-07-20
+Release 2020-08-30
Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
License: LPPL = LaTeX Project Public Licence
@@ -23,13 +23,13 @@ If you need help using these packages please visit:
If you think you may have found a bug in these packages,
or want to report a suggestion for improvement, please either visit
- https://gitlab.com/axelsommerfeldt/caption/issues (preferred)
+ https://gitlab.com/axelsommerfeldt/caption/issues
or send an e-mail to
axel.sommerfeldt@f-m.fm
--------------------------------------------------------------------------
-The `caption' package v3.4 offers customization of captions of floating
+The `caption' package v3.5 offers customization of captions of floating
environments such `figure' and `table' and cooperates with the packages
float, floatflt, fltpage, hyperref, hypcap, listings, longtable,
@@ -76,6 +76,9 @@ User Manual: subcaption.pdf (English)
Note: The `newfloat' package was removed from this package bundle and was
uploaded to CTAN as stand-alone package.
+Note: The `totalcount' package was removed from this package bundle and
+was uploaded to CTAN as stand-alone package.
+
==========================================================================
(The pictures cat.eps & elephant.eps were taken with permission from the
LaTeX Companion examples.)
diff --git a/Master/texmf-dist/doc/latex/caption/caption-deu.pdf b/Master/texmf-dist/doc/latex/caption/caption-deu.pdf
index 7697a2f35c3..e20b64721a0 100644
--- a/Master/texmf-dist/doc/latex/caption/caption-deu.pdf
+++ b/Master/texmf-dist/doc/latex/caption/caption-deu.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/caption/caption-eng.pdf b/Master/texmf-dist/doc/latex/caption/caption-eng.pdf
index d0e771e0c4c..d7744c25d0a 100644
--- a/Master/texmf-dist/doc/latex/caption/caption-eng.pdf
+++ b/Master/texmf-dist/doc/latex/caption/caption-eng.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/caption/caption-light.pdf b/Master/texmf-dist/doc/latex/caption/caption-light.pdf
new file mode 100644
index 00000000000..132be27d7db
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/caption/caption-light.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/caption/subcaption.pdf b/Master/texmf-dist/doc/latex/caption/subcaption.pdf
index 8a4257ed5ec..4f31cd934af 100644
--- a/Master/texmf-dist/doc/latex/caption/subcaption.pdf
+++ b/Master/texmf-dist/doc/latex/caption/subcaption.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/caption/totalcount.pdf b/Master/texmf-dist/doc/latex/caption/totalcount.pdf
deleted file mode 100644
index bbe1a9dfd3d..00000000000
--- a/Master/texmf-dist/doc/latex/caption/totalcount.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx
index 9008263302a..f2a52185c93 100644
--- a/Master/texmf-dist/source/latex/caption/bicaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx
@@ -19,16 +19,20 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{427}
+% \CheckSum{431}
%
% \iffalse
%<*driver>
@@ -827,17 +831,10 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{bicaption}[2016/03/27 v1.2 Bilingual Captions (AR)]
+\ProvidesPackage{bicaption}[2020/08/23 v1.2a Bilingual Captions (AR)]
% \end{macrocode}
% \begin{macrocode}
-\RequirePackage{caption}[2018/05/11] % needs v3.4 or newer
-% \end{macrocode}
-% \changes{v1.0}{2011/09/01}{Compatibility error added}
-% \begin{macrocode}
-\caption@AtBeginDocument{\caption@ifcompatibility{%
- \caption@Error{%
- The `bicaption' package does not work correctly\MessageBreak
- in compatibility mode}}{}}
+\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
% \end{macrocode}
%
% \bigskip
@@ -897,6 +894,30 @@
% \end{macro}
%
% \pagebreak[3]
+% \subsection{Compatibility check}
+%
+% \begin{macro}{\bicaption@CheckCompatibility}
+% \changes{v1.0}{2011/09/01}{Compatibility error added}
+% \changes{v1.2a}{2020/08/01}{Error text adapted to \package{caption} package~\version{4.0}}
+% \begin{macrocode}
+\newcommand*\bicaption@CheckCompatibility{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifcompatibility{%
+ \bicaption@Error
+ {This package does not work with\MessageBreak
+ caption option `compatibility=v1'}%
+ \endinput}{}}
+% \end{macrocode}
+% \begin{macrocode}
+\bicaption@CheckCompatibility
+\caption@AtBeginDocument{%
+ \bicaption@CheckCompatibility
+ \let\bicaption@CheckCompatibility\@undefined}
+% \end{macrocode}
+% \end{macro}
+%
+% \pagebreak[3]
% \subsection{Declaration of options}
%
% The option |bi-lang| will setup which language(s) will actually be typeset,
@@ -1259,7 +1280,7 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\@@@@bicaption#1#2[#3]#4{%
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\bicaption@ifswap
{\bicaption@setup{#1}{#2}%
\bicaption@cmd[{#3}]{#4}}%
@@ -1293,7 +1314,7 @@
% \begin{macrocode}
\long\def\LT@@@@bicaption#1#2[#3]#4{%
\gdef\bicaption@LTsetup{%
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\bicaption@LT@setup}%
\gdef\bicaption@LT@setup{%
\bicaption@ifswap
diff --git a/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx b/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
new file mode 100644
index 00000000000..e36d586fb5b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
@@ -0,0 +1,254 @@
+% \iffalse meta-comment
+%
+% This is file `caption-ams-smf.dtx'.
+%
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{21}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ams-smf.drv}[2020/07/31 v2.0 Implementation of the caption-ams-smf package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\DeclareRobustCommand*\AmS{\texorpdfstring
+ {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
+ {AMS}}
+\DeclareRobustCommand*\SmF{SMF}
+%
+\begin{document}
+ \DocInput{caption-ams-smf.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-ams-smf.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-ams-smf.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \AmS\ and \SmF\ document classes\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the AMS and SMF document classes}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \AmS\ and \SmF\ document classes.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+% \changes{v2.0}{2020/07/27}{\AmS\ \& \SmF\ class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ams-smf.sto}[2020/08/22 v2.0 Adaption of the caption package to the AMS and SMF document classes (AR)]
+% \end{macrocode}
+%
+% \section{Margin resp. width}
+%
+% The \AmS\ document classes use |\caption|\-|indent| as fixed margin, usually set to |3pc|.
+% \begin{macrocode}
+\SetCaptionDefault*{margin}{\the\captionindent}
+% \end{macrocode}
+%
+% \section{Label separator}
+%
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{default}{.\enspace}
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' fonts map to |\@caption|\-|font| resp.~|\@caption|\-|head|\-|font|
+% which are usually set to |\sc|\-|shape| resp.~|\normalfont|.
+%
+% \begin{macrocode}
+\DeclareCaptionFont{ams@font}{\@captionfont}
+\DeclareCaptionFont{ams@labelfont}{\@captionheadfont}
+\DeclareCaptionFont{ams@textfont}{\@captionfont\upshape}
+\SetCaptionDefault{font}{ams@font}
+\SetCaptionDefault{labelfont}{ams@labelfont}
+\SetCaptionDefault{textfont}{ams@textfont}
+% \end{macrocode}
+%
+% \section{Vertical spaces before and after captions}
+%
+% The \AmS\ document classes uses |\above|\-|caption|\-|skip| and |\below|\-|caption|\-|skip|
+% different than the standard document classes and the \package{caption} package:
+% They typeset |\above|\-|caption|\-|skip| before the `figure' caption and
+% |\below|\-|caption|\-|skip| after all other captions. Both are preset to |12pt|.
+%
+% For this reason we have to set the |\below|\-|caption|\-|skip| to |0pt| if the \package{caption}
+% package is used, so no extra vertical space will be created.
+%
+% \begin{macrocode}
+\AtCaptionPackage{\setlength\belowcaptionskip{0pt}}
+% \end{macrocode}
+%
+% \section{Positioning}
+%
+% The default caption position in all floating environments except `figure' is `top'.
+% \begin{macrocode}
+\captionsetup{position=t,figureposition=b}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-beamer.dtx b/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
new file mode 100644
index 00000000000..57993b5c49e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
@@ -0,0 +1,382 @@
+% \iffalse meta-comment
+%
+% This is file `caption-beamer.dtx'.
+%
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{104}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-beamer.drv}[2018/05/13 v2.0 Implementation of the caption-beamer package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\begin{document}
+ \DocInput{caption-beamer.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-beamer.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-beamer.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \class{beamer} document class\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the beamer document class}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \class{beamer} document class.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only. The user
+% documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.1}{2007/03/10}{\class{beamer} class support added}
+% \changes{v1.3}{2011/08/06}{\class{beamer} class support revised}
+% \changes{v1.5}{2013/04/27}{The \class{beamer} template \texttt{caption label separator} will be used now}
+% \changes{v1.7}{2016/05/22}{Re-definition of label format \texttt{simpleMagyar} added to \class{beamer} class support}
+% \changes{v1.7}{2018/04/15}{Re-definition of label format \texttt{simpleMagyar} revised}
+% \changes{v1.7}{2018/05/01}{Definition of \class{beamer} default label font revised}
+% \changes{v2.0}{2020/07/27}{\class{beamer} class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-beamer.sto}[2020/08/22 v2.0 Adaption of the caption package to the beamer document classes (AR)]
+% \end{macrocode}
+%
+% \section{Helper macros}
+%
+% \begin{macro}{\caption@ifbeamertemplate}
+% |\caption@ifbeamertemplate|\marg{caption template name}\marg{yes-code}\marg{no-code}\\
+% tests if the given beamer caption template was selected by the user (or not).
+% \begin{macrocode}
+\newcommand*\caption@ifbeamertemplate[1]{%
+ \begingroup
+ \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \@nameuse{beamer@@tmpop@caption@#1}%
+ \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Single-line-check}
+%
+% The `default' single-line-check maps to the beamer template setting `caption name own line'.
+% \begin{macrocode}
+\DeclareCaptionSinglelinecheck{default}{%
+ \caption@ifbeamertemplate{caption name own line}%
+ \@secondoftwo % \@secondoftwo -> singlelinecheck=off
+ \@firstoftwo} % \@firstoftwo -> singlelinecheck=on
+% \end{macrocode}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.12b}{2020/07/20}{Special adaption to \class{beamer} added}
+% The patch of \cs{footnote} provided by the \package{caption3} package assumes
+% that the optional arguments of \cs{footnote} and \cs{footnotemark} match.
+% Since this is not the case in \class{beamer} based documents,
+% and since \class{beamer} extents the syntax of \cs{footnote} in a special way,
+% we need a special patch here.\par
+% \emph{Note:} For this patch we assume that \cs{footnote} will always end with the usage of
+% \cs{beamer@footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
+% in \class{beamer} to offer a less dirty patch.)
+% \begin{macrocode}
+\g@addto@macro\caption@prepareslc{%
+ \def\footnote{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \renewcommand<>\beamer@framefootnotetext[1]{%
+ \endgroup}%
+ \let\@footnotetext\beamer@framefootnotetext
+ \caption@footnote@ORI}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Label formats}
+%
+% The `default' caption label format maps to either `simple' (if the `numbered' beamer template is set) or `unnumbered' (otherwise).
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{default}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@labelformat@simple
+ \caption@labelformat@unnumbered
+ {#1}{#2}}
+% \end{macrocode}
+%
+% The \package{magyar} babel package redefines the current label format to a one called |simple|\-|Magyar|,
+% defined within |\@@magyar@caption|\-|fix| which will be executed |\At|\-|Begin|\-|Document|:
+% \begin{quote}
+% |\DeclareCaptionLabelFormat{simpleMagyar}%|\\
+% | {#2.\bothIfSecond{\nobreakspace}{#1}}|
+% \end{quote}
+% When used with beamer, we need to patch it so no numbering will be used if the `numbered` template isn't selected.
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{simpleMagyar}{%
+ \caption@ifbeamertemplate{numbered}%
+ {#2.\bothIfSecond{\nobreakspace}{#1}}%
+ {\caption@labelformat@unnumbered{#1}{#2}}}
+% \end{macrocode}
+% \begin{macro}{\@@magyar@captionfix}
+% Prevent \package{magyar} from defining this caption label format on its own.
+% \begin{macrocode}
+\let\@@magyar@captionfix\relax
+\AtBeginDocument{\let\@@magyar@captionfix\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Label separator}
+%
+% The `default' caption label separator maps to the beamer templates
+% `caption name own line' and `caption label separator'.
+%
+% If the beamer template `caption name own line' is set, this code equals to
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator*{default}{\\}|
+% \end{quote}
+% otherwise this code equals to
+% \begin{quote}
+% |\DeclareCaptionLabelSeparator{default}%|\\
+% | {\usebeamertemplate{caption label separator}}|
+% \end{quote}
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator**{default}%
+ {\caption@ifbeamertemplate{caption name own line}}%
+ {\caption@ifbeamertemplate{caption name own line}%
+ {\\}%
+ {\usebeamertemplate{caption label separator}}}
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' caption font maps to the beamer settings for `caption' resp. `caption name'.
+% \begin{macrocode}
+\DeclareCaptionFont{beamer@font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+\SetCaptionDefault{font}{beamer@font}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFont{beamer@labelfont}{%
+ \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
+ \usebeamercolor[fg]{caption name}%
+ \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
+ \usebeamerfont{caption name}}
+\SetCaptionDefault{labelfont}{beamer@labelfont}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionFont{beamer@textfont}{}
+\SetCaptionDefault{textfont}{beamer@textfont}
+% \end{macrocode}
+%
+% \section{Justification}
+%
+% The `default' caption justification is `raggedright'.
+% \begin{macrocode}
+\SetCaptionDefault{justification}{raggedright}
+% \end{macrocode}
+%
+% \section{Lists}
+%
+% Since the beamer class do not offer a `List of figures' we switch it off.
+% \begin{macrocode}
+\captionsetup{list=off}
+% \end{macrocode}
+%
+% \section{Adaption of figure and table environment}
+%
+% \begin{macrocode}
+\AtCaptionPackage{%
+% \end{macrocode}
+%
+% \begin{macro}{\figure}
+% \changes{v1.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v1.8d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@beamer@figure
+ \csname\string\figure\endcsname
+ \@namedef{\string\figure}[#1]{%
+ \caption@beamer@figure[#1]% use original beamer code first
+ \caption@settype{figure}} % set "type=figure" afterwards
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\table}
+% \changes{v1.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v1.8d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
+% \changes{v1.8e}{2019/10/18}{Bug fixed which was introduced in previous revision}
+% We redefine |figure| \& |table| so our type-specific options will be used etc.
+% \begin{macrocode}
+ \expandafter\let\expandafter\caption@beamer@table
+ \csname\string\table\endcsname
+ \@namedef{\string\table}[#1]{%
+ \caption@beamer@table[#1]% use original beamer code first
+ \caption@settype{table}} % set "type=table" afterwards
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-deu.tex b/Master/texmf-dist/source/latex/caption/caption-deu.tex
index 6a58b3ca9a8..7d84184285d 100644
--- a/Master/texmf-dist/source/latex/caption/caption-deu.tex
+++ b/Master/texmf-dist/source/latex/caption/caption-deu.tex
@@ -1,7 +1,7 @@
%
% This is file `caption-deu.tex'.
%
-% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -17,14 +17,21 @@
%
% This Current Maintainer of this work is Axel Sommerfeldt.
%
-% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
-% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
-% the derived files caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
-% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-deu.tex}[2011/11/02 v3.2 Das caption-Paket]
+\ProvidesFile{caption-deu.tex}[2020/08/22 v3.4 Das caption-Paket]
\hbadness=9999 \newcount\hbadness \hfuzz=20pt % Make TeX shut up.
%\errorcontextlines=3
@@ -194,9 +201,12 @@
\GetFileInfo{caption-deu.tex}
\let\docdate\filedate
+\let\docdate\filedate
+\let\docversion\fileversion
\GetFileInfo{caption.sty}
-\title{Anpassen der Abbildungs- und Tabellenbeschriftungen}
+\title{Anpassen der Abbildungs- und Tabellenbeschriftungen\texorpdfstring{%
+ \thanks{Dieses Paket hat Versionsnummer \docversion.}}{}}
\author{Axel Sommerfeldt\\
\url{https://gitlab.com/axelsommerfeldt/caption}}
\date{\docdate}
@@ -223,11 +233,49 @@ kleinen aber feinen \package{capt-of}"=Paketes hierzu völlig ausreichend.
\newcommand\exampletext{%
Die auf die Rotationsfrequenz des Innenzylinders normierten Eigenfrequenzen
- der gefundenen Grundmoden der Taylor"=Str"omung f"ur \mbox{$\eta = 0.5$}. %\\
+ der gefundenen Grundmoden der Taylor"=Strömung f"ur \mbox{$\eta = 0.5$}. %\\
(Die azimutale Wellenzahl ist mit $m$ bezeichnet.)}
% --------------------------------------------------------------------------- %
+\section*{Status dieses Dokumentes}
+
+Diese Dokumentation ist veraltet.
+
+Sie dokumentiert die in Version \version{3.1} des \package{caption}"=Paketes
+verfügbaren Optionen und Befehle, jedoch nicht, was in folgenden Versionen
+hinzugefügt wurde. Warum?
+\begin{itemize}
+\item
+ Ich war nicht glücklich mit der Struktur der Dokumentation und wollte sie daher
+ neu schreiben. Warum also eine aufgegebene Version der Dokumentation pflegen?
+ (Leider hatte ich aber nie die Zeit gefunden, die neue Version zu schreiben.)
+\item
+ Da meine Freizeit seit dem Release der Version \version{3.1} nur spärlich
+ vorhanden war, wollte ich die Veröffentlichung von Verbesserungen und
+ Erweiterungen nicht aufgrund fehlender Dokumentation um Monate verzögern.
+\item
+ Da ich früher Fehlerkorrekturen nur in der aktuellen Entwicklungsversion
+ vorgenommen hatte, wollte ich die Veröffentlichung von Korrekturen nicht
+ aufgrund fehlender Dokumentation um Monate verzögern.
+ (Seit 2015 werden Fehler in der Regel auch für die letzte Release"=Version
+ behoben und auf CTAN veröffentlicht.)
+\end{itemize}
+
+Wie geht es nun weiter?
+\begin{itemize}
+\item
+ Ich werde in den nächsten Wochen starten, die Dokumentation (endlich) zu aktualisieren.
+\item
+ Bis die überarbeitete Version fertig und auf CTAN zu finden ist,
+ kann jederzeit der aktuelle Zwischenstand über
+ \url{https://gitlab.com/axelsommerfeldt/caption/-/blob/master/doc/caption-eng.pdf}
+ bezogen werden. (Zunächst wird die englischsprachige Dokumentation überarbeitet,
+ und erst anschließend die deutschsprachige.)
+\end{itemize}
+
+% --------------------------------------------------------------------------- %
+
\section*{Einleitung}
Mit |\caption| gesetzte Bildunterschriften und Tabellenüberschriften werden
diff --git a/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx b/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
new file mode 100644
index 00000000000..c7f0922c145
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
@@ -0,0 +1,208 @@
+% \iffalse meta-comment
+%
+% This is file `caption-elsarticle.dtx'.
+%
+% Copyright (C) 2013-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{3}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-elsarticle.drv}[2018/05/24 v2.0 Implementation of the caption-elsarticle package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\begin{document}
+ \DocInput{caption-elsarticle.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-elsarticle.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-elsarticle.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \class{elsarticle} document class\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the elsarticle document class}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \package{elsarticle} document class.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only. The user
+% documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.5}{2013/01/06}{\class{elsarticle} class support added}
+% \changes{v2.0}{2020/07/27}{\class{elsarticle} class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-elsarticle.sto}[2020/08/22 v2.0 Adaption of the caption package to the elsarticle document class (AR)]
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' caption size is |\footnotesize|.
+% \begin{macrocode}
+\SetCaptionDefault{font}{footnotesize}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-eng.tex b/Master/texmf-dist/source/latex/caption/caption-eng.tex
index ef9fd389231..8a10baffd00 100644
--- a/Master/texmf-dist/source/latex/caption/caption-eng.tex
+++ b/Master/texmf-dist/source/latex/caption/caption-eng.tex
@@ -1,7 +1,7 @@
%
% This is file `caption-eng.tex'.
%
-% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -17,14 +17,21 @@
%
% This Current Maintainer of this work is Axel Sommerfeldt.
%
-% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
-% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
-% the derived files caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
-% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption-eng.tex}[2011/11/02 v3.2 The caption package]
+\ProvidesFile{caption-eng.tex}[2020/08/30 v3.5 The caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=20pt % Make TeX shut up.
%\errorcontextlines=3
@@ -187,9 +194,11 @@
\GetFileInfo{caption-eng.tex}
\let\docdate\filedate
+\let\docversion\fileversion
\GetFileInfo{caption.sty}
-\title{Customizing captions of floating environments}
+\title{Customizing captions of floating environments\texorpdfstring{%
+ \thanks{This package has version number \docversion.}}{}}
\author{Axel Sommerfeldt\\
\url{https://gitlab.com/axelsommerfeldt/caption}}
\date{\docdate}
@@ -206,7 +215,7 @@ many other packages.
commands for customizing captions.
If these possibilities are sufficient for you, there is usually no need for
you to use the \package{caption} package at all.
-And if you are just interested in using the command \cs{captionof}, loading of
+And if you are only interested in using the command \cs{captionof}, loading of
the very small \package{capt-of} package is usually sufficient.
\end{abstract}
@@ -218,6 +227,41 @@ the very small \package{capt-of} package is usually sufficient.
% --------------------------------------------------------------------------- %
+\section*{State of this document}
+
+This documentation is outdated.
+
+It documents the options and commands available in version \version{3.1} of the
+\package{caption} package, but many things added later on is missing here. Why?
+\begin{itemize}
+\item
+ I wasn't happy with the structure of the documentation, so I decided to write a new one.
+ So why updating the abandoned documentation?
+ (Unfortunately I never found the time to actually write the new one.)
+\item
+ Since my spare time was extremly limited since version \version{3.1} I didn't
+ wanted to hold improvements and enhancements back for months because of missing
+ documentation.
+\item
+ Since I used to fix bugs in the most recent development version only,
+ I didn't wanted to hold bugfixes back for months because of missing
+ documentation of features.
+ (But since 2015 bugs will usually get fixed for the latest release version as well,
+ and released to CTAN as bug-fixed version afterwards.)
+\end{itemize}
+
+What now?
+\begin{itemize}
+\item
+ I will start revising this documentation in the next weeks, finally bringing it up-to-date.
+\item
+ Until the revised documentation is ready the most recent version could be found at
+ \url{https://gitlab.com/axelsommerfeldt/caption/-/blob/master/doc/caption-eng.pdf}
+ since I will not upload every improvement of the documentation to CTAN immediately.
+\end{itemize}
+
+% --------------------------------------------------------------------------- %
+
\section*{Introduction}
Within the standard \LaTeX\ document classes captions haven't received the
@@ -613,18 +657,18 @@ You can choose one of the following:
Three examples:
\begin{Example}
\begin{quote}
- |format=plain,justification=centerlast|
+ |format=hang,justification=raggedright|
\end{quote}
\captionsetup{skip=0pt}
- \example{format=plain,justification=centerlast}{\exampletext}
+ \example{format=hang,justification=raggedright}{\exampletext}
\end{Example}
\begin{Example}
\begin{quote}
- |format=hang,justification=raggedright|
+ |format=hang,justification=centerlast|
\end{quote}
\captionsetup{skip=0pt}
- \example{format=hang,justification=raggedright}{\exampletext}
+ \example{format=hang,justification=centerlast}{\exampletext}
\end{Example}
\begin{Example}
@@ -761,10 +805,10 @@ Three examples:
\begin{Example}
\begin{quote}
- |labelfont=bf,textfont=it|
+ |labelfont=sc,textfont=it|
\end{quote}
\captionsetup{skip=0pt}
- \example{labelfont=bf,textfont=it}{\exampletext}
+ \example{labelfont=sc,textfont=it}{\exampletext}
\end{Example}
\begin{Example}
@@ -2157,7 +2201,7 @@ This will be achieved by a combination of
% --------------------------------------------------------------------------- %
\clearpage
-\section{Document classes \& Babel support}
+\section{Supported document classes}
\label{classes}
%\NEWdescription{v3.1}
@@ -2369,51 +2413,31 @@ the caption text font with |\caption|\-|body|\-|font|.
Both is still supported unless you use one of the two options
|label|\-|font=| or |text|\-|font=| offered by \thispackage.
-\subsection{frenchb babel option}
-\label{frenchb}
+% --------------------------------------------------------------------------- %
-If you use the \package{frenchb} option of the \package{babel} package
+\clearpage
+\section{Supported babel package options}
+\label{babel}
+
+\NEWfeature{v3.5}
+Since version \version{3.5} of the \package{caption} package the support
+is independent on the load order of \package{caption} and \package{babel}.
+
+\subsection{french babel option}
+\label{french}
+
+If you use the \package{french} option of the \package{babel} package
with one of the three standard \LaTeX{} classes (or a one derived from them)
the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
-(offered by \package{frenchb}), overriding the default value set by the
+(offered by \package{french}), overriding the default value set by the
document class.
So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
don't select a different |label|\-|sep=| than the default one.
-\INFO*
-Please load \thispackage\ \emph{after} the \package{babel} package.
-
-\subsection{frenchle and frenchpro packages}
-\label{frenchpro}
-
-If you use the \package{frenchle} or \package{frenchpro} package,
-the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
-(offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
-value set by the document class.
-So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
-don't select a different |label|\-|sep=| than the default one.
-
-Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
-since this emulates the default setting of |\caption|\-|font| defined by the
-\package{frenchle} or \package{frenchpro} package.
-%If you redefine |\captionfont| after loading the \package{frenchle} or
-%\package{frenchpro} package, this redefinition gets lost.
-Please note that the command |\caption|\-|font| is used by the
-\package{caption} package internally for a different purpose,
-so you should not change it (anymore).
-
-The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
-still work, but only unless you don't select a different |label|\-|format=|
-than the default one.
-
-\INFO*
-Please load \thispackage\ \emph{after} the \package{frenchle}
-or \package{frenchpro} package.
-
% --------------------------------------------------------------------------- %
\clearpage
-\section{Package support}
+\section{Supported packages}
\label{packages}
\label{compatibility}
@@ -2680,6 +2704,35 @@ These options will be executed additionally to the regular ones for
|figure| or |table|.
\pagebreak[3]
+\subsection{frenchle and frenchpro packages}
+\label{frenchpro}
+
+If you use the \package{frenchle} or \package{frenchpro} package,
+the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
+(offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
+value set by the document class.
+So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
+don't select a different |label|\-|sep=| than the default one.
+
+Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
+since this emulates the default setting of |\caption|\-|font| defined by the
+\package{frenchle} or \package{frenchpro} package.
+%If you redefine |\captionfont| after loading the \package{frenchle} or
+%\package{frenchpro} package, this redefinition gets lost.
+Please note that the command |\caption|\-|font| is used by the
+\package{caption} package internally for a different purpose,
+so you should not change it (anymore).
+
+The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
+still work, but only unless you don't select a different |label|\-|format=|
+than the default one.
+
+\NEWfeature{v3.5}
+Since version \version{3.5} of the \package{caption} package the support
+is independent on the load order of \package{caption} and \package{frenchle}
+resp~.\package{frenchpro}.
+
+\pagebreak[3]
\subsection{hyperref}
\label{hyperref}
\packagedescription{%
@@ -3811,7 +3864,7 @@ While all the previous versions were designed for usage with the standard
the current version $3.1$ released in 2007 also supports the \AmS,
\KOMAScript, \NTG, and \SmF\ document classes, and the \class{beamer} class
as well.
-Furthermore it was adapted to the \package{frenchb} Babel option,
+Furthermore it was adapted to the \package{french} Babel option,
the \package{frenchle} \& \package{frenchpro} packages,
and the \package{floatflt}, \package{fltpage}, \package{picinpar},
\package{picins}, \package{setspace}, \package{threeparttable},
@@ -4072,6 +4125,152 @@ to the \package{subfig} package instead and do not load \thispackage\ anymore.
% --------------------------------------------------------------------------- %
\clearpage
+\section{Commands for document class authors}
+
+A document class could simply load the \package{caption} package instead
+of defining an own variant of |\@make|\-|caption|. However if the author decides
+not to do this -- for whatever reason -- there is a second option:
+
+\NEWfeature{v3.5}
+If a document class defines |\caption@document|\-|class|, an adaption to the
+\package{caption} package will be loaded as |caption-|\meta{documentclass}|.sto|
+if the \package{caption} kernel is loaded.
+The goal of this adaption file is changing the default settings of the
+\package{caption} package so simply loading it (without any package options)
+will not make any harm to the look at feel of the captions.
+This gives end-users the opportunity to fine-tune certain aspects of the
+appearance of captions by adding package options, without unwanted
+side-effects on other aspects of the appearance.
+
+In both cases the command |\Set|\-|Caption|\-|Default|
+could be used to adapt the \package{caption} package default values:
+
+\DescribeMacro{\SetCaptionDefault}
+The command
+\begin{quote}|\SetCaptionDefault*|\marg{option}\marg{default value}\end{quote}
+changes the default value for the option \meta{option}, for example:
+\begin{quote}
+|\SetCaptionDefault{format}{hang}|\\
+|\SetCaptionDefault{justification}{raggedright}|\\
+|\DeclareCaptionLabelSeparator{silly}{ +++ }|\\
+|\SetCaptionDefault{labelseparator}{silly}|
+\end{quote}
+This command is available for the options
+|box|,
+|font|,
+|format|,
+|justification|,
+|label|\-|font|,
+|label|\-|format|,
+|label|\-|separator|,
+|list|\-|format|,
+|margin|,
+|parbox|,
+|position|,
+|single|\-|line|\-|check|,
+|text|\-|font|,
+|text|\-|format|, and
+|width|.
+
+The starred variant only makes a difference when setting the default length
+of either |margin| or |width|, in this case it will use |\def| internally
+instead of |\edef| to store the value so the actual margin will be calculated
+when used (and not when set).
+
+\DescribeMacro{\AtCaptionPackage}
+The adaption file will be loaded when the \package{caption} kernel |caption3.sty|
+will be loaded so the given adaptions will be done for the \package{floatrow}
+and \package{subfig} packages even if the \package{caption} package isn't loaded.
+
+But some adaptions have to be done for the \package{caption} package,
+and for this reason the hook
+\begin{quote}|\At|\-|Caption|\-|Package|\marg{code}\end{quote}
+is offered to authors of adaption files.
+The \meta{code} inside the hook will be executed right before the given package
+options will be evaluated.
+
+For example the adaption file for the \KOMAScript\ document classes
+uses |\At|\-|Begin|\-|Caption| to re-define the \package{caption} package
+options |figure|\-|position| and |table|\-|position| to issue a warning
+that using these options has little effect here.
+
+% --------------------------------------------------------------------------- %
+
+\clearpage
+\section{Commands for babel language package authors}
+
+\NEWfeature{v3.5}
+\DescribeMacro{\caption@switchdefault}
+If the \package{caption3} kernel package is loaded, the command
+\begin{quote}|\caption@switchdefault|\marg{option}\marg{code with \#1}\marg{new value}\end{quote}
+is available which saves the old default value of the given option using
+\meta{code} and sets the new default value afterwards.
+
+\DescribeMacro{\caption@restoredefault}
+The command
+\begin{quote}|\caption@restoredefault|\marg{option}\marg{old value}\end{quote}
+restores the old default value which was stored in \meta{old value} before.
+
+Example:
+\begin{quote}
+ |\DeclareCaptionLabelSeparator{french}{|\ldots|}|\\
+ |\addto\extrasfrench{%|\\
+ | \caption@switchdefault{labelseparator}{\babel@save #1}{french}}|\\
+ |% Note: \caption@restoredefault isn't needed here|
+\end{quote}
+
+Another example:
+\begin{quote}
+ |\caption@switchdefault{font}{\let\original@captionfont#1}{it}%|\\
+ \ldots\\
+ |\caption@restoredefault{font}{\original@captionfont}%|\\
+\end{quote}
+
+Since boths commands are defined with |\def| inside the \package{caption3}
+kernel, they could be pre-defined with
+\begin{quote}
+ |\providecommand\caption@switchdefault[3]{}|\\
+ |\providecommand\caption@restoredefault[2]{}|
+\end{quote}
+inside the babel language package so their existence doesn't need to be tested
+prior use.
+
+Additionally babel language packages should not re-define |\@make|\-|caption|
+if the \package{caption} package is loaded, i.e.~if |\caption@makecaption| is
+defined. (Unfortunately one cannot use the \LaTeX{} kernel command
+|\@if|\-|package|\-|loaded{caption}| here since it's only available in the
+document preamble.)
+
+Please note that code like
+\begin{quote}
+ |\addto\extraswhatever{%|\\
+ | \@ifundefined{caption@makecaption}{%|\\
+ | \babel@save\@makecaption|\\
+ | \let\@makecaption\my@makecaption|\\
+ | }{%|\\
+ | \caption@switchdefault{|\ldots|}{\babel@save #1}{|\ldots|}%|\\
+ | }}|
+\end{quote}
+would be wrong since it mixes up the presence of the \package{caption3} kernel
+and the \package{caption} package.
+If the \package{caption3} kernel is loaded this does not mean that the
+\package{caption} package is loaded, too, and the latter one re-defines
+|\caption|, |\@caption|, and |\@make|\-|caption| while the \package{caption3}
+kernel does not re-define any of them, instead it only provides (default) values
+for the \package{caption}, \package{floatrow}, and \package{subfig} package.
+
+Currently there is build-in support for the following babel language options:
+|arabic|, |farsi|, |french|, |hungarian|, |latvian|, and |magyar|.
+This support could be deactivated by defining
+\begin{quote}
+ |\def\caption@ifbabel@|\meta{package}|{false}|
+\end{quote}
+where \meta{package} is either |arabi|, |french|, |frenchle|, |hungarian|,
+or |latvian|.
+
+% --------------------------------------------------------------------------- %
+
+\clearpage
\begin{thebibliography}{99}
\bibitem{TLC2}
@@ -4230,3 +4429,4 @@ to the \package{subfig} package instead and do not load \thispackage\ anymore.
% --------------------------------------------------------------------------- %
\end{document}
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-koma.dtx b/Master/texmf-dist/source/latex/caption/caption-koma.dtx
new file mode 100644
index 00000000000..1cd5f856716
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-koma.dtx
@@ -0,0 +1,518 @@
+% \iffalse meta-comment
+%
+% This is file `caption-koma.dtx'.
+%
+% Copyright (C) 2004-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{273}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-koma.drv}[2018/05/24 v2.0 Implementation of the caption-koma package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\DeclareRobustCommand*\KOMAScript{\texorpdfstring
+ {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
+ {KOMA-Script}}
+%
+\begin{document}
+ \DocInput{caption-koma.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-koma.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-koma.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \KOMAScript\ document classes\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the KOMA-Script document classes}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \KOMAScript\ document classes.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
+% \changes{v1.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
+% \changes{v1.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
+% \changes{v1.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
+% \changes{v1.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
+% \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added}
+% \changes{v1.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
+% \changes{v2.0}{2020/07/27}{\KOMAScript\ class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-koma.sto}[2020/08/22 v2.0 Adaption of the caption package to the KOMA-Script document classes (AR)]
+% \end{macrocode}
+%
+% \section{Margin resp. width}
+%
+% \begin{macro}{\setcapwidth}
+% \changes{v1.9}{2018/12/26}{Bugfix: Missing curly braces added}
+% Patch |\setcapwidth| so it will set the \package{caption3} width setting, too.
+% \begin{macrocode}
+\expandafter\let\expandafter\caption@koma@setcapwidth
+ \csname\string\setcapwidth\endcsname
+\@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@koma@setcapwidth[{#1}]{#2}%
+ \caption@setcapwidth@opt{#1}%
+ \caption@setcapwidth}
+% \end{macrocode}
+% The optional argument of \cs{setcapwidth} if not supported (yet),
+% so we issue a warning if used.
+% (Since this does not seem to have an negative effect when used
+% by the \texttt{captionbeside} environment, we suppress the warning here.)
+% \begin{macrocode}
+\newcommand*\caption@setcapwidth@opt[1]{}
+\AtCaptionPackage{\renewcommand*\caption@setcapwidth@opt[1]{%
+ \ifx\\#1\\\else
+ \caption@ifdefined\cap@margin{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}{}%
+ \fi}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setcapwidth{%
+ \captionsetup{width=\cap@width}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@tempa{\hsize}%
+\ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \emph{TODO:} |\setcapdynwidth|
+%
+% \begin{macro}{\setcapmargin}
+% Patch |\setcapmargin| so it will set the \package{caption3} margin setting, too.
+% \begin{macrocode}
+\expandafter\let\expandafter\caption@koma@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+\@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@koma@setcapmargin[{#1}]{#2}%
+ \caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\let\expandafter\caption@koma@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+\@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@koma@@setcapmargin[{#1}]{#2}%
+ \caption@setcapmargin}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\ifx\cap@margin\relax \else
+ \caption@setcapmargin
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Indentions}
+%
+% \begin{macro}{\setcapindent}
+% Patch |\setcapindent| so it will set the \package{caption3} indention setting, too.
+% \begin{macrocode}
+\let\caption@koma@setcapindent\@setcapindent
+\renewcommand*\@setcapindent[1]{%
+ \caption@koma@setcapindent{#1}%
+ \caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@koma@@setcapindent\@@setcapindent
+\renewcommand*\@@setcapindent[1]{%
+ \caption@koma@@setcapindent{#1}%
+ \caption@setcapindent}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\caption@ifdefined\cap@indent{\caption@setcapindent}{}
+% \end{macrocode}
+%
+% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script: A special version of options `parindent' and `parskip' added}
+% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of `parskip' and `parindent' options revised and moved into caption kernel}
+% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and `parindent' are obsolete now, removed}
+% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and `parindent' re-added, since they still collide with the current version of the subfig package (Sigh!)}
+%
+% There is an option clash between the \KOMAScript\ document classes
+% and the \package{caption} kernel, both define the options |parindent| and
+% |parskip| but with different meaning.
+% Furthermore the ones defined by the \package{caption} kernel take a
+% value as parameter but the \KOMAScript\ ones do not.
+%
+% So we need special versions of the options |parindent| and |parskip| here
+% which determine if a value is given (and therefore should be treated as
+% our option) or not (and therefore should be ignored by us).\footnote{%^^A
+% This problem was completely solved due a change of \cs{caption@ProcessOptions}
+% in \package{caption3}~\version{1.0h}, but we still need this workaround since
+% these options would otherwise still collide with the current version $1.3$
+% of the \package{subfig} package (Sigh!)}
+%
+% \begin{macrocode}
+\let\caption@koma@parindent\KV@caption@parindent
+\DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@koma@parindent{#1}%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@koma@parskip\KV@caption@parskip
+\DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@koma@parskip{#1}%
+ \fi}%
+% \end{macrocode}
+%
+% \section{Single-line-check}
+%
+% \begin{macro}{\ifonelinecaptions}
+% \changes{v1.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% Patch |\onelinecaptionstrue| and |onelinecaptionsfalse| so they will set the corresponding \package{caption3} setting, too.
+% \begin{macrocode}
+\g@addto@macro\onelinecaptionstrue{\caption@setsinglelinecheck{true}}%
+\g@addto@macro\onelinecaptionsfalse{\caption@setsinglelinecheck{false}}%
+% \end{macrocode}
+% \begin{macrocode}
+\ifonelinecaptions
+ \onelinecaptionstrue
+\else
+ \onelinecaptionsfalse
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Format}
+%
+% The `default' caption format was taken from \KOMAScript\ \cs{@makecaption} and adapted.
+% \begin{macrocode}
+\DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@useformat{hang}{#1}{#2}{#3}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+%
+% \section{Label format}
+%
+% The `default' caption label format maps to `autodot'.
+% \begin{macrocode}
+\SetCaptionDefault{labelformat}{autodot}
+% \end{macrocode}
+%
+% \section{Label separator}
+%
+% The `default' caption label separator maps to \cs{captionformat}.
+% \begin{macrocode}
+\DeclareCaptionLabelSeparator{default}{\captionformat}
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' fonts map to \cs{scr@fnt@caption} resp. \cs{scr@fnt@captonlabel}.
+% \begin{macrocode}
+\DeclareCaptionFont{scr@font}{\scr@fnt@caption}
+\DeclareCaptionFont{scr@labelfont}{\scr@fnt@captionlabel}
+\SetCaptionDefault{font}{scr@font}
+\SetCaptionDefault{labelfont}{scr@labelfont}
+% \end{macrocode}
+%
+% \section{Positioning}
+%
+% Here we patch the caption related \KOMAScript\ commands to set \package{caption} package settings as well.
+% Furthermore we take over the caption related settings from the \KOMAScript\ classes.
+%
+% \begin{macro}{\if@captionabove}
+% \changes{v1.0j}{2006/03/21}{Bugfix 06-03-21: \cs{let}\cs{caption@setposition}\cs{@gobble} added}
+% \changes{v1.0n}{2006/03/09}{Accidentally this got broken in \version{1.0m}, fixed}
+% \changes{v1.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now instead of \cs{captionabove/below}}
+% \changes{v1.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} for \env{longtable} added}
+% \changes{v1.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% \changes{v1.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
+% \changes{v1.8e}{2019/09/11}{\opt{figureposition} and \opt{tableposition} will now set the position anyway since it could be used by other packages}
+% Patch |\@captionabovetrue| and |\@captionabovefalse| so they will set the \package{caption3} position setting, too.
+% Note that these are stronger than the \opt{position} setting, therefore we override the options
+% \opt{figureposition} and \opt{tableposition} to typeout a warning.
+% \begin{macrocode}
+\g@addto@macro\@captionabovetrue{\caption@setposition{t}}%
+\g@addto@macro\@captionabovefalse{\caption@setposition{b}}%
+% \end{macrocode}
+% \begin{macrocode}
+\if@captionabove
+ \@captionabovetrue
+\else
+ \@captionabovefalse
+\fi
+% \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable:
+% \begin{macrocode}
+\AtBeginCaption{\caption@AtBeginLongtable{%
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@tablecaptionabove}
+% \changes{v1.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
+% Patch |\@tablecaptionabovetrue| and |\@tablecaptionabovefalse| so they will set the \package{caption3} position setting, too.
+% \begin{macrocode}
+\g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}%
+\g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}%
+% \end{macrocode}
+% \begin{macrocode}
+\if@tablecaptionabove
+ \@tablecaptionabovetrue
+\else
+ \@tablecaptionabovefalse
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@figurecaptionabove}
+% \changes{v1.5}{2013/02/15}{Support of \cs{if@figurecaptionabove} added}
+% Patch |\@figurecaptionabovetrue| and |\@figurecaptionabovefalse| so they will set the \package{caption3} position setting, too.
+% \begin{macrocode}
+\caption@ifdefined\@figurecaptionabovetrue{%
+ \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}%
+ \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}%
+% \end{macrocode}
+% \begin{macrocode}
+ \if@figurecaptionabove
+ \@figurecaptionabovetrue
+ \else
+ \@figurecaptionabovefalse
+ \fi}{}
+% \end{macrocode}
+% \end{macro}
+%
+% Since the \KOMAScript\ position setting overwrites the one from the \package{caption} package,
+% we re-define the options |figure|\-|position| and |table|\-|position| to issue a warning.
+% \Note{But we set the value anyway since it will be used by sub-captions.}
+%
+% \begin{macrocode}
+\AtCaptionPackage{%
+ \let\caption@koma@figureposition\KV@caption@figureposition
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{%
+ Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA-Script document class}%
+ \caption@koma@figureposition{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@koma@tableposition\KV@caption@tableposition
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{%
+ Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA-Script document class}%
+ \caption@koma@tableposition{#1}}}
+% \end{macrocode}
+%
+% \section{Adaption of \cs{caption} command}
+%
+% \begin{macro}{\scr@caption}
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr@caption\caption}|
+% so we need to update |\scr@caption| after the \package{caption} package has re-defined |\caption|.
+% \begin{macrocode}
+\AtBeginDocument{\let\scr@caption\caption}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-light.dtx b/Master/texmf-dist/source/latex/caption/caption-light.dtx
new file mode 100644
index 00000000000..3b9b9071121
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-light.dtx
@@ -0,0 +1,394 @@
+% \iffalse meta-comment
+%
+% This is file `caption-light.dtx'.
+%
+% Copyright (C) 2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{84}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-light.drv}[2020/08/24 v1.0 Customizing captions (AR)]
+\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\newcommand\LineBreak{\linebreak[3]}
+\newcommand\PageBreak{\pagebreak[3]}
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+ \addtolength\marginparwidth{15pt}
+ \ifdim\paperheight=297mm % a4paper
+ \renewcommand\LineBreak{\\}
+ \renewcommand\PageBreak{\clearpage}
+ \fi
+\fi
+%
+\usepackage[bottom]{footmisc}
+%
+\PassOptionsToPackage{breaklinks=true}{hyperref}
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, subcaption},pdfstartpage={},pdfstartview={}}
+%
+\usepackage{caption-light}[2020/08/23] % needs v1.0 or newer
+%
+\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+\let\package\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$}
+%
+\usepackage{marvosym}
+\makeatletter
+\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
+\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
+\makeatother
+%
+\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
+\newcommand*\NEW[2]{\MARGINSYM{\vskip2pt\footnotesize#1\\#2}}
+%
+\begin{document}
+ \DocInput{caption-light.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \let\subsectionautorefname\sectionautorefname
+% \let\subsubsectionautorefname\sectionautorefname
+%
+% \def\thispackage{the \package{caption-light} package}
+% \def\Thispackage{The \package{caption-light} package}
+%
+% \newcommand\NEWfeature{\NEW{New feature}}
+% \newcommand\NEWdescription{\NEW{New description}}
+%
+% \makeatletter
+% \def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+% \def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
+% \makeatother
+% \def\See#1{\nopagebreak{\small (See #1)}}
+%
+% \GetFileInfo{caption-light.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-light.sty}
+%
+% \title{\texorpdfstring{\Thispackage\thanks{%^^A
+% This package has version number \docversion.}}%^^A
+% {The caption-light package}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% \Thispackage\ offers (limited) customization of captions
+% in floating environments such |figure| and |table|.
+% \par\smallskip
+% \textit{Please note:} Many document classes already have build-in options and
+% commands for customizing captions.
+% If these possibilities are sufficient for you, there is usually no need for
+% you to use the \package{caption} package at all.
+% And if you are just interested in using the command \cs{captionof}, loading
+% of the very small \package{capt-of} package is usually sufficient.
+% \end{abstract}
+%
+% \iffalse\clearpage\fi
+% \setcounter{tocdepth}{2}
+% \tableofcontents
+%
+% \clearpage
+% \section{Loading the package}
+%
+% Load this package using
+% \begin{quote}
+% |\usepackage|\oarg{options}|{caption-light}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\usepackage{caption-light}|\\
+% \ldots\\
+% |\captionsetup|\marg{options}
+% \end{quote}
+% As opposite to the \package{caption} package only a limited set of options is
+% supported by \thispackage:
+% |aboveskip=|\ldots,
+% |belowskip=|\ldots,
+% |font=|\ldots,
+% |justification=|\ldots,
+% |labelfont=|\ldots,
+% |labelseparator=|\ldots,
+% |position=|\ldots,
+% |singlelinecheck=|\ldots,
+% |skip=|\ldots, and
+% |textfont=|\ldots
+%
+% See \package{caption} package documentation for the meaning and usage of
+% these options.
+%
+% \section{Commands}
+%
+% This package offers |\caption|\-|setup|, |\set|\-|caption|\-|type|, and
+% |\caption|\-|of| as well.
+%
+% \section{Why this package?}
+%
+% This package offers some advantages over the \package{caption} package:
+% \begin{itemize}
+% \item It does not depend on correct |\hsize| for "long" captions,
+% just like the original definition included in |article|, |report|, and |book|.
+% \item If the caption is typeset as "short" (centered), the content of
+% the caption is evaluated only once,
+% just like the original definition included in |article|, |report|, and |book|.
+% \item It does not re-define |\caption| and floating environments,
+% therefore avoiding incompatibilities.
+% \item It does not patch any other packages, therefore avoiding
+% incompatibilities.
+% \end{itemize}
+%
+% In short it's a more compatible and less troublesome variant of the
+% \package{caption} package, but (much) less powerful.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \StopEventually{%^^A
+% }
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \changes{v1.0}{2020/08/24}{First version}
+%
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{The implementation}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption-light}[2020/08/24 v1.0 Customizing captions (AR)]
+% \end{macrocode}
+%
+% \section{Loading the kernel}
+%
+% \begin{macrocode}
+\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
+% \end{macrocode}
+%
+% \section{Check against unknown document classes}
+%
+% \begin{macrocode}
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}}
+% \end{macrocode}
+%
+% \section{Check against incompatible packages}
+%
+% \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the caption-light package}%
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \section{Processing of options}
+%
+% \begin{macrocode}
+\caption@SetupOptions{caption-light}{\caption@setkeys{caption}{#2}}
+\caption@ProcessOptions*{caption-light}
+% \end{macrocode}
+%
+% \section{\cs{@makecaption}}
+%
+% If the \package{caption} package is loaded, we abort processing this file.
+% \begin{macrocode}
+\caption@ifdefined\caption@makecaption
+ {\caption@Info{\noexpand\caption@makecaption is already defined}%
+ \endinput}{}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@makecaption}
+% |\@makecaption|\marg{label}\marg{text}\\
+% We do basically the same as the original code (from the standard
+% \LaTeX\ document classes), but take care of selected settings
+% offered by the \package{caption3} kernel.
+% \begin{macrocode}
+\long\def\caption@makecaption#1#2{%
+ \caption@iftop\caption@belowskip\caption@aboveskip
+ \caption@labelseparator % defines \caption@iflabelfont and \caption@labelsep
+ \caption@singlelinecheck
+ {\sbox\@tempboxa{\caption@@makecaption{#1}{#2}}%
+ \ifdim \wd\@tempboxa >\hsize}%
+ {\iftrue}%
+ \caption@@makecaption{#1}{#2}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \caption@iftop\caption@aboveskip\caption@belowskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@@makecaption[2]{%
+ \caption@applyfont
+ {\captionlabelfont #1}%
+ {\caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep}%
+ {\captiontextfont #2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+% Patch |\@makecaption|, so our definition will be used.
+% \begin{macrocode}
+\let\@makecaption\caption@makecaption
+% \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{setcaptiontype}}
+%
+% We offer the options |type=| and |type*=|, too:
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+% \end{macrocode}
+% \begin{macrocode}
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macro}{\setcaptiontype}
+% |\setcaptiontype*|\marg{type}\\
+% For compatibility reasons we offer a starred variant as well,
+% but it does not differ from the non-starred variant here.
+% \begin{macrocode}
+\newcommand*\setcaptiontype{%
+ \caption@teststar{\def\@captype}{}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionof}
+% |\captionof*|\marg{type}\oarg{list-entry}\marg{text}\\
+% For compatibility reasons we offer a starred variant as well.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/caption/caption-memoir.dtx b/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
new file mode 100644
index 00000000000..1233515b1c8
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
@@ -0,0 +1,226 @@
+% \iffalse meta-comment
+%
+% This is file `caption-memoir.dtx'.
+%
+% Copyright (C) 2011-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{7}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-memoir.drv}[2018/05/24 v2.0 Implementation of the caption-memoir package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\begin{document}
+ \DocInput{caption-memoir.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-memoir.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-memoir.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \class{memoir} document class\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the memoir document class}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \class{memoir} document class.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.4a}{2011/10/21}{\class{memoir} class support added}
+% \changes{v2.0}{2020/07/27}{\class{memoir} class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-memoir.sto}[2020/07/31 v2.0 Adaption of the caption package to the memoir document class (AR)]
+% \end{macrocode}
+%
+% \section{Adaptions already included in the caption package}
+%
+% The following adaptions to the \class{memoir} document class are already included in the \package{caption} package:
+% \begin{itemize}
+% \item \cs{@caption} expands \cs{memcaptioninfo}
+% \item \cs{caption@prepareanchor} expands \cs{M@gettitle}
+% \item \cs{caption@refstepcounter} expands \cs{donemaincaptiontrue}
+% \item Since the \class{memoir} document class resets the sub-caption
+% counter at |\@float|, right after |\done|\-|main|\-|caption|\-|false|,
+% all sub-caption counters will be saved at |\done|\-|main|\-|caption|\-|false|
+% so they can (and will) be restored using |\caption@|\-|restore|\-|counters|
+% at |\continued|\-|float|.
+% \end{itemize}
+%
+% \section{Single-line-check}
+%
+% \begin{macro}{\caption@prepareslc}
+% \changes{v1.4a}{2011/10/21}{Redefinition of \cs{pagenote} from \textsf{memoir} document class added}
+% We re-define \cs{pagenote} here so it won't disturb the single-line-check.
+% \begin{macrocode}
+\g@addto@macro\caption@prepareslc{%
+ \let\pagenote\caption@gobble}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-ntg.dtx b/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
new file mode 100644
index 00000000000..61c6ed8116c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
@@ -0,0 +1,213 @@
+% \iffalse meta-comment
+%
+% This is file `caption-ntg.dtx'.
+%
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{8}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ntg.drv}[2020/08/01 v2.0 Implementation of the caption-ntg package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\DeclareRobustCommand*\NTG{NTG}
+%
+\begin{document}
+ \DocInput{caption-ntg.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-ntg.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-ntg.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \NTG\ document classes\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the NTG document classes}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the \NTG\ document classes.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.1}{2007/04/06}{\NTG\ class support added}
+% \changes{v2.0}{2020/08/01}{\NTG\ class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ntg.sto}[2020/08/22 v2.0 Adaption of the caption package to the NTG document classes (AR)]
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' fonts map to \cs{CaptionLabelFont} resp. \cs{CaptionTextFont}.
+% \begin{macrocode}
+\DeclareCaptionFont{ntg@labelfont}{\CaptionLabelFont}
+\DeclareCaptionFont{ntg@textfont}{\CaptionTextFont}
+\SetCaptionDefault{labelfont}{ntg@labelfont}
+\SetCaptionDefault{textfont}{ntg@textfont}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption-thesis.dtx b/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
new file mode 100644
index 00000000000..a26ea7b31a2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
@@ -0,0 +1,219 @@
+% \iffalse meta-comment
+%
+% This is file `caption-thesis.dtx'.
+%
+% Copyright (C) 2008-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%
+% --------------------------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Axel Sommerfeldt.
+%
+% This work consists of the files
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+% the derived files
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+% and the user manuals
+% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%
+% \fi
+% \CheckSum{9}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-thesis.drv}[2020/08/01 v2.0 Implementation of the caption-thesis package]
+\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
+%\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={}}
+%
+\begin{document}
+ \DocInput{caption-thesis.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
+% \let\class\puresf \let\package\puresf
+% \let\env\purett \let\opt\purett
+%
+% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+% \newcommand*\version[2][]{\textit{v#2}}
+%
+% \GetFileInfo{caption-thesis.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{caption-thesis.sto}
+%
+% \title{\texorpdfstring
+% {The adaption of the \package{caption} package to the \class{thesis} document class\thanks{%^^A
+% This adaption has version number \docversion.}}%^^A
+% {The adaption of the caption package to the thesis document class}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/caption}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package adapts the \package{caption} package to the thesis document class.
+% \end{abstract}
+%
+% \section*{User manual}
+%
+% This document is describing the code implementation only.
+% The user documentation can be found in
+% \nopagebreak\begin{quote}
+% \begin{tabular}{ll}
+% \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}%
+% {\texttt{caption-eng.pdf}} & The caption package bundle documentation \\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{}
+% \iffalse
+% \clearpage
+% \tableofcontents
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\if@minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
+% \DoNotIndex{\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
+%
+% \changes{v1.2a}{2008/01/31}{thesis class support added}
+% \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised}
+% \changes{v2.0}{2020/08/01}{thesis class support adapted to \package{caption3}~\version{2.0}}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+%
+% \iffalse
+%<*package>
+% \fi
+%
+% \section{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-thesis.sto}[2020/08/22 v2.0 Adaption of the caption package to the thesis document class (AR)]
+% \end{macrocode}
+%
+% \section{Format}
+%
+% The `default' format maps to `hang'.
+% \begin{macrocode}
+\SetCaptionDefault{format}{hang}
+% \end{macrocode}
+%
+% \section{Fonts}
+%
+% The `default' fonts map to \cs{cph@font} resp. \cs{cpb@font}.
+% \begin{macrocode}
+\DeclareCaptionFont{cph@font}{\cph@font}
+\DeclareCaptionFont{cpb@font}{\cpb@font}
+\SetCaptionDefault{labelfont}{cph@font}
+\SetCaptionDefault{textfont}{cpb@font}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx
index e75d4bd4311..0a029f8d387 100644
--- a/Master/texmf-dist/source/latex/caption/caption.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption.dtx
@@ -19,21 +19,25 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{3022}
+% \CheckSum{2715}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption.drv}[2015/09/16 v3.4 Implementation of the caption package]
+\ProvidesFile{caption.drv}[2015/09/16 v3.5 Implementation of the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -62,14 +66,6 @@
\DeclareRobustCommand*\eTeX{\texorpdfstring
{\leavevmode\hbox{$\varepsilon$}-\TeX}%
{e-TeX}}
-\DeclareRobustCommand*\AmS{\texorpdfstring
- {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
- {AMS}}
-\DeclareRobustCommand*\KOMAScript{\texorpdfstring
- {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
- {KOMA-Script}}
-\DeclareRobustCommand*\NTG{NTG}
-\DeclareRobustCommand*\SmF{SMF}
%
\begin{document}
\DocInput{caption.dtx}
@@ -92,15 +88,18 @@
%
% \newcommand*\issue[1]{GitLab~\##1}
%
+% \GetFileInfo{caption.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
% \GetFileInfo{caption.sty}
%
% \title{The Implementation of
% \texorpdfstring{\thispackage\thanks{%^^A
-% This package has version number \fileversion, last revised \filedate.}}%^^A
+% This package has version number \docversion.}}%^^A
% {the caption package}}
% \author{Axel Sommerfeldt\\
% \url{https://gitlab.com/axelsommerfeldt/caption}}
-% \date{\filedate}
+% \date{\docdate}
% \maketitle
%
% \begin{abstract}
@@ -218,13 +217,13 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/05/30 v3.4k Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/08/30 v3.5 Customizing captions (AR)]
% \end{macrocode}
%
% \section{Loading the kernel}
%
% \begin{macrocode}
-\RequirePackage{caption3}[2020/05/10] % needs v1.10 or newer
+\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
% \end{macrocode}
%
% \section{Check against unknown document classes}
@@ -523,223 +522,23 @@
\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
% \end{macrocode}
%
-% \section{\AmS{} \& \SmF{} document classes support}
-% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added}
+% \section{Document class support}
%
+% Execute the code declared with |\AtCaptionPackage|.
+% We do this right before processing the options so stuff done with
+% |\At|\-|Caption|\-|Package| could be overwritten by user options.
% \begin{macrocode}
-\caption@ifclassloaded{ams}{%
- \caption@InfoNoLine{AMS or SMF document class}%
-% \end{macrocode}
-% \begin{macrocode}
- \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
-% \end{macrocode}
-% \begin{macrocode}
-}{}
-% \end{macrocode}
-%
-% \section{\KOMAScript{} document classes support}
-% \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added}
-% \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added}
-% \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added}
-% \changes{v3.0l}{2007/02/18}{\KOMAScript\ compatibility revised}
-% \changes{v3.1}{2007/03/17}{\KOMAScript\ compatibility options removed}
-% \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced}
-%
-% \begin{macrocode}
-\caption@ifclassloaded{koma}{%
- \caption@InfoNoLine{KOMA-Script document class}%
-% \end{macrocode}
-%
-% Here we emulate the caption related commands and take over the caption
-% related settings from the \KOMAScript\ classes.
-%
-% \begin{macro}{\@tablecaptionabovetrue}
-% \begin{macro}{\@tablecaptionabovefalse}
-% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
-% \begin{macrocode}
- \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
- \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
-% \end{macrocode}
-% \begin{macrocode}
- \if@tablecaptionabove
- \@tablecaptionabovetrue
- \else
- \@tablecaptionabovefalse
- \fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@figurecaptionabovetrue}
-% \begin{macro}{\@figurecaptionabovefalse}
-% \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added}
-% \begin{macrocode}
- \caption@ifdefined\@figurecaptionabovetrue{%
-% \end{macrocode}
-% \begin{macrocode}
- \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
- \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
-% \end{macrocode}
-% \begin{macrocode}
- \if@figurecaptionabove
- \@figurecaptionabovetrue
- \else
- \@figurecaptionabovefalse
- \fi
-% \end{macrocode}
-% \begin{macrocode}
- }{}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\onelinecaptionstrue}
-% \begin{macro}{\onelinecaptionsfalse}
-% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
-% \begin{macrocode}
- \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
- \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
-% \end{macrocode}
-% \begin{macrocode}
- \ifonelinecaptions
- \onelinecaptionstrue
- \else
- \onelinecaptionsfalse
- \fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@captionabovetrue}
-% \begin{macro}{\@captionabovefalse}
-% \changes{v3.0j}{2006/03/21}{Bugfix 06-03-21:
-% \cs{let}\cs{caption@setposition}\cs{@gobble} added}
-% \changes{v3.0n}{2006/03/09}{Accidentally this got broken in \version{3.0m}, fixed}
-% \changes{v3.1}{2007/03/31}{We redefine \cs{captionabovetrue/false} now
-% instead of \cs{captionabove/below}}
-% \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}}
-% \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now}
-% \changes{v3.4}{2019/09/11}{\opt{figureposition} and \opt{tableposition} will now set the position anyway since it could be used by other packages}
-% Please note that these are stronger than the \opt{position} setting, therefore we
-% override the options \opt{figureposition} and \opt{tableposition} to typeout a warning.
-% \begin{macrocode}
- \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
- \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
-% \end{macrocode}
-% \begin{macrocode}
- \DeclareCaptionOption{figureposition}{%
- \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
- when used with a KOMA script document class}%
- \captionsetup*[figure]{position=#1}}
- \DeclareCaptionOption{tableposition}{%
- \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
- when used with a KOMA script document class}%
- \captionsetup*[table]{position=#1}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\setcapindent}
-% \begin{macrocode}
- \let\caption@KOMA@setcapindent\@setcapindent
- \renewcommand*\@setcapindent[1]{%
- \caption@KOMA@setcapindent{#1}\caption@setcapindent}
-% \end{macrocode}
-% \begin{macrocode}
- \let\caption@KOMA@@setcapindent\@@setcapindent
- \renewcommand*\@@setcapindent[1]{%
- \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\caption@setcapindent{%
- \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
- \caption@ifdefined\cap@indent{\caption@setcapindent}{}
-% \end{macrocode}
-%
-% \begin{macro}{\setcapwidth}
-% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
-% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
-% so we issue a warning if used.
-% (Since this does not seem to have an negative effect when used
-% by the \texttt{captionbeside} environment, we suppress the warning here.)}
-% \begin{macrocode}
- \expandafter\let\expandafter\caption@KOMA@setcapwidth
- \csname\string\setcapwidth\endcsname
- \@namedef{\string\setcapwidth}[#1]#2{%
- \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\caption@setcapwidth[1]{%
- \ifx\\#1\\\else
- \caption@ifdefined\cap@margin{%
- \def\@tempa{captionbeside}%
- \ifx\@tempa\@currenvir\else\caption@Warning{%
- Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
- \fi}{}%
- \fi
- \captionsetup{width=\cap@width}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
- \def\caption@tempa{\hsize}%
- \ifx\caption@tempa\cap@width \else
- \caption@setcapwidth{?}
- \fi
-% \end{macrocode}
-%
-% \begin{macro}{\setcapmargin}
-% \begin{macrocode}
- \expandafter\let\expandafter\caption@KOMA@setcapmargin
- \csname\string\@setcapmargin\endcsname
- \@namedef{\string\@setcapmargin}[#1]#2{%
- \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
-% \end{macrocode}
-% \begin{macrocode}
- \expandafter\let\expandafter\caption@KOMA@@setcapmargin
- \csname\string\@@setcapmargin\endcsname
- \@namedef{\string\@@setcapmargin}[#1]#2{%
- \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\caption@setcapmargin{%
- \begingroup
- \let\onelinecaptionsfalse\relax
- \def\@twoside{0}%
- \def\if@twoside{\def\@twoside{1}\iffalse}%
- \cap@margin
- \def\@tempa{\endgroup}%
- \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
- \def\hspace##1##{\@firstofone}%
- \edef\@tempa{\endgroup
- \noexpand\captionsetup{%
- twoside=\@twoside,slc=0,%
- margin={\cap@left,\cap@right}}}%
- \fi\fi
- \@tempa}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
- \ifx\cap@margin\relax \else
- \caption@setcapmargin
- \fi
-% \end{macrocode}
-%
-% \begin{macrocode}
-}{}
+\caption@documentclass@code
+\let\caption@documentclass@code\@undefined
+\let\AtCaptionPackage\@firstofone
% \end{macrocode}
%
% \section{Processing of options}
%
% \changes{v3.0m}{2007/03/04}{Verbose option added}
% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
-%
% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
+%
% \begin{macrocode}
\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
\caption@ProcessOptions*{caption}
@@ -884,9 +683,8 @@
\caption@if@minipage\@minipagetrue\@minipagefalse}%
\caption@end}
% \end{macrocode}
-% \textsf{memoir} document class stuff:
+% \class{memoir} document class stuff:
% \begin{macrocode}
-\providecommand\M@gettitle[1]{}
\providecommand\memcaptioninfo[4]{}
% \end{macrocode}
% \end{macro}
@@ -900,6 +698,10 @@
\caption@ifhypcap\caption@@start\relax
\M@gettitle{#2}}
% \end{macrocode}
+% \class{memoir} document class stuff:
+% \begin{macrocode}
+\providecommand\M@gettitle[1]{}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makecaption}
@@ -938,25 +740,13 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\caption@aboveskip}
-% \begin{macro}{\caption@belowskip}
-% \changes{v3.3a}{2019/04/02}{This macro added}
-% |\caption@aboveskip|\\
-% |\caption@belowskip|\par
-% Typesets the skip above resp.~below the caption.
-% \begin{macrocode}
-\newcommand*\caption@aboveskip{%
- \vskip\abovecaptionskip}
-% \end{macrocode}
+% \begin{macro}{\caption@redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
% \begin{macrocode}
-\newcommand*\caption@belowskip{%
- \vskip\belowcaptionskip}
+\newcommand*\caption@redefine{}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
-% \begin{macro}{\caption@redefine}
-% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
% were well known, so documents written in the old (\package{caption} package \version{1.x}) days
% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
@@ -964,8 +754,8 @@
% but is simply overcautious and especially unwanted by the user nowadays.
% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
% `compatibility' option is set to `v1'.
+%
% \begin{macrocode}
-\newcommand*\caption@redefine{}
\g@addto@macro\caption@redefine{%
% \end{macrocode}
% \begin{macrocode}
@@ -979,13 +769,13 @@
\renewcommand*\caption@redefine{}%
% \end{macrocode}
%
-% |\continuedfloat| is not supported in compatibility mode.
+% |\continuedfloat| is not supported in compatibility mode `v1'.
% \begin{macrocode}
\renewcommand*\caption@continuedfloat[1]{%
- \caption@Error{Not available in compatibility mode}}%
+ \caption@Error{Not available with option `compatibility=v1'}}%
% \end{macrocode}
%
-% |\caption@start| is not supported in compatibility mode.
+% |\caption@start| is not supported in compatibility mode `v1'.
% \begin{macrocode}
\caption@AtBeginDocument*{%
\let\caption@start\relax
@@ -1029,22 +819,50 @@
% \begin{macro}{\@xfloat}
% \changes{v3.1}{2007/05/09}{This re-definition added}
% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
-% We redefine |\@xfloat| so inside floating environments our
-% type-specific options will be used, a \package{hyperref}
-% anchor will be set etc.
+% \changes{v3.5}{2020/08/30}{Hook added}
+% We redefine |\@x|\-|float| so inside floating environments our
+% type-specific options will be used, a \package{hyperref}
+% anchor will be set etc.
% \begin{macrocode}
\let\caption@ORI@xfloat\@xfloat
+% \end{macrocode}
+% \begin{macrocode}
\def\@xfloat#1[#2]{%
\caption@ORI@xfloat{#1}[#2]%
- \caption@settype{#1}}%
+ \caption@settype{#1}%
+ \caption@xfloat@hook}%
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+ \newcommand*\caption@xfloat@hook{}%
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@xdblfloat}
+% \changes{v3.5}{2020/08/30}{Re-definition of \cs{xdblfloat} added}
+% We redefine |\@xdbl|\-|float|, too, so special options for |figure*|
+% resp.~|table*| will be applied here.
% \begin{macrocode}
-}
+ \let\caption@ORI@xdblfloat\@xdblfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \def\@xdblfloat#1[#2]{%
+ \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+ \caption@setoptions{#1*}%
+ \caption@xdblfloat@hook}%
+% \end{macrocode}
+% Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
+% (The caption type could be found in |\@cap|\-|type|.)
+% \begin{macrocode}
+ \newcommand*\caption@xdblfloat@hook{}%
% \end{macrocode}
% \end{macro}
%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
% Some packages (like the \package{hyperref} package for example) redefines
% |\caption| and |\@caption|, too.
% So we have to use |\AtBeginDocument| here, so we can make sure
@@ -1071,7 +889,7 @@
% \end{macrocode}
% \end{macro}
%
-% \section{\cs{captionof}}
+% \section{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
%
% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
@@ -1101,9 +919,10 @@
% \begin{macro}{\setcaptiontype}
% \changes{v3.2}{2010/10/24}{This macro added}
% \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
+% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
% Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
% \begin{macrocode}
-\newcommand\setcaptiontype{%
+\def\setcaptiontype{%
\caption@boxrestore@mini
\caption@settype}
% \end{macrocode}
@@ -1213,21 +1032,43 @@
%
% \begin{macro}{\caption@checktype}
% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
-% |\setcaptiontype| should not be used with a subtype,
-% and |\setcaptionsubtype| should not be used with an undefined subtype.
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checktype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
+% |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
% \begin{macrocode}
\newcommand*\caption@checktype[1]{%
- \caption@ifsubtype{#1}%
- {\caption@Error{Should not be used with subtype `#1'}%
- \@gobble}%
- \@firstofone}
+ \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
+ {\caption@Error{Should not be used with subtype `#1'}%
+ \@gobble}%
+ \@firstofone}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checksubtype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
+% |\caption@checksubtype|\marg{type}\marg{code}\par
+% is used by |\caption@settype| and should either expand the code or issue an error
+% if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% Since the |sub|\-|float|\-|row| environment offered by the \package{floatrow} package\cite{floatrow}
+% is using |\caption|\-|setup{sub|\-|type}| even if the sub-type was defined by |\new|\-|sub|\-|float|
+% offered by \package{subfig}\cite{subfig}, we take a more relaxed view of things here and allow
+% those sub-types as well (but not without warning since we do not support this).
% \begin{macrocode}
\newcommand*\caption@checksubtype[1]{%
\caption@ifsubtype{#1}%
- \@firstofone
- {\caption@Error{Undefined subtype `#1'}%
- \@gobble}}
+ \@firstofone
+ {\caption@ifin@list\sf@counterlist{#1}%
+ {\caption@Warning{%
+ \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
+ This is not designed to work; you could try replacing\MessageBreak
+ the `subfig' package with `subcaption' to resolve\MessageBreak
+ this problem which occurred}%
+ \@firstofone}%
+ {\caption@Error{Undefined subtype `#1'}%
+ \@gobble}}}
% \end{macrocode}
% \end{macro}
%
@@ -1235,24 +1076,21 @@
% \changes{v3.1}{2007/07/15}{This macro and its usage added}
% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
+% \changes{v3.5}{2019/09/11}{Relies on \eTeX{} now}
% Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
% inside a group or not -- in the latter case a warning message will
-% be issued. (needs \eTeX)
-% \begin{macrocode}
-\caption@ifeTeX{%
- \newcommand*\caption@checkgrouplevel[2]{%
- \@ifundefined{#1caption@grouplevel}{%
- \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
- \ifnum\currentgrouplevel>\caption@grouplevel\relax
- \expandafter\edef\csname #1caption@grouplevel\endcsname{%
- \the\currentgrouplevel}%
- \else
- \caption@Warning{\string#2\MessageBreak outside box or environment}%
- \fi
- }{}}%
-}{%
- \let\caption@checkgrouplevel\@gobbletwo
-}
+% be issued.
+% \begin{macrocode}
+\newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}%
% \end{macrocode}
% \end{macro}
%
@@ -1314,6 +1152,7 @@
% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
+% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
% |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
% |\captionof*|\oarg{lst\_entry}\marg{heading}\par
% \Note{This will be defined with \cs{AtBeginDocument} so
@@ -1324,7 +1163,7 @@
\def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+\providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
% \end{macrocode}
% \end{macro}
%
@@ -1364,6 +1203,7 @@
% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
+% \changes{v3.5}{2020/07/28}{Adapted to \package{caption3} v2.0}
% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
% \begin{macrocode}
\newcommand*\captionbox{%
@@ -1377,12 +1217,12 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\caption@iibox#1#2#3[#4]{%
- \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@hj@default}
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
% \end{macrocode}
% \begin{macrocode}
\long\def\caption@iibox@#1#2#3#4{%
\setbox\@tempboxa\hbox{#4}%
- \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@hj@default]{\unhbox\@tempboxa}}
+ \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
% \end{macrocode}
% \begin{macrocode}
\long\def\caption@iiibox#1{%
@@ -1399,28 +1239,28 @@
\caption@setposition t%
#2{\caption#4{#5}}%
\captionbox@hrule
- \csname caption@hj@#7\endcsname
+ \csname caption@justification@#7\endcsname
#8}%
}{%
\endgroup
\parbox[b]{#6}{%
#1\relax
\caption@setposition b%
- \csname caption@hj@#7\endcsname
+ \csname caption@justification@#7\endcsname
#8%
\captionbox@hrule
#3{\caption#4{#5}}}%
}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\captionbox@hj@default{c}
+\newcommand*\captionbox@innerpos@default{c}
\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
% \end{macrocode}
% \begin{macrocode}
-\providecommand*\caption@hj@c{\centering}
-\providecommand*\caption@hj@l{\raggedright}
-\providecommand*\caption@hj@r{\raggedleft}
-\providecommand*\caption@hj@s{}
+\providecommand*\caption@justification@c{\centering}
+\providecommand*\caption@justification@l{\raggedright}
+\providecommand*\caption@justification@r{\raggedleft}
+\providecommand*\caption@justification@s{}
% \end{macrocode}
% \end{macro}
%
@@ -1576,7 +1416,7 @@
% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part,
% therefore ending this part, so we set the flag to |false| in this case.)
% \begin{macrocode}
- \caption@fixposition
+ \caption@fixposition % TODO: Make this independant on the "position" setting
\caption@iftop\caption@setflag\caption@clrflag2% caption
% \end{macrocode}
% This part does not contain content (like sub-figures) yet,
@@ -1718,22 +1558,21 @@
% \end{macrocode}
% \end{macro}
%
-% \changes{v3.0a}{2004/01/23}{%
-% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
-% \changes{v3.0h}{2005/10/06}{%
-% Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
+% \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
+% \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
%
% \begin{macro}{\caption@setfnum}
% \changes{v3.1}{2007/03/10}{This macro added}
+% \changes{v3.5}{2020/08/03}{Adapted to \package{caption3} v2.0}
% |\caption@setfnum|\marg{type}\\
-% redefines |\fnum@|\meta{type} according the caption label format
-% set with |labelformat=|. But if |labelformat=default| is set,
-% |\fnum@|\meta{type} will not be overwritten by us.
+% stores the original definition of |\fnum@|\meta{type} in |\caption@fnum@|\meta{type}
+% and re-defines it according the caption label format set with |label|\-|format=|.
% \begin{macrocode}
\newcommand*\caption@setfnum[1]{%
- \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
- \@namedef{fnum@#1}{\caption@fnum{#1}}%
- \fi}
+ \@ifundefined{caption@fnum@#1}%
+ {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+ \@namedef{fnum@#1}{\caption@fnum{#1}}}%
+ {}}
% \end{macrocode}
% \end{macro}
%
@@ -1795,16 +1634,11 @@
%
% \begin{macro}{\caption@normalsize}
% \changes{v3.1}{2007/05/05}{This macro and its usage added}
-% This one will be used by |\@caption| instead of |\normalsize|.\par
-% Its code is equivalent to
-% \begin{quote}
-% |\caption@font{normal}%|
-% \end{quote}
-% but executes faster (since the starred form of |\caption@font|
-% does not use |\setkeys| internally).
+% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
+% This one will be used by |\@caption| instead of |\normalsize|.
% \begin{macrocode}
\newcommand*\caption@normalsize{%
- \caption@font*{\KV@caption@fnt@normal\@unused}}
+ \caption@font@normal\@unused}
% \end{macrocode}
% \end{macro}
%
@@ -1858,30 +1692,6 @@
% \section{Support for sub-captions}
% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
%
-% \begin{macro}{\caption@DeclareSubType}
-% |\caption@DeclareSub| initializes the usage of \cs{caption}
-% in sub-floats.
-% \begin{macrocode}
-\def\caption@DeclareSubType sub#1\@nil{%
- \caption@Debug{Initializing subtype for `#1'\@gobble}%
- \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
-\@onlypreamble\caption@DeclareSubType
-% \end{macrocode}
-% \end{macro}
-%
-% Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
-% \begin{macrocode}
-\caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
-% \end{macrocode}
-%
-% Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
-% \begin{macrocode}
-\caption@AtBeginDocument*{%
- \caption@ifdefined\sf@counterlist{%
- \@for\sf@temp:=\sf@counterlist\do{%
- \expandafter\caption@DeclareSubType\sf@temp\@nil}}{}}
-% \end{macrocode}
-%
% \begin{macro}{\caption@subtypehook}
% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
@@ -1895,6 +1705,7 @@
% \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
% \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
+% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
% Hook, will be used inside \cs{caption@setsubtype}.\par
% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
@@ -1925,7 +1736,7 @@
\let\caption@chkfloat\@gobbletwo
% \end{macrocode}
% \begin{macrocode}
- \caption@setbox{none}%
+ \caption@set{box}{none}%
\caption@clearmargin
\caption@iflist{}{\let\caption@setlist\@gobble}%
\caption@setoptions{sub}%
@@ -2094,181 +1905,117 @@
% \end{macrocode}
% \end{macro}
%
+% \section{Babel package support}
%
-% \section{Document class \& Babel package support}
-%
-% \subsection{The \AmS{} \& \SmF{} classes}
-% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+% \subsection{The arabic \& farsi babel option}
+% \changes{v3.5}{2020/08/02}{\package{arabic} babel support addded}
%
% \begin{macrocode}
-\caption@ifdefined\smf@makecaption{\let\smf@makecaption\@makecaption}{}
+\caption@IfBabelArabi{%
% \end{macrocode}
%
-% \subsection{The beamer class}
-% \changes{v3.1}{2007/03/10}{beamer class support added}
+% The \package{arabicore} package re-defines |\@make|\-|caption|, |\fnum@figure|, and |\fnum@table|
+% incompatible to the \package{caption} package, therefore we have to restore our resp.~the original definitions here.
%
% \begin{macrocode}
-\@ifclassloaded{beamer}{%
- \caption@InfoNoLine{beamer document class}%
+ \let\@makecaption\caption@makecaption
+ \def\fnum@figure{\figurename\nobreakspace\thefigure}%
+ \def\fnum@table{\tablename\nobreakspace\thetable}%
% \end{macrocode}
%
-% \begin{macro}{\figure}
-% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
-% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
-% We redefine |figure| so our type-specific options will be used etc.
-% \begin{macrocode}
- \let\caption@ORI@figure\figure
- \def\figure{\caption@settype{figure}\caption@ORI@figure}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\table}
-% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
-% \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised}
-% \changes{v3.4a}{2019/10/18}{Bug fixed which was introduced in previous revision}
-% We redefine |table| so our type-specific options will be used etc.
-% \begin{macrocode}
- \let\caption@ORI@table\table
- \def\table{\caption@settype{table}\caption@ORI@table}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macrocode}
}{}
% \end{macrocode}
%
-% \subsection{The \KOMAScript{} classes}
-%
-% \KOMAScript\ contains the code
-% |\AtBeginDocument{\let\scr@caption\caption}|
-% so we need to update |\scr@caption| here, too.
+% \subsection{The frenchle \& frenchpro package}
+% \changes{v3.0h}{2005/10/03}{\package{frenchle/pro} package support added}
+% \changes{v3.5}{2020/08/01}{\package{frenchle/pro} package support updated}
%
% \begin{macrocode}
-\caption@ifdefined\scr@caption{%
- \caption@AtBeginDocument{\let\scr@caption\caption}}{}
+\caption@IfFrenchLe{%
% \end{macrocode}
%
-% \subsection{The frenchb Babel option}
-% \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added}
-%
-% Suppress
-% ``Package |frenchb.ldf| Warning: The definition of |\@makecaption| has been
-% changed, frenchb will NOT customize it.''
-% (but only if we emulate this customization)
+% \begin{macro}{\f@ffrench}
+% \begin{macro}{\f@tfrench}
+% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
+% when used in French mode. These contain additional code which typesets
+% the caption separator |\caption|\-|separator| instead of the usual colon.
+% Because this breaks with our |\@make|\-|caption| code we have to remove
+% this additional code here.
% \begin{macrocode}
-\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \let\@eatDP\@undefined
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
-% \subsection{The frenchle/pro package}
-% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
-%
+% Since the \package{frenchle} package overwrites |\@make|\-|caption| (within |\GO|\-|french|),
+% we need to save it beforehand and restore it afterwards.
% \begin{macrocode}
-\caption@AtBeginDocument{\caption@ifdefined\frenchTeXmods{%
- \caption@InfoNoLine{frenchle/pro package is loaded}%
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \g@addto@macro\GOfrench{%
+ \let\@makecaption\caption@original@makecaption}%
% \end{macrocode}
%
% \begin{macrocode}
- \let\captionfont@ORI\captionfont
- \let\captionlabelfont@ORI\captionlabelfont
- \let\@makecaption@ORI\@makecaption
-% \end{macrocode}
-
-% If |\GOfrench| is defined as |\relax| all the re-definitions regarding
-% captions have already been done, so we can do our patches immediately.
-% Otherwise we must add our stuff to |\GOfrench|.
-% \begin{macrocode}
- \caption@ifdefined\GOfrench
- {\def\caption@tempa{\g@addto@macro\GOfrench}}%
- {\let\caption@tempa\@firstofone}%
- \caption@tempa{%
+}{}
% \end{macrocode}
%
-% \begin{macrocode}
- \let\captionfont\captionfont@ORI
- \let\captionfont@ORI\@undefined
- \let\captionlabelfont\captionlabelfont@ORI
- \let\captionlabelfont@ORI\@undefined
- \let\@makecaption\@makecaption@ORI
- \let\@makecaption@ORI\@undefined
-% \end{macrocode}
+% \subsection{The hungarian \& magyar babel option}
+% \changes{v3.2}{2009/03/29}{\package{magyar} babel support added}
+% \changes{v3.3}{2018/08/26}{\package{magyar} babel support revised}
+% \changes{v3.5}{2020/08/02}{\package{magyar} babel support updated}
%
-% \begin{macro}{\@cnORI}
-% We update the definition of |\@cnORI| so it actually reflects
-% our definition of |\caption|.
% \begin{macrocode}
- \let\@cnORI\caption
+\caption@IfBabelHungarian{%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\@tablescaption}
-% The \package{frenchle/pro} package sets |\caption| to |\@tablescaption| at
-% |\begin{table}| for special treatment of footnotes.
-% Therefore we have to patch |\@tablescaption| so |\caption*| will work
-% inside the |table| environment.
+% Since the \package{magyar} package tends to overwrite |\@make|\-|caption|
+% we save it beforehand and restore it afterwards.
+% \Note{Currently it will not be overwritten, caused by a side-effect of a
+% work-around for the \package{floatrow} package within \package{caption3}.}
+%
% \begin{macrocode}
- \let\caption@tcORI\@tablescaption
- \def\@tablescaption{\caption@star\relax\caption@tcORI}%
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \let\@makecaption\caption@original@makecaption}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \let\@makecaption\caption@original@makecaption}}{}%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\f@ffrench}
-% \begin{macro}{\f@tfrench}
-% |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
-% when used in French mode. These contain additional code which typesets
-% the caption separator |\captionseparator| instead of the usual colon.
-% Because this breaks with our |\@makecaption| code we have to remove
-% this additional code here.
% \begin{macrocode}
- \let\@eatDP\@undefined
- \let\caption@tempa\@empty
- \ifx\f@ffrench\fnum@figure
- \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
- \fi
- \ifx\f@tfrench\fnum@table
- \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
- \fi
- \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
- \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
- \caption@tempa
+}{}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
+%
+% \subsection{The latvian babel option}
+% \changes{v3.5}{2020/08/02}{\package{latvian} babel support updated}
%
% \begin{macrocode}
- }%
-}{}}
+\caption@IfBabelLatvian{%
% \end{macrocode}
%
-% \subsection{The hungarian and magyar Babel option}
-% \changes{v3.2}{2009/03/29}{\package{magyar} package support added}
-% \changes{v3.3}{2018/08/26}{\package{magyar} package support revised}
+% The \package{latvian} package re-defines |\@make|\-|caption| incompatible to the \package{caption} package,
+% therefore we have to restore our definitions here.
%
% \begin{macrocode}
-\def\caption@tempa#1{%
- \@ifpackagewith{babel}{#1}{%
- \caption@InfoNoLine{#1 babel option is loaded}%
- \expandafter\addto\csname extras#1\endcsname{%
- % reverse changes made by magyar.ldf
- \let\@makecaption\caption@makecaption
- \babel@save\@makecaption
- \caption@redefine
- \babel@save\@caption}%
- }{}}
+ \let\@makecaption\caption@makecaption
% \end{macrocode}
+%
% \begin{macrocode}
-\caption@tempa{hungarian}%
-\caption@tempa{magyar}%
+}{}
% \end{macrocode}
%
% \section{Package support}
-% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.
-% are not supported anymore, removed}
+% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.~are not supported anymore, removed}
%
% \begin{macro}{\caption@IfPackageLoaded}
-% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added,
-% so no extra check is needed}
-% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
-% to \cs{caption@IfPackageLoaded}}
+% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, so no extra check is needed}
+% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage} to \cs{caption@IfPackageLoaded}}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
@@ -2507,7 +2254,7 @@
\fi}%
% \end{macrocode}
% \begin{macrocode}
-\AtBeginCaption{\caption@test@adjustwidth}
+ \AtBeginCaption{\caption@test@adjustwidth}%
% \end{macrocode}
% \end{macro}
%
@@ -2633,7 +2380,7 @@
% \begin{macro}{\float@makebox}
% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
-% Redefine |\float@makebox| (only if we are not operating in compatibility mode).
+% Redefine |\float@makebox| (only if we are not operating in compatibility mode `v1').
% \begin{macrocode}
\caption@AtBeginDocument{\caption@ifcompatibility{}{%
% \end{macrocode}
@@ -2673,8 +2420,7 @@
% \begin{macrocode}
\newcommand*\caption@float@setname[1]{%
\expandafter\ifx\csname #1name\endcsname\relax
- \expandafter\let\csname #1name\expandafter\endcsname
- \csname fname@#1\endcsname
+ \expandafter\let\csname #1name\expandafter\endcsname\csname fname@#1\endcsname
\fi}%
% \end{macrocode}
% \end{macro}
@@ -3307,18 +3053,9 @@
% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
% \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
% To support the \package{listings} package we need to redefine
-% |\lst@MakeCaption| so the original stuff is nested with
+% |\lst@Make|\-|Caption| so the original stuff is nested with
% |\caption@begin| and |\caption@end| etc.\par
-% Unfortunately |\lst@MakeCaption| is sometimes used with |\linewidth| intact but sometimes with |\linewidth| adapted.
-% So we either could write a bunch of very ugly code which is using internals of the \package{listings} package, or
-% we could simply ignore this fact since |\hsize| will be left untouched by the \package{listings} package.
-% (This is the reason why the caption is mis-aligned when using one of the options |linewidth=|, |xleftmargin=|, |yleftmargin=|, or |resetmargins=|,
-% even if the \package{caption} package isn't used. This needs to be fixed within the \package{listings} package, for example by using
-% |\lst@MakeCaption| inside a parbox of correct width.)
-%
-% The \package{listings} package calls |\lst@MakeCaption| sometimes with original |\linewidth|, sometimes with adapted |\linewidth|.
-% So we need to detect if |\linewidth| is already adapted or not.
-% We realize this by setting a flag inside the "Init" hook of the \package{listings} package (where the adaption takes place).
+% We set a flag inside the "Init" hook of the \package{listings} package (where adaption of |\line|\-|width| etc.~takes place).
% \begin{macrocode}
\caption@setbool{lst@Init}{0}%
\lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
@@ -3332,28 +3069,8 @@
% \begin{macrocode}
\begingroup
% \end{macrocode}
-% \begin{macrocode}
-%% \caption@Debug{%
-%% linewidth=\lst@linewidth,
-%% xleftmargin=\lst@xleftmargin,\MessageBreak
-%% xrightmargin=\lst@xrightmargin,
-%% resetmargins=\lst@ifresetmargins true\else false\fi}%
-% \end{macrocode}
-% If |\linewidth| isn't adapted by the \package{listings} package yet, do the adaption now.
-% \begin{macrocode}
-%% \caption@iflst@Init{}{%
-%% \linewidth\lst@linewidth\relax
-%% \lst@ifresetmargins
-%% \advance\linewidth\@totalleftmargin
-%% \advance\linewidth\rightmargin
-%% \@totalleftmargin\z@
-%% \fi
-%% \advance\linewidth-\lst@xleftmargin
-%% \advance\linewidth-\lst@xrightmargin
-%% \advance\@totalleftmargin\lst@xleftmargin\relax}%
-% \end{macrocode}
-% Inside lists the \package{listings} package ignores the left margin (|\@totalleftmargin|) for captions.
-% We emulate this behaviour by adding a negativ skip which will be typeset ahead of |\caption@box|.\par
+% Inside lists the \package{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
+% We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
% Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
% \begin{macrocode}
\caption@iflst@Init{}{%
@@ -3432,6 +3149,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@AtBeginLongtable}
+% \changes{v3.5}{2018/04/15}{This macro added}
+% \begin{macrocode}
+\providecommand*\caption@LT@array{}
+\newcommand\caption@AtBeginLongtable{%
+ \g@addto@macro\caption@LT@array}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
% \end{macrocode}
@@ -3442,85 +3168,81 @@
%
% \begin{macro}{\LT@array}
% \changes{v3.1}{2007/07/22}{This redefinition added}
-% \changes{v3.1a}{2007/09/14}{Bugfix 07-09-14: Redefinition of \cs{@captionabovetrue} \& \cs{@captionabovefalse} added}
% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
-% We redefine |\LT@array| here to get |\captionsetup|\marg{options}
-% working inside |longtable|s.
+% \changes{v3.5}{2018/04/15}{Usage of \cs{caption@AtBeginLongtable} added}
+% We redefine |\LT@array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
% and since this only works with the original definition of \cs{LT@array},
-% we have to do this after the \package{hyperref} package,
-% i.e.~\cs{AtBeginDocument}.}
+% we have to do this after the \package{hyperref} package, i.e.~\cs{AtBeginDocument}.}
% \begin{macrocode}
\caption@AtBeginDocument{%
\let\caption@ORI@LT@array\LT@array
\renewcommand*\LT@array{%
+ \caption@LT@array
+ \caption@ORI@LT@array}}%
% \end{macrocode}
-% |\captionsetup| for longtable:
% \begin{macrocode}
- \global\let\caption@opt@@longtable\@undefined
- \def\captionsetup{%
- \noalign\bgroup
- \@ifstar\@captionsetup\@captionsetup}% gobble *
- \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
- \def\LT@captionsetup##1{%
- \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
- \global\let\caption@opt@@longtable\caption@opt@@longtable}%
-% \end{macrocode}
-% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
+ \caption@AtBeginLongtable{%
+% |\captionsetup| for longtable:
% \begin{macrocode}
- \def\@captionabovetrue{\LT@captionsetup{position=t}}%
- \def\@captionabovefalse{\LT@captionsetup{position=b}}%
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
+ \def\LT@captionsetup#1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{#1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
% \end{macrocode}
% |\captionlistentry| for longtable:
% \begin{macrocode}
- \def\captionlistentry{%
- \noalign\bgroup
- \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
- {\egroup\LT@listentry\LTcaptype}}%
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
+ {\egroup\LT@listentry\LTcaptype}}%
% \end{macrocode}
% |\continuedfloat| for longtable:\\
% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
% \begin{macrocode}
-% \caption@ifhypcap{%
-% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
-% \def\hyper@makecurrent##1{%
-% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
-% \caption@makestart{##1}%
-%% \let\Hy@LT@currentHlabel\@currentHlabel
-% \let\Hy@LT@currentHref\@currentHref
-% \def\hyper@makecurrent####1{%
-%% \let\@currentHlabel\Hy@LT@currentHlabel
-% \let\@currentHref\Hy@LT@currentHref}}%
-% \let\caption@ORI@continuedfloat\continuedfloat
-% \def\continuedfloat{\noalign{%
-% \gdef\caption@setContinuedFloat{%
-% \let\caption@reset@continuedfloat\@gobble}%
-% \def\caption@setoptions####1{%
-% \g@addto@macro\caption@setContinuedFloat{%
-% \caption@setoptions{####1}}}%
-% \let\@captype\LTcaptype
-% \caption@ORI@ContinuedFloat}}%
-% }{%
-% \def\continuedfloat{\noalign{%
-% \caption@Error{%
-% \noexpand\continuedfloat inside longtables\MessageBreak
-% is only available with `hypcap=true'}}}%
-% }%
-% \global\let\caption@setContinuedFloat\@empty
- \def\continuedfloat{\noalign{%
- \caption@Error{\noexpand\continuedfloat outside float}}}%
+% \caption@ifhypcap{%
+% \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
+% \def\hyper@makecurrent##1{%
+% \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
+% \caption@makestart{##1}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+% \let\Hy@LT@currentHref\@currentHref
+% \def\hyper@makecurrent####1{%
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+% \let\@currentHref\Hy@LT@currentHref}}%
+% \let\caption@ORI@continuedfloat\continuedfloat
+% \def\continuedfloat{\noalign{%
+% \gdef\caption@setContinuedFloat{%
+% \let\caption@reset@continuedfloat\@gobble}%
+% \def\caption@setoptions##1{%
+% \g@addto@macro\caption@setContinuedFloat{%
+% \caption@setoptions{##1}}}%
+% \let\@captype\LTcaptype
+% \caption@ORI@ContinuedFloat}}%
+% }{%
+% \def\continuedfloat{\noalign{%
+% \caption@Error{%
+% \noexpand\continuedfloat inside longtables\MessageBreak
+% is only available with `hypcap=true'}}}%
+% }%
+% \global\let\caption@setContinuedFloat\@empty
+ \def\continuedfloat{\noalign{%
+ \caption@Error{\noexpand\continuedfloat outside float}}}%
% \end{macrocode}
% |\bicaption| for longtable:
% \begin{macrocode}
- \let\bicaption\LT@bicaption
+ \let\bicaption\LT@bicaption
% \end{macrocode}
-%
% \begin{macrocode}
- \caption@ORI@LT@array}}%
+ }%
% \end{macrocode}
% \end{macro}
%
@@ -3543,10 +3265,8 @@
% \end{macro}
%
% \begin{macro}{\LT@makecaption}
-% \changes{v3.0d}{2004/08/10}{%
-% Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
-% \changes{v3.0e}{2005/05/05}{%
-% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
+% \changes{v3.0d}{2004/08/10}{Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
+% \changes{v3.0e}{2005/05/05}{Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
@@ -3573,19 +3293,16 @@
\caption@LT@make{%
\caption@LT@settype\LTcaptype
% \end{macrocode}
-%
% |\caption@LT@setup| is re-defined inside the \package{bicaption} package
% and contains the preparation of typesetting of the bilingual caption.
% \begin{macrocode}
\caption@LT@setup
% \end{macrocode}
-%
% \iffalse
% The default |position=| setting for longtables is |top|.
% (This emulates the standard behavior of the \package{longtable} package
% which has no skip above the caption but a skip below it.)
% \fi
-%
% |position=auto| is a bad idea for longtables, but we do our very best.
% This works quite well for captions inside the longtable contents, but
% not for captions inside the longtable (end)foot.
@@ -3593,22 +3310,18 @@
% \begin{macrocode}
\caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
% \end{macrocode}
-%
% We set |\ifcaption@star| according the 1st argument.
% \begin{macrocode}
\caption@startrue#1\caption@starfalse
% \end{macrocode}
-%
% \begin{macrocode}
\caption@prepare@stepcounter\LTcaptype{LT}%
% \end{macrocode}
-%
-% \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added}
+% \changes{v3.1}{2007/05/05}{\cs{caption@font@normal} added}
% \begin{macrocode}
\caption@begin\LTcaptype
\caption@normalsize
% \end{macrocode}
-%
% The following skip has the purpose to correct the height of the
% |\parbox[t]|. Usually it's the height of the very first line, but
% because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
@@ -3621,16 +3334,14 @@
% \begin{macrocode}
\vskip-\ht\strutbox
% \end{macrocode}
-%
-% Work-around for problem with \package{floatrow}:
-% The |\belowcaptionskip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
-% so we supress this skip if the \package{floatrow} package is loaded.
-% (This fixes \issue{50})
+% Work-around for problem with \package{floatrow}:
+% The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
+% so we supress this skip if the \package{floatrow} package is loaded.
+% (This fixes \issue{50})
% \begin{macrocode}
\caption@ifdefined\FBifcaptop{%
\let\caption@belowskip\@empty}{}%
% \end{macrocode}
-%
% The following code should look familiar. We do our skips and use
% |\caption@@make| to typeset the caption itself.
% \begin{macrocode}
@@ -3701,7 +3412,10 @@
% \end{macro}
%
% \begin{macrocode}
-}{}
+}{%
+ \let\caption@AtBeginLongtable\@gobble
+ \let\caption@LT@array\@undefined
+}
% \end{macrocode}
%
% \begin{macro}{\caption@LT@setup}
@@ -4068,7 +3782,7 @@
\def\caption@setSC@justify{%
\caption@clearmargin
\ifx\SC@justify\@empty \else
- \let\caption@hj\SC@justify
+ \let\caption@justification\SC@justify
\let\SC@justify\@empty
\fi}%
% \end{macrocode}
@@ -4191,8 +3905,7 @@
% \package{supertabular} package: If |\topcaption| was used,
% the position will be |top| automatically, |bottom| otherwise.
% \begin{macrocode}
- \def\caption@fixposition{%
- \caption@setposition{\if@topcaption t\else b\fi}}%
+ \caption@setposition{\if@topcaption t\else b\fi}%
% \end{macrocode}
% \begin{macrocode}
\caption@beginex{#1}{#2}{#3}%
@@ -4258,8 +3971,7 @@
\caption@setoptions{xtabular}%
% \end{macrocode}
% \begin{macrocode}
- \def\caption@fixposition{%
- \caption@setposition{\if@topcaption t\else b\fi}}%
+ \caption@set{position}{\if@topcaption t\else b\fi}%
% \end{macrocode}
% \begin{macrocode}
\@initisotab
@@ -4292,7 +4004,7 @@
\let\caption@ORI@threeparttable\threeparttable
\renewcommand*\threeparttable{%
\caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
-%%% \caption@setposition a% ?
+%%% \caption@setposition{auto}% ?
\caption@clearmargin
\caption@setoptions{threeparttable}%
\caption@ORI@threeparttable}%
@@ -4305,7 +4017,7 @@
\let\caption@ORI@measuredfigure\measuredfigure
\renewcommand*\measuredfigure{%
\caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
-%%% \caption@setposition a% ?
+%%% \caption@setposition{auto}% ?
\caption@clearmargin
\caption@setoptions{measuredfigure}%
\caption@ORI@measuredfigure}%
@@ -4430,24 +4142,6 @@
%
% \clearpage
% \begin{thebibliography}{99}
-% \bibitem{beamer}
-% Till Tantau:\\
-% \href{http://www.ctan.org/pkg/beamer}%
-% {\emph{The beamer class, User Guide for version 3.25}},\\
-% December 26, 2012
-%
-% \bibitem{KOMAScript}
-% Markus Kohm \& Jens-Uwe-Morawski:\\
-% \href{http://www.ctan.org/pkg/koma-script}%
-% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
-% 2012-07-22
-%
-% \bibitem{NTG}
-% Victor Eijkhout:\\
-% \href{http://www.ctan.org/pkg/ntgclass}%
-% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
-% 3 September 1989
-%
% \bibitem{float}
% Anselm Lingnau:\\
% \href{http://www.ctan.org/pkg/float}%
diff --git a/Master/texmf-dist/source/latex/caption/caption.ins b/Master/texmf-dist/source/latex/caption/caption.ins
index d6ea31962f1..188347ba15c 100644
--- a/Master/texmf-dist/source/latex/caption/caption.ins
+++ b/Master/texmf-dist/source/latex/caption/caption.ins
@@ -25,30 +25,41 @@ This work has the LPPL maintenance status "maintained".
This Current Maintainer of this work is Axel Sommerfeldt.
This work consists of the files
- caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
- bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+ caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+ caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+ caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+ caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
the derived files
- caption.sty, caption2.sty, caption3.sty,
- bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+ caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+ caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+ caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+ caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
and the user manuals
caption-deu.tex, caption-eng.tex, caption-rus.tex.
\endpreamble
\generate{\file{caption.sty}{\from{caption.dtx}{package}}}
+\generate{\file{caption-light.sty}{\from{caption-light.dtx}{package}}}
\generate{\file{caption2.sty}{\from{caption2.dtx}{package}}}
\generate{\file{caption3.sty}{\from{caption3.dtx}{package}}}
+
+\generate{\file{caption-ams-smf.sto}{\from{caption-ams-smf.dtx}{package}}}
+\generate{\file{caption-beamer.sto}{\from{caption-beamer.dtx}{package}}}
+\generate{\file{caption-elsarticle.sto}{\from{caption-elsarticle.dtx}{package}}}
+\generate{\file{caption-koma.sto}{\from{caption-koma.dtx}{package}}}
+\generate{\file{caption-memoir.sto}{\from{caption-memoir.dtx}{package}}}
+\generate{\file{caption-ntg.sto}{\from{caption-ntg.dtx}{package}}}
+\generate{\file{caption-thesis.sto}{\from{caption-thesis.dtx}{package}}}
+
\generate{\file{bicaption.sty}{\from{bicaption.dtx}{package}}}
\generate{\file{ltcaption.sty}{\from{ltcaption.dtx}{package}}}
\generate{\file{subcaption.sty}{\from{subcaption.dtx}{package}}}
-\generate{\file{totalcount.sty}{\from{totalcount.dtx}{package}}}
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the files}
-\Msg{* `caption.sty', `caption2.sty', 'caption3.sty',}
-\Msg{* `bicaption.sty', `ltcaption.sty', `subcaption.sty',}
-\Msg{* and `totalcount.sty' into a directory searched by TeX.}
+\Msg{* `*.sty' and `*.sto' into a directory searched by TeX.}
\Msg{*}
\Msg{* To produce the documentation run the file}
\Msg{* `caption-eng.tex' (English version) or `caption-rus.tex'}
diff --git a/Master/texmf-dist/source/latex/caption/caption2.dtx b/Master/texmf-dist/source/latex/caption/caption2.dtx
index 2b6f3c73c2b..074dd7c6303 100644
--- a/Master/texmf-dist/source/latex/caption/caption2.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption2.dtx
@@ -19,11 +19,15 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx
index 8edc856461b..5f2823ac0b0 100644
--- a/Master/texmf-dist/source/latex/caption/caption3.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption3.dtx
@@ -19,21 +19,25 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{3606}
+% \CheckSum{3636}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption3.drv}[2020/05/30 v1.12 Implementation of the caption kernel]
+\ProvidesFile{caption3.drv}[2019/09/10 v2.0 Implementation of the caption kernel]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -57,16 +61,11 @@
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
%
-\usepackage{caption3}[2020/05/30]
+\usepackage{caption3}[2020/07/27]
%
-\DeclareRobustCommand*\AmS{\texorpdfstring
- {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
- {AMS}}
-\DeclareRobustCommand*\KOMAScript{\texorpdfstring
- {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
- {KOMA-Script}}
-\DeclareRobustCommand*\NTG{NTG}
-\DeclareRobustCommand*\SmF{SMF}
+\DeclareRobustCommand*\eTeX{\texorpdfstring
+ {\leavevmode\hbox{$\varepsilon$}-\TeX}%
+ {e-TeX}}
%
\begin{document}
\DocInput{caption3.dtx}
@@ -74,28 +73,31 @@
%</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\env\purett \let\opt\purett
%
-% \def\thispackage{the \package{caption} kernel}
-% \def\Thispackage{The \package{caption} kernel}
-%
% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
% \newcommand*\version[2][]{\textit{v#2}}
%
+% \GetFileInfo{caption3.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
% \GetFileInfo{caption3.sty}
%
% \title{The Implementation of
% \texorpdfstring{\thispackage\thanks{%^^A
-% This package has version number \fileversion, last revised \filedate.}}%^^A
+% This package has version number \docversion.}}%^^A
% {the caption kernel}}
% \author{Axel Sommerfeldt\\
% \url{https://gitlab.com/axelsommerfeldt/caption}}
-% \date{\filedate}
+% \date{\docdate}
% \maketitle
%
% \begin{abstract}
@@ -174,8 +176,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: \package{caption} \& \package{caption3}}
%
% \iffalse
% --------------------------------------------------------------------------- %
@@ -191,38 +192,17 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/07/20 v1.12b caption3 kernel (AR)]
-% \end{macrocode}
-%
-% \section{Workaround for bug in package \package{arabtex}}
-% \package{arabtex} re-defines \cs{@gobble} as not-long so the packages of the
-% \package{caption} package bundle are doomed to fail.
-% Since this fatal bug won't be fixed in \package{arabtex} but we are dependent on a
-% proper definition of \cs{@gobble}, \cs{@firstofone}, \cs{@firstoftwo}, \cs{@secondoftwo},
-% and so on we fix this here. (Sigh!)
-% \begin{macrocode}
-\providecommand\caption@FixArabTeX{%
- \def\caption@tempa##1{}%
- \ifx\caption@tempa\@gobble
- \PackageInfo{caption3}{Fixing ArabTeX}%
- \long\def\@gobble##1{}%
- \fi}
-% \end{macrocode}
-% Do the fix now and at |\begin{document}|, in case \package{arabtex} will be loaded after \package{caption}.
-% \begin{macrocode}
-\caption@FixArabTeX
-\AtBeginDocument{%
- \caption@FixArabTeX
- \let\caption@FixArabTeX\@undefined}
+\ProvidesPackage{caption3}[2020/08/30 v2.0 caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Generic helpers}
%
% \begin{macro}{\@nameundef}
-% This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
-% We use it to remove the definition of some commands and keyval options after
-% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
-% with |\captionsetup|\oarg{type}.
+% |\@nameundef|\marg{command name}\\
+% is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel.
+% We use it to remove the definition of some commands and keyval options after
+% |\begin{document}| (to save \TeX\ memory) and to remove caption options defined
+% with |\captionsetup|\oarg{type}.
% \begin{macrocode}
\providecommand*\@nameundef[1]{%
\expandafter\let\csname #1\endcsname\@undefined}
@@ -231,34 +211,24 @@
%
% \begin{macro}{\l@addto@macro}
% \changes{v1.5}{2013/04/26}{Revised}
-% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
-% globally adds tokens to existing macros, like in |\AtBeginDocument|.
-% This is the same but it works local, not global.
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname currentgrouplevel\endcsname\relax
- \PackageInfo{caption3}{TeX engine: TeX}
- \let\caption@ifeTeX\@secondoftwo
- \providecommand\l@addto@macro[2]{%
- \begingroup
- \toks@\expandafter{#1#2}%
- \xdef\caption@addto@temp{\the\toks@}%
- \endgroup
- \let#1\caption@addto@temp}
-\else
- \PackageInfo{caption3}{TeX engine: e-TeX}
- \let\caption@ifeTeX\@firstoftwo
- \providecommand\l@addto@macro[2]{%
- \edef#1{\unexpanded\expandafter{#1#2}}}
-\fi
+% \changes{v2.0}{2019/09/11}{Relies on \eTeX{} now}
+% |\l@addto@macro|\marg{command}\marg{code}\\
+% The \LaTeXe\ kernel offers the internal helper macro |\g@addto@macro| which
+% globally adds tokens to existing macros, like in |\AtBeginDocument|.
+% This one is the same but it works locally, not globally.
+% \begin{macrocode}
+\providecommand\l@addto@macro[2]{%
+ \edef#1{\unexpanded\expandafter{#1#2}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bothIfFirst}
% \begin{macro}{\bothIfSecond}
-% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
-% tests if the second argument is not empty. If yes both arguments get
-% typeset, otherwise none of them.
+% |\bothIfFirst|\marg{code no. 1}\marg{code no. 2}\\
+% |\bothIfSecond|\marg{code no. 1}\marg{code no. 2}\\
+% |\bothIfFirst| tests if the first argument is not empty, |\bothIfSecond|
+% tests if the second argument is not empty. If yes both arguments get
+% typeset, otherwise none of them.
% \begin{macrocode}
\def\bothIfFirst#1#2{%
\protected@edef\caption@tempa{#1}%
@@ -279,44 +249,53 @@
% \begin{macro}{\caption@ifundefined}
% \changes{v1.3a}{2011/08/12}{This macro added}
% \changes{v1.3b}{2011/08/18}{Made expandable}
-% Similar to \cs{@ifundefined} offered by the \LaTeX kernel,
-% but takes a macro as argument instead of a macro name.
+% |\caption@ifundefined|\marg{command}\marg{yes-code}\marg{no-code}\\
+% is similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a command as argument instead of a command name.
% \begin{macrocode}
\newcommand*\caption@ifundefined[1]{%
- \ifx#1\@undefined
- \expandafter\@firstoftwo
- \else\ifx#1\relax
- \expandafter\expandafter\expandafter\@firstoftwo
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
\else
- \expandafter\expandafter\expandafter\@secondoftwo
- \fi\fi}
+ \expandafter\@firstoftwo
+ \fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifdefined}
% \changes{v1.8e}{2018/05/11}{This macro added}
-% Similar to \cs{@ifundefined} offered by the \LaTeX kernel,
-% but takes a macro as argument instead of a macro name.
+% |\caption@ifdefined|\marg{command}\marg{yes-code}\marg{no-code}\\
+% is similar to \cs{@ifundefined} offered by the \LaTeX kernel,
+% but takes a command as argument instead of a command name.
% \begin{macrocode}
\newcommand*\caption@ifdefined[1]{%
- \ifx#1\@undefined
- \expandafter\@secondoftwo
- \else\ifx#1\relax
- \expandafter\expandafter\expandafter\@secondoftwo
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \else
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \fi
\else
- \expandafter\expandafter\expandafter\@firstoftwo
- \fi\fi}
+ \expandafter\@secondoftwo
+ \fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifinlist}
% \changes{v1.1}{2007/07/29}{Rewritten}
-% This helper macro checks if the first argument is in the comma separated
-% list which is offered as second argument. So for example
-% \begin{quote}
-% |\caption@ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
-% \end{quote}
-% would expand to |yes|.
+% |\caption@ifinlist|\marg{element}\marg{list}\marg{yes-code}\marg{no-code}\\
+% This helper command checks if the \meta{element} is in the comma separated
+% \meta{list}. So for example
+% \begin{quote}
+% |\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
+% its syntax should not change.)
% \begin{macrocode}
\newcommand*\caption@ifinlist{%
\@expandtwoargs\caption@@ifinlist}
@@ -337,7 +316,9 @@
%
% \begin{macro}{\caption@ifin@list}
% \changes{v1.1}{2007/08/12}{This macro added}
-% |\caption@ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+% |\caption@ifin@list|\marg{cmd}\marg{element}\marg{yes-code}\marg{no-code}\\
+% is the same as |\caption@ifinlist| but with a command (containing a list)
+% instead of the list itself.
% \begin{macrocode}
\newcommand*\caption@ifin@list[2]{%
\caption@ifempty@list#1%
@@ -348,7 +329,9 @@
%
% \begin{macro}{\caption@g@addto@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@g@addto@list|\marg{cmd}\marg{list entry}
+% |\caption@g@addto@list|\marg{cmd}\marg{element}\\
+% adds an element to a command containing a list.
+% (The command will get defined if it isn't defined yet.)
% \begin{macrocode}
\newcommand*\caption@g@addto@list[2]{%
\caption@ifempty@list#1{\gdef#1{#2}}{\g@addto@macro#1{,#2}}}
@@ -356,7 +339,8 @@
% \end{macro}
% \begin{macro}{\caption@l@addto@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@l@addto@list|\marg{cmd}\marg{list entry}
+% |\caption@l@addto@list|\marg{cmd}\marg{element}\\
+% is the same as |\caption@g@addto@list| but works locally.
% \begin{macrocode}
\newcommand*\caption@l@addto@list[2]{%
\caption@ifempty@list#1{\def#1{#2}}{\l@addto@macro#1{,#2}}}
@@ -365,7 +349,10 @@
%
% \begin{macro}{\caption@g@removefrom@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@g@removefrom@list|\marg{cmd}\marg{list entry}
+% |\caption@g@removefrom@list|\marg{cmd}\marg{element}\\
+% removes an element from a command containing a list.
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list.}
% \begin{macrocode}
\newcommand*\caption@g@removefrom@list[2]{%
\caption@l@removefrom@list#1{#2}%
@@ -374,9 +361,10 @@
% \end{macro}
% \begin{macro}{\caption@l@removefrom@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@l@removefrom@list|\marg{cmd}\marg{list entry}\par
-% \Note[Caveat]{\meta{cmd} will be expanded during this process since
-% \cs{@removeelement} is using \cs{edef} to build the new list!}
+% |\caption@l@removefrom@list|\marg{cmd}\marg{element}\\
+% is the same as |\caption@g@removefrom@list| but works locally.
+% \Note[Caveat]{\meta{cmd} will be expanded during this process since
+% \cs{@removeelement} is using \cs{edef} to build the new list.}
% \begin{macrocode}
\newcommand*\caption@l@removefrom@list[2]{%
\caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
@@ -385,19 +373,22 @@
%
% \begin{macro}{\caption@for@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@for@list|\marg{cmd}\marg{code with \#1}
+% |\caption@for@list|\marg{cmd}\marg{code with \#1}\\
+% iterates all elements of the list (within \meta{cmd}) using the given
+% \meta{code}.
% \begin{macrocode}
\newcommand*\caption@for@list[2]{%
- \caption@ifempty@list#1{}{%
- \def\caption@tempb##1{#2}%
- \@for\caption@tempa:=#1\do{%
- \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+ \caption@ifempty@list#1{}%
+ {\def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifempty@list}
% \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption@ifempty@list|\marg{cmd}\marg{true}\marg{false}
+% |\caption@ifempty@list|\marg{cmd}\marg{yes-code}\marg{no-code}\\
+% This helper command checks if the list (within \meta{cmd}) is empty.
% \begin{macrocode}
\newcommand*\caption@ifempty@list[1]{%
\ifx#1\@undefined
@@ -416,30 +407,33 @@
%
% \pagebreak[3]
% \begin{macro}{\caption@setbool}
-% \begin{macro}{\caption@set@bool}
% \changes{v1.1}{2007/04/05}{\cs{caption@set@bool}\marg{cmd}\marg{value} added}
% \begin{macro}{\caption@ifbool}
+% \changes{v1.1}{2020/08/02}{\cs{caption@if@bool}\marg{value} added}
% \begin{macro}{\caption@undefbool}
-% For setting and testing boolean options we offer these three helper macros:
-% \begin{quote}
-% |\caption@setbool|\marg{name}\marg{value}\\
-% | |(with |value = false/true/no/yes/off/on/0/1|)\\
-% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
-% |\caption@undefbool|\marg{name}
-% \end{quote}
+% For setting and testing boolean options we offer these three helper macros:
+% \begin{quote}
+% |\caption@setbool|\marg{name}\marg{value}\\
+% | |(with |value = false/true/no/yes/off/on/0/1|)\\
+% |\caption@ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+% |\caption@undefbool|\marg{name}
+% \end{quote}
% \begin{macrocode}
\newcommand*\caption@setbool[1]{%
\expandafter\caption@set@bool\csname caption@if#1\endcsname}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@set@bool[2]{%
- \caption@ifinlist{#2}{1,true,yes,on}{%
- \let#1\@firstoftwo
- }{\caption@ifinlist{#2}{0,false,no,off}{%
- \let#1\@secondoftwo
- }{%
- \caption@Error{Undefined boolean value `#2'}%
- }}}
+ \caption@if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@if@bool[1]{%
+ \caption@ifinlist{#1}{1,true,yes,on}%
+ {\@firstoftwo}%
+ {\caption@ifinlist{#1}{0,false,no,off}%
+ {}%
+ {\caption@Error{Undefined boolean value `#1'}}%
+ \@secondoftwo}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
@@ -450,21 +444,31 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{\caption@teststar}
% \changes{v1.1}{2007/05/08}{This macro and its usage added}
% \changes{v1.1e}{2007/10/28}{\cs{caption@teststar@} added}
-% |\caption@teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
-% |\caption@teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+% |\caption@teststar|\marg{cmd}\marg{star-arg}\marg{non-star-arg}\\
+% expands \meta{cmd} with either argument \marg{star-arg} or
+% \meta{non-star-arg}, depending on if the next char is a star (or not).\par
+% |\caption@teststar@|\marg{cmd}\marg{star-arg}\marg{non-star-arg}\\
+% will test the catcode of the character \@ additionally.
% \begin{macrocode}
-\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+\newcommand*\caption@teststar[3]{%
+ \@ifstar{#1{#2}}{#1{#3}}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@teststar@[3]{%
\@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
\AtBeginDocument{\let\caption@teststar@\caption@teststar}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifatletter}
+% \changes{v1.1e}{2007/10/28}{This macro added}
+% |\caption@ifatletter|\marg{yes-code}\marg{no-code}\\
+% will either expand \meta{yes-code} or \meta{no-code},
+% depending on the catcode of the character \@.
% \begin{macrocode}
\newcommand*\caption@ifatletter{%
\ifnum\the\catcode`\@=11
@@ -472,6 +476,8 @@
\else
\expandafter\@secondoftwo
\fi}
+% \end{macrocode}
+% \begin{macrocode}
\AtBeginDocument{\let\caption@ifatletter\@secondoftwo}
% \end{macrocode}
% \end{macro}
@@ -479,7 +485,9 @@
% \begin{macro}{\caption@withoptargs}
% \changes{v1.1}{2007/08/12}{This macro added}
% \changes{v1.5}{2012/04/09}{This macro revised}
-% |\caption@withoptargs|\marg{cmd}
+% |\caption@withoptargs|\marg{cmd}\\
+% collects a star and all optional arguments, and expands \meta{cmd}
+% afterwards with the collected stuff as first argument.
% \begin{macrocode}
\newcommand*\caption@withoptargs[1]{%
\@ifstar
@@ -506,8 +514,8 @@
%
% \begin{macro}{\caption@gobble}
% \changes{v1.4}{2011/08/19}{This macro added}
-% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par
-% Same as |\@gobble|, but gobbles optional arguments as well.
+% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\\
+% is similar to |\@gobble| but gobbles a star and optional arguments as well.
% \begin{macrocode}
\DeclareRobustCommand*\caption@gobble{%
\caption@withoptargs\@gobbletwo}
@@ -517,11 +525,11 @@
% \begin{macro}{\caption@AtBeginDocument}
% \changes{v1.1}{2007/04/13}{This macro and its usage added}
% \changes{v1.2e}{2010/01/09}{Adapted to the combine document class}
-% |\caption@AtBeginDocument*|\marg{code}\\
-% Same as |\AtBeginDocument| but the execution of code
-% will be surrounded by two |\PackageInfo|s.
-% The starred variant causes the code to be executed after all code
-% specified using the non-starred variant.
+% |\caption@AtBeginDocument*|\marg{code}\\
+% is similar to |\AtBeginDocument| but the execution of code will be
+% surrounded by two |\Package|\-|Info|s.
+% The starred variant causes the code to be executed after all code
+% specified using the non-starred variant.
% \begin{macrocode}
\let\caption@begindocumenthook\@empty
\let\caption@@begindocumenthook\@empty
@@ -557,7 +565,8 @@
%
% \begin{macro}{\caption@Info}
% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
-% |\caption@Info|\marg{message}
+% |\caption@Info|\marg{message}\\
+% issues an info message (with code line indication).
% \begin{macrocode}
\newcommand*\caption@Info[1]{%
\PackageInfo{caption}{#1}}
@@ -565,10 +574,11 @@
% \end{macro}
% \begin{macro}{\caption@InfoNoLine}
% \changes{v1.3}{2010/10/25}{Moved from package to kernel}
-% |\caption@InfoNoLine|\marg{message}\\
-% \Note{The \cs{@gobble} at the end of the 2nd argument of
-% \cs{PackageInfo} suppresses the line number info.
-% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
+% |\caption@InfoNoLine|\marg{message}\\
+% issues an info message without code line indication.
+% \Note{The \cs{@gobble} at the end of the 2nd argument of
+% \cs{PackageInfo} suppresses the line number info.
+% See TLC2\cite{TLC2}, A.4.7, p885 for details.}
% \begin{macrocode}
\newcommand*\caption@InfoNoLine[1]{%
\caption@Info{#1\@gobble}}
@@ -577,7 +587,8 @@
%
% \begin{macro}{\caption@Warning}
% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
-% |\caption@Warning|\marg{message}
+% |\caption@Warning|\marg{message}\\
+% issues a warning message (with code line indication).
% \begin{macrocode}
\newcommand*\caption@Warning[1]{%
\caption@WarningNoLine{#1\on@line}}
@@ -585,7 +596,8 @@
% \end{macro}
% \begin{macro}{\caption@WarningNoLine}
% \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
-% |\caption@WarningNoLine|\marg{message}
+% |\caption@WarningNoLine|\marg{message}\\
+% issues a warning message without code line indication.
% \begin{macrocode}
\newcommand*\caption@WarningNoLine[1]{%
\PackageWarning{caption}{#1.^^J\caption@wh\@gobbletwo}}
@@ -600,7 +612,8 @@
% \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors}
% \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}}
% \changes{v1.1b}{2007/09/18}{Usage of \cs{caption@Package} removed}
-% |\caption@Error|\marg{message}
+% |\caption@Error|\marg{message}\\
+% issues an error message (with code line indication).
% \begin{macrocode}
\newcommand*\caption@Error[1]{%
\PackageError{caption}{#1}\caption@eh}
@@ -615,6 +628,9 @@
%
% \begin{macro}{\caption@KV@err}
% \changes{v1.1b}{2007/09/18}{This macro added}
+% |\caption@KV@err|\marg{message}\\
+% will be used to issue an error while parsing the key-value (package)
+% options.
% \begin{macrocode}
\let\caption@KV@err\caption@Error
% \end{macrocode}
@@ -622,15 +638,15 @@
%
% \section{Using the keyval package}
%
-% We need the \package{keyval} package for option handling, so we load it here.
+% We need the \package{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]
% \end{macrocode}
%
% \begin{macro}{\undefine@key}
-% |\undefine@key|\marg{family}\marg{key}\par
-% This helper macro is the opposite of |\define@key|, it removes a keyval
-% definition.
+% |\undefine@key|\marg{family}\marg{key}\\
+% is the opposite of |\define@key|, it removes a keyval definition.
% \begin{macrocode}
\providecommand*\undefine@key[2]{%
\@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
@@ -640,8 +656,9 @@
% \begin{macro}{\@onlypreamble@key}
% \changes{v1.1}{2007/07/22}{This macro added}
% \changes{v1.1e}{2007/11/01}{\cs{KV@err} will be used now instead of \cs{@notprerr}}
-% |\onlypreamble@key|\marg{family}\marg{key}\par
-% Analogous to |\@onlypreamble| from \LaTeXe.
+% |\onlypreamble@key|\marg{family}\marg{key}\\
+% marks a keyval definition only valid in the document preamble, analogous to
+% |\@only|\-|preamble| from \LaTeXe.
% \begin{macrocode}
\providecommand*\@preamble@keys{}
\providecommand*\@onlypreamble@key[2]{\@cons\@preamble@keys{{#1}{#2}}}
@@ -660,13 +677,12 @@
% \end{macro}
%
% \begin{macro}{\DeclareCaptionOption}
-% |\DeclareCaptionOption|\marg{option}\oarg{default value}\marg{code}\\
-% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\par
-% We declare our options using these commands (instead of using
-% |\DeclareOption| offered by \LaTeXe), so the keyval package is used.
-% The starred form makes the option available during the lifetime of the
-% current package only, so they can be used with |\usepackage|, but
-% \emph{not} with |\captionsetup| later on.
+% |\DeclareCaptionOption*|\marg{option}\oarg{default value}\marg{code}\\
+% We declare our options using these commands (instead of using
+% |\Declare|\-|Option| offered by \LaTeXe), so the keyval package is used.
+% The starred form makes the option available during the lifetime of the
+% current package only, so they can be used with |\use|\-|package|, but
+% \emph{not} with |\caption|\-|setup| later on.
% \begin{macrocode}
\newcommand*\DeclareCaptionOption{%
\caption@teststar\caption@declareoption\AtEndOfPackage\@gobble}
@@ -680,15 +696,15 @@
% \begin{macrocode}
\newcommand*\caption@declare@option{%
\define@key{caption}}
-%% no \@onlypreamble\caption@declare@option, will be used by \captionsetup
+%% no \@onlypreamble\caption@declare@option since it will be used by \captionsetup
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DeclareCaptionOptionNoValue}
% \changes{v1.1c}{2007/10/06}{This macro added}
-% |\DeclareCaptionOptionNoValue|\marg{option}\marg{code}\\
-% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\par
-% Same as \cs{DeclareCaptionOption} but issues an error if a value is given.
+% |\DeclareCaptionOptionNoValue*|\marg{option}\marg{code}\\
+% is the same as |\DeclareCaptionOption| but issues an error if a value is
+% given.
% \begin{macrocode}
\newcommand*\DeclareCaptionOptionNoValue{%
\caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
@@ -713,8 +729,8 @@
%
% \begin{macro}{\ifcaptionsetup@star}
% \changes{v1.2a}{2008/01/12}{This macro added}
-% If the starred form of |\captionsetup| is used, this will be set to |true|.
-% (It will be reset to |false| at the end of |\caption@setkeys|.)
+% If the starred form of |\captionsetup| is used, this will be set to |true|.
+% (It will be reset to |false| at the end of |\caption@set|\-|keys|.)
% \begin{macrocode}
\newif\ifcaptionsetup@star
% \end{macrocode}
@@ -728,13 +744,13 @@
% \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now}
% \changes{v1.5}{2012/04/09}{Support of multiple optional arguments added}
% \changes{v1.8h}{2020/01/03}{Syntax check of saved options added}
-% |\captionsetup|\oarg{type}\ldots\marg{keyval-list of options}\\
-% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\par
-% If the optional argument `type' is specified, we simply save or append
-% the option list, otherwise we `execute' it with |\setkeys|.
-% (The non-starred variant issues a warning if \meta{keyval-list of options}
-% is not used later on.)
-% \Note{The starred variant will be used inside packages automatically.}
+% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\\
+% applies the given list of options.
+% If the optional argument `type' is specified, we simply save or append
+% the option list, otherwise we `execute' it with |\set|\-|keys|.
+% (The non-starred variant issues a warning if \meta{keyval-list of options}
+% is not used later on.)
+% \Note{The starred variant will be used inside packages automatically.}
% \begin{macrocode}
\newcommand*\captionsetup{%
\caption@teststar@\@captionsetup\@gobble\@firstofone}
@@ -773,7 +789,8 @@
%
% \begin{macro}{\caption@checkoptions}
% \changes{v1.8h}{2020/01/03}{This macro added}
-% Check the syntax of the given options by executing them inside a group.
+% |\caption@checkoptions|\marg{keyval-list of options}\\
+% checks the syntax of the given options by executing them inside a group.
% \begin{macrocode}
\newcommand*\caption@checkoptions[1]{%
\begingroup
@@ -788,8 +805,9 @@
%
% \begin{macro}{\IfCaptionOptionCheck}
% \changes{v1.10}{2020/05/10}{This macro added}
-% |\IfCaptionOptionCheck|\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if options are just checked for syntax, and \meta{no-code} if not.
+% |\IfCaptionOptionCheck|\marg{yes-code}\marg{no-code}\\
+% executes the \meta{yes-code} if options are just checked for syntax,
+% and \meta{no-code} if not.
% \begin{macrocode}
\let\IfCaptionOptionCheck\@secondoftwo
% \end{macrocode}
@@ -804,12 +822,11 @@
% \changes{v1.1}{2007/08/17}{Starred variant added}
% \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically}
% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
-% |\clearcaptionsetup|\oarg{option}\marg{type}\\
-% |\clearcaptionsetup*|\oarg{option}\marg{type}\par
-% This removes the saved option list associated with \meta{type}.
-% If \meta{option} is given, only this option will be removed from the list.
-% (The starred variant does not issue warnings.)
-% \Note{The starred variant will be used inside packages automatically.}
+% |\clearcaptionsetup*|\oarg{option}\marg{type}\\
+% removes the saved option list associated with \meta{type}.
+% If \meta{option} is given, only this option will be removed from the list.
+% (The starred variant does not issue warnings.)
+% \Note{The starred variant will be used inside packages automatically.}
% \begin{macrocode}
\newcommand*\clearcaptionsetup{%
\caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
@@ -867,9 +884,9 @@
% \changes{v1.0d}{2005/05/03}{Optimized for memory usage}
% \changes{v1.1}{2007/07/29}{Bugfix: Does not expand option list anymore}
% \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
-% |\showcaptionsetup|\oarg{package}\marg{type}\par
-% This comes for debugging issues: It shows the saved option list which
-% is associated with \meta{type}.
+% |\showcaptionsetup|\oarg{package}\marg{type}\\
+% shows the saved option list which is associated with \meta{type}
+% (as warning message).
% \begin{macrocode}
\newcommand*\showcaptionsetup[2][\@firstofone]{%
\@bsphack
@@ -901,14 +918,9 @@
% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
% \changes{v1.3}{2010/09/05}{Starred variant added}
% \changes{v1.4b}{2012/01/12}{Starred variant removed}
-% |\caption@setoptions|\marg{type or environment or\ldots}\par
-% Caption options which have been saved with |\captionsetup|\oarg{type} can
-% be executed by using this command.
-% It simply executes the saved option list (and clears it afterwards),
-% if there is any.
-% \iffalse
-% (The starred variant do not clear the option list.)
-% \fi
+% |\caption@setoptions|\marg{type or environment or\ldots}\\
+% applies caption options which have been saved with |\caption|\-|setup|\oarg{type}.
+% To prevent multiple application the list will be cleared (locally) afterwards.
% \begin{macrocode}
\newcommand*\caption@setoptions[1]{%
\caption@Debug{options=#1}%
@@ -928,19 +940,19 @@
% \begin{macro}{\caption@removefromoptlist}
% \changes{v1.1}{2007/07/22}{This macro added}
% \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
-% |\caption@addtooptlist|\marg{type}\\
-% |\caption@removefromoptlist|\marg{type}\par
-% 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
-% is used (since |\float@getstyle| gives a result which tokens have catcode
-% 12 $=$ ``other'').
+% |\caption@addtooptlist|\marg{type}\\
+% |\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
+% is used (since |\float@getstyle| gives a result which tokens have catcode
+% 12 $=$ ``other'').
% \begin{macrocode}
\newcommand*\caption@addtooptlist[1]{%
- \@ifundefined{caption@opt@#1@lineno}{%
- \caption@dooptlist\caption@g@addto@list{#1}%
- \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
- }{}}
+ \@ifundefined{caption@opt@#1@lineno}%
+ {\caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}}%
+ {}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@removefromoptlist[1]{%
@@ -956,10 +968,10 @@
% \end{macrocode}
% \begin{macrocode}
\AtEndDocument{%
- \caption@for@list\caption@optlist{%
- \caption@WarningNoLine{%
- Unused \string\captionsetup[#1]
- on input line \csname caption@opt@#1@lineno\endcsname}}}
+ \caption@for@list\caption@optlist
+ {\caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -974,10 +986,10 @@
% \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added}
% \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically}
% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added}
-% |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par
-% This one simply calls |\setkeys|\marg{family}\marg{key-values}
-% but lets the error messages not refer to the \package{keyval} package,
-% but to the \meta{package} package instead.
+% |\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 to the \meta{package} package instead.
% \begin{macrocode}
\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
% \end{macrocode}
@@ -1001,7 +1013,7 @@
\def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
% \end{macrocode}
% \begin{macrocode}
- \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \caption@Debug{\noexpand\setkeys{#2}{#3}}%
\setkeys{#2}{#3}%
% \end{macrocode}
% \begin{macrocode}
@@ -1024,9 +1036,9 @@
% \begin{macro}{\caption@ExecuteOptions}
% \changes{v1.1}{2007/07/15}{This macro added}
% \changes{v1.3}{2010/09/04}{Depends on package now}
-% |\caption@ExecuteOptions|\marg{package}\marg{key-values}\par
-% We execute our options using the keyval interface, so we use this one
-% instead of |\ExecuteOptions| offered by \LaTeXe.
+% |\caption@ExecuteOptions|\marg{package}\marg{key-value options}\\
+% applies the given options using the keyval interface, so we use this one
+% instead of |\Execute|\-|Options| offered by \LaTeXe.
% \begin{macrocode}
\newcommand*\caption@ExecuteOptions[2]{%
\expandafter\@expandtwoargs\csname caption@setkeys@#1\endcsname{#1}{#2}}%
@@ -1035,21 +1047,17 @@
% \end{macro}
%
% \begin{macro}{\caption@ProcessOptions}
-% \changes{v1.0a}{2004/01/23}{Bugfix, see
-% \purett{news:400D360C.9678329F@gmx.net} for details}
-% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys}
-% instead of \cs{setkeys}}
-% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global
-% options which have a default value}
-% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to
-% \cs{caption@ProcessOptions} and moved from the package to the kernel}
-% \changes{v1.1}{2007/04/17}{Star variant added}
-% |\caption@ProcessOptions*|\marg{package}\par
-% We process our options using the keyval package, so we use this one
-% instead of |\ProcessOptions| offered by \LaTeXe.
-% The starred variant do not process the global options.
-% (This code was taken from the \package{hyperref} package\cite{hyperref}
-% \version{6.74} and improved.)
+% \changes{v1.0a}{2004/01/23}{Bugfix, see \purett{news:400D360C.9678329F@gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption@setkeys} instead of \cs{setkeys}}
+% \changes{v1.0h}{2006/02/23}{Bugfix, now processes only those global options which have a default value}
+% \changes{v1.0j}{2007/01/30}{\cs{ProcessOptionsWithKV} renamed to \cs{caption@ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Starred variant added}
+% |\caption@ProcessOptions*|\marg{package}\\
+% 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}
+% \version{6.74} and modified.)
% \begin{macrocode}
\newcommand*\caption@ProcessOptions{%
\caption@teststar\caption@@ProcessOptions\@gobble\@firstofone}
@@ -1082,11 +1090,11 @@
%
% \begin{macro}{\caption@SetupOptions}
% \changes{v1.3}{2010/09/04}{This macro added}
-% |\caption@SetupOptions|\marg{package}\marg{code}\par
-% After calling this macro |\caption@ExecuteOptions| and
-% |\usepackage|\oarg{options}\marg{package}
-% will both be mapped to \meta{code} with \meta{package} and \meta{options}
-% as arguments |#1| and |#2|. (This helps avoiding ``Option clash'' errors.)
+% |\caption@SetupOptions|\marg{package}\marg{code}\\
+% After application of this command |\caption@Execute|\-|Options| and
+% |\use|\-|package| will both be mapped to \meta{code} with \meta{package}
+% and \meta{options} as arguments |#1| and |#2|.
+% (This helps avoiding ``Option clash'' errors.)
% \begin{macrocode}
\newcommand\caption@SetupOptions[2]{%
\@namedef{caption@setkeys@#1}##1##2{#2}%
@@ -1120,6 +1128,263 @@
% \end{macrocode}
% \end{macro}
%
+% \section{Declaring and setting key values}
+%
+% \begin{macro}{\caption@decl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@decl|\oarg{command}\marg{option}\marg{name}\\
+% is used for declaring boxes, fonts, formats etc.
+% (It defines |\caption@|\meta{option}|@|\meta{name}
+% using the given \meta{command}.)
+% \begin{macrocode}
+\newcommand*\caption@decl[3][\def]{%
+ \global\long\expandafter#1\csname caption@#2@#3\endcsname}
+\@onlypreamble\caption@decl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@ifdecl|\marg{option}\marg{name}\marg{yes-code}\marg{no-code}\\
+% checks if the given \meta{option} and \meta{name} combination is
+% already declared.
+% \begin{macrocode}
+\newcommand*\caption@ifdecl[2]{%
+ \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@checkdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\caption@checkdecl|\marg{option}\marg{name}\marg{yes-code}\\
+% behaves similar to |\caption@if|\-|decl| but issues an error message if the
+% given \meta{option} plus \meta{name} is not defined.
+% \begin{macrocode}
+\newcommand*\caption@checkdecl[2]{%
+ \caption@ifdecl{#1}{#2}%
+ \@firstofone
+ {\caption@Error{Undefined #1 `#2'}%
+ \@gobble}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@set}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% \changes{v2.0}{2020/07/26}{Uses \cs{def} instead of \cs{let} internally}
+% |\caption@set|\marg{option}\marg{name}\\
+% sets the declared \meta{option} to \meta{name}, for example
+% |label|\-|format| to |simple|.
+% Note that since version \version{2.0} future changes to \meta{name}
+% (via |\caption@decl|) will effect the outcome,
+% for example |\caption@decl{labelformat}{simple}\ldots| will not only change
+% the definition of the label format |simple| but also effect the current
+% label format if set to |simple| (via |\caption@set|).
+% \begin{macrocode}
+\newcommand*\caption@set{%
+ \caption@maparg\caption@@set}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@set[3]{%
+ \caption@checkdecl{#1}{#3}{%
+% \expandafter\edef\csname caption@@#2\endcsname{#3}% could be used for debugging
+ \expandafter\def\csname caption@#2\expandafter\endcsname\expandafter{\csname caption@#1@#3\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SetCaptionDefault}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% \changes{v2.0}{2020/07/28}{Check for `default' added to prevent infinite loop}
+% |\SetCaptionDefault*|\marg{option}\marg{name}\\
+% sets the default value for the \meta{option}.
+% The starred variant is only relevant for setting default values for lengths
+% like |margin|. (See definition of |\caption@set|\-|default@length| for
+% details.)
+% \begin{macrocode}
+\newcommand*\SetCaptionDefault{%
+ \caption@teststar\caption@setdefault\def\edef}
+\@onlypreamble\SetCaptionDefault
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@setdefault[2]{%
+ \@ifundefined{caption@setdefault@#2}%
+ {\caption@maparg\caption@@setdefault}%
+ {\@nameuse{caption@setdefault@#2}{#1}}%
+ {#2}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@setdefault[3]{%
+ \caption@ifdefault{#3}%
+ {\caption@Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
+ {\caption@@set{#1}{#2@default}{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@ifdefault}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@ifdefault|\marg{value}\marg{yes-code}\marg{no-code}\\
+% expands to \meta{yes-code} if the \meta{value} expands to `default',
+% and to \meta{no-code} otherwise.
+% \begin{macrocode}
+\newcommand*\caption@ifdefault[1]{%
+ \edef\caption@tempa{#1}%
+ \def\caption@tempb{default}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setmapping}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@setmapping|\marg{source option}\marg{destination option}\\
+% sets a mapping from the \meta{source option} to the
+% \meta{destination option}, for example |label|\-|font| to |font|
+% since |label|\-|font| does not have any own definitions but shares
+% them with |font|.
+% \begin{macrocode}
+\newcommand*\caption@setmapping[2]{%
+ \@namedef{caption@map@#1}{#2}}
+\@onlypreamble\caption@setmapping
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@maparg}
+% \changes{v2.0}{2020/08/23}{This macro added}
+% |\caption@maparg|\marg{command}\marg{option}\\
+% similar to |\@dblarg| but either duplicates the given \meta{option} or
+% expands it to \meta{destination option} plus \meta{option} if a mapping
+% was defined for the given option (via |\caption@set|\-|mapping|).
+% \begin{macrocode}
+\newcommand*\caption@maparg[2]{%
+ \@ifundefined{caption@map@#2}%
+ {#1{#2}}%
+ {#1{\csname caption@map@#2\endcsname}}%
+ {#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@switchdefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+% |\caption@switchdefault\marg{option}|\marg{code with \#1}\marg{name}\\
+% like |\Set|\-|Caption|\-|Default| but first expands the given code with the
+% 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.:
+% \begin{quote}|\caption@switchdefault{labelfont}{\babel@save #1}{sc}|\end{quote}
+% \begin{macrocode}
+\def\caption@switchdefault#1#2{%
+ \def\caption@tempa##1{#2}%
+ \expandafter\caption@tempa\csname caption@#1@default\endcsname
+ \caption@setdefault\def{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@restoredefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+% |\caption@restoredefault\marg{option}|\marg{command}\\
+% restores a default setting which was stored to \meta{command} before
+% (via |\caption@switch|\-|default|).
+% \begin{macrocode}
+\def\caption@restoredefault#1#2{%
+ \caption@checkdecl{#1}{default}{%
+ \caption@ifdefined#2{%
+ \expandafter\let\csname caption@#1@default\endcsname#2%
+ \let#2\@undefined}{}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@decl@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\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}
+% package.
+% \begin{macrocode}
+\newcommand*\caption@decl@package[2]{%
+ \@ifnextchar[%]
+ {\caption@declare@package{#1}{#2}}%
+ {\caption@declarepackage{#1}{#2}}}
+\@onlypreamble\caption@decl@package
+% \end{macrocode}
+% \begin{macrocode}
+\def\caption@declare@package#1#2[#3]#4{%
+ \global\@namedef{caption@#1@#4@package}{#3}%
+ #2{#4}}
+\@onlypreamble\caption@declare@package
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declarepackage[3]{%
+ \global\@nameundef{caption@#1@#3@package}%
+ #2{#3}}
+\@onlypreamble\caption@declarepackage
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@load@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@load@package|\marg{option}\marg{value}\\
+% If the given option value needs a package, it will be loaded automatically.
+% \begin{macrocode}
+\newcommand*\caption@load@package[2]{%
+ \expandafter\let\expandafter\caption@tempa\csname caption@#1@#2@package\endcsname
+ \caption@ifdefined\caption@tempa
+ {\caption@requirepackage\caption@tempa{#1=#2}}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaring and setting lengths}
+%
+% \begin{macro}{\DeclareCaptionLength}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\DeclareCaptionLength|\marg{name}\marg{default value}\\
+% \begin{enumerate}
+% \item Defines a new length (dimension)
+% \item Installes a hook for |\caption@set|\-|default| so
+% |\caption@set|\-|default@length| will be used to set a default
+% value for this length
+% \item Sets a default value using |\Set|\-|Caption|\-|Default*|.
+% \end{enumerate}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLength[1]{%
+ \expandafter\newdimen\csname caption#1\endcsname
+ \@namedef{caption@setdefault@#1}##1{%
+ \caption@setdefault@length{##1}}%
+ \SetCaptionDefault*{#1}}
+\@onlypreamble\DeclareCaptionLength
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setdefault@length}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\caption@setdefault@length*|\marg{cmd}\marg{name}\marg{value}\\
+% sets a default value for the given \meta{length}, either using |\def|
+% (if the starred variant is used) or |\edef| (if the non-starred variant is
+% used).
+% \begin{macrocode}
+\newcommand*\caption@setdefault@length[3]{%
+ \expandafter#1\csname caption#2@default\endcsname{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@setlength}
+% \changes{v2.0}{2020/08/09}{This macro added}
+% |\caption@setlength|\marg{name}\marg{value}\\
+% sets a length to either the given \meta{value} or to the default value if
+% \meta{value} is `default'.
+% \begin{macrocode}
+\newcommand*\caption@setlength[2]{%
+ \caption@ifdefault{#2}%
+ {\expandafter\let\expandafter\caption@tempa\csname caption#1@default\endcsname}%
+ {\def\caption@tempa{#2}}%
+ \expandafter\setlength\csname caption#1\endcsname\caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
% \section{Margin resp. width}
% \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}}
% \changes{v1.0n}{2007/04/03}{Option `twoside' added}
@@ -1128,17 +1393,17 @@
%
% \begin{macro}{\captionmargin}
% \begin{macro}{\captionwidth}
-% |\captionmargin| and |\captionwidth| contain the extra margin
-% resp. the total width used for captions. Please never set these values in
-% a direct way, they are just accessible in user documents to provide
-% compatibility to \version{1.x}.\par
-% Note that we can only set one value at a time, `margin' \emph{or} `width'.
-% If |\captionwidth| is not zero we will take this value afterwards,
-% otherwise |\captionmargin| and |\captionmargin@|.
-% \begin{macrocode}
-\newdimen\captionmargin
-\newdimen\captionmargin@
-\newdimen\captionwidth
+% |\captionmargin| and |\captionwidth| contain the extra margin
+% resp. the total width used for captions. Please never set these values in
+% a direct way, they are just accessible in user documents to provide
+% compatibility to \version{1.x} of the \package{caption} package.\par
+% Note that we can only set one value at a time, `margin' \emph{or} `width'.
+% If |\caption|\-|width| is not zero we will take this value afterwards,
+% otherwise |\caption|\-|margin| and |\caption|\-|margin@|.
+% \begin{macrocode}
+\DeclareCaptionLength{margin}{0pt}
+\DeclareCaptionLength{margin@}{\the\captionmargin}
+\DeclareCaptionLength{width}{0pt}
\newdimen\caption@tempdima
% \end{macrocode}
% \end{macro}
@@ -1159,6 +1424,7 @@
% \begin{macrocode}
\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+\caption@set@bool\caption@iftwoside{\if@twoside 1\else 0\fi}
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
@@ -1167,17 +1433,14 @@
%
% \begin{macro}{\setcaptionmargin}
% \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption@setmargin} to \cs{setcaptionmargin}}
-% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take
-% left+right margin}
+% \changes{v1.0f}{2005/10/24}{\cs{setcaptionmargin} enhanced so it can take left+right margin}
% \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.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}
-% |\setcaptionmargin|\marg{amount}\\
-% |\setcaptionmargin*|\marg{amount}\par
-% Please never use this in user documents, it's just there to
-% provide compatibility to the \package{caption2} package.
+% |\setcaptionmargin*|\marg{amount}\\
+% sets the caption margin to the given \meta{amount}.
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
% \begin{macrocode}
\newcommand*\setcaptionmargin{%
\caption@resetcalcmargin
@@ -1194,8 +1457,8 @@
% \end{macrocode}
% \begin{macrocode}
\def\caption@@@setmargin#1,#2,#3\@nil{%
- \setlength\captionmargin@{#2}%
- \setlength\captionmargin{#1}%
+ \caption@setlength{margin}{#1}%
+ \caption@setlength{margin@}{#2}%
\addtolength\captionmargin@{-\captionmargin}}
% \end{macrocode}
% \end{macro}
@@ -1204,10 +1467,10 @@
% \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}
-% |\setcaptionwidth|\marg{amount}\\
-% |\setcaptionwidth*|\marg{amount}\par
-% Please never use this in user documents, it's just there to
-% provide compatibility to the \package{caption2} package.
+% |\setcaptionwidth*|\marg{amount}\\
+% sets the caption width to the given \meta{amount}.
+% Please never use this in user documents, it's just there to
+% provide compatibility to the \package{caption2} package.
% \begin{macrocode}
\newcommand*\setcaptionwidth{%
\caption@resetcalcmargin
@@ -1220,20 +1483,16 @@
% \begin{macrocode}
\newcommand*\caption@@setwidth[2]{%
#1{\captionmargin\z@\captionmargin@\z@}%
- \setlength\captionwidth{#2}}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@resetcalcmargin}
-% \changes{v1.3}{2010/11/07}{This macro added}
-% \begin{macrocode}
-\newcommand*\caption@resetcalcmargin{%
- \let\caption@calcmargin@hook\@empty}
+ \caption@setlength{width}{#2}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setcalcmargin}
% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@setcalcmargin*|\marg{amount}\\
+% sets the caption margin to the given \meta{amount}
+% right before the caption will be typeset, i.e.\meta{amount} will
+% not be evaluated immediately.
% \begin{macrocode}
\newcommand*\caption@setcalcmargin{%
\caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
@@ -1247,8 +1506,22 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@resetcalcmargin|\\
+% clears the value which was stored in |\caption@set|\-|calc|\-|margin|.
+% \begin{macrocode}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@setcalcwidth}
% \changes{v1.3}{2010/11/07}{This macro added}
+% |\caption@setcalcwidth*|\marg{amount}\\
+% sets the caption width to the given \meta{amount}
+% right before the caption will be typeset, i.e.\meta{amount} will
+% not be evaluated immediately.
% \begin{macrocode}
\newcommand*\caption@setcalcwidth{%
\caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
@@ -1260,8 +1533,8 @@
% \changes{v1.0n}{2007/04/03}{This counter added}
% \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added}
% \changes{v1.5}{2012/04/09}{\cs{caption@stepcounter} renamed to \cs{caption@stepthecounter}}
-% Internal counter. At the moment it will be used inside
-% |\caption@ifoddpage| only.
+% Internal counter.
+% At the moment it will be used inside |\caption@if|\-|odd|\-|page| only.
% \begin{macrocode}
\newcommand*\caption@thecounter{0}
% \end{macrocode}
@@ -1275,10 +1548,11 @@
%
% \begin{macro}{\caption@newlabel}
% \changes{v1.0n}{2007/04/03}{This macro added}
-% This command is a modified version of |\newlabel| from \LaTeX2e.
-% It will be written to the \texttt{.aux} file to
-% pass label information from one run to another.
-% (We use it inside |\caption@ifoddpage| and |\caption@ragged|.)
+% |\caption@newlabel|\marg{name}\marg{value}\\
+% This command is a modified version of |\new|\-|label| from \LaTeX2e.
+% It will be written to the \texttt{.aux} file to
+% pass label information from one run to another.
+% (We use it inside |\caption@if|\-|odd|\-|page|.)
% \begin{macrocode}
\newcommand*\caption@newlabel{\@newl@bel{caption@r}}
% \end{macrocode}
@@ -1286,8 +1560,8 @@
%
% \begin{macro}{\caption@thepage}
% \changes{v1.0n}{2007/04/03}{This macro added}
-% This command is a modified version of |\thepage| from \LaTeX2e.
-% It will be used inside |\caption@ifoddpage| only.
+% This command is a modified version of |\the|\-|page| from \LaTeX2e.
+% It will be used inside |\caption@if|\-|odd|\-|page| only.
% \begin{macrocode}
\newcommand*\caption@thepage{\the\c@page}
% \end{macrocode}
@@ -1295,9 +1569,10 @@
%
% \begin{macro}{\caption@label}
% \changes{v1.1}{2007/09/01}{This macro added}
-% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in AUX file added}
-% This command is a modified version of |\label| from \LaTeX2e.
-% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@newlabel} in aux file added}
+% |\caption@label|\marg{name}\\
+% This command is a modified version of |\label| from \LaTeX2e.
+% It will be used inside |\caption@if|\-|odd|\-|page| and |\FP@help|\-|Note|.
% \begin{macrocode}
\newcommand*\caption@label[1]{%
\caption@@label
@@ -1315,8 +1590,9 @@
% \begin{macro}{\caption@pageref}
% \changes{v1.1}{2007/09/01}{This macro added}
% \changes{v1.2d}{2009/10/09}{Uses \cs{@latex@warning} instead of \cs{caption@Warning} now}
-% This command is a modified version of |\pageref| from \LaTeX2e.
-% It will be used inside |\caption@ifoddpage| and |\FP@helpNote|.
+% |\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|.
% \begin{macrocode}
\newcommand*\caption@pageref[1]{%
\expandafter\ifx\csname caption@r@#1\endcsname\relax
@@ -1331,11 +1607,13 @@
% \begin{macro}{\caption@ifoddpage}
% \changes{v1.0n}{2007/04/03}{This macro added}
% \changes{v1.1e}{2007/10/28}{Incrementation of counter moved to \cs{caption@@make}}
-% At the moment this macro uses an own label\ldots ref mechanism,
-% but an alternative implementation method would be using the
-% \package{refcount} package\cite{refcount} and |\ifodd\getpagerefnumber{|\ldots|}|.
-% \Note{This macro re-defines itself so the \texttt{.aux} file will
-% only be used once per group.}
+% Currently this macro uses an own label\ldots ref mechanism,
+% but an alternative implementation method would use the
+% \package{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.}
% \begin{macrocode}
\newcommand*\caption@ifoddpage{%
\caption@iftwoside{%
@@ -1355,7 +1633,9 @@
%
% \begin{macro}{\caption@setoptcmd}
% \changes{v1.1}{2007/08/11}{This macro added}
-% |\caption@setoptcmd|\marg{cmd}\marg{off -or- value}
+% |\caption@setoptcmd|\marg{command}\marg{off -or- value}\\
+% defines the given \meta{command} to \meta{value},
+% but if \meta{value} if `off' the given \meta{command} is undefined instead.
% \begin{macrocode}
\newcommand*\caption@setoptcmd[2]{%
\caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
@@ -1368,41 +1648,39 @@
% \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}}
% \begin{macro}{\caption@parindent}
% \begin{macro}{\caption@hangindent}
-% These are the indentions we support.
+% These are the indentions we support.
% \begin{macrocode}
-\newdimen\caption@indent
-\newdimen\caption@parindent
-\newdimen\caption@hangindent
+\DeclareCaptionLength{@indent}{0pt}
+\DeclareCaptionLength{@parindent}{0pt}
+\DeclareCaptionLength{@hangindent}{0pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
-% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=}
-% and \opt{hangindent=}}
-% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption}
-% replaced by \cs{caption@@par}}
-% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=},
-% \opt{hangindent=}, and \opt{parskip=} removed}
+% \changes{v1.0b}{2004/05/16}{Defaults added for options \opt{parindent=} and \opt{hangindent=}}
+% \changes{v1.0f}{2005/08/22}{Option \opt{parskip=}: \cs{AtBeginCaption} replaced by \cs{caption@@par}}
+% \changes{v1.0f}{2005/08/22}{Undocumented defaults for \opt{parindent=}, \opt{hangindent=}, and \opt{parskip=} removed}
% \begin{macrocode}
-\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
- \setlength\caption@indent{#1}}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
+ \caption@setlength{@indent}{#1}}
\DeclareCaptionOption{indention}[\leftmargini]{%
- \setlength\caption@indent{#1}}
+ \caption@setlength{@indent}{#1}}
\DeclareCaptionOption{parindent}{%
- \setlength\caption@parindent{#1}}
+ \caption@setlength{@parindent}{#1}}
\DeclareCaptionOption{hangindent}{%
- \setlength\caption@hangindent{#1}}
+ \caption@setlength{@hangindent}{#1}}
\DeclareCaptionOption{parskip}{%
- \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
% \end{macrocode}
%
% \section{Styles}
%
% \begin{macro}{\DeclareCaptionStyle}
-% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
-% between arguments do make any harm}
-% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@sls} renamed to \cs{caption@slsty}}
+% |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
% \begin{macrocode}
\newcommand*\DeclareCaptionStyle[1]{%
\@testopt{\caption@declarestyle{#1}}{}}
@@ -1410,8 +1688,16 @@
% \end{macrocode}
% \begin{macrocode}
\def\caption@declarestyle#1[#2]#3{%
- \global\@namedef{caption@sls@#1}{#2}%
- \global\@namedef{caption@sty@#1}{#3}}
+ \caption@decl{style}{#1}%
+ {\def\caption@slsty{#2}%
+ \def\caption@sty{#3}}%
+% \end{macrocode}
+% The \package{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
+% so the test will still work.
+% \begin{macrocode}
+ \@namedef{caption@sty@#1}{\@unused}}
\@onlypreamble\caption@declarestyle
% \end{macrocode}
% \end{macro}
@@ -1427,58 +1713,55 @@
% \changes{v1.1}{2007/07/29}{Recursive style definitions should work now}
% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
% \changes{v1.2}{2007/12/03}{Definition of \cs{caption@iftypewarning} removed}
-% |\caption@setstyle|\marg{name}\\
-% |\caption@setstyle*|\marg{name}\par
-% Selecting a caption style means saving the additional
-% \meta{single-line-list-of-KV} (this will be done by |\caption@sls|),
-% resetting the caption options to the base ones (this will be done using
-% |\caption@resetstyle|) and executing the \meta{list-of-KV} options
-% (this will be done using |\caption@setup|).\par
-% The starred version will give no error message if the given style is not
-% defined.
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@ifdecl} and \cs{caption@checkdecl} now}
+% |\caption@setstyle*|\marg{name}\\
+% Selecting a caption style means saving the additional
+% \meta{single-line-list-of-KV} (this will be done by |\caption@sl|\-|sty|),
+% resetting the caption options to the base ones (this will be done using
+% |\caption@reset|\-|style|) and executing the \meta{list-of-KV} options
+% (this will be done using |\caption@setup|).\par
+% The starred version will give no error message if the given style is not
+% defined.
% \begin{macrocode}
\newcommand*\caption@setstyle{%
- \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+ \caption@teststar\caption@@setstyle\caption@ifdecl\caption@checkdecl}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@setstyle[2]{%
- \@ifundefined{caption@sty@#2}%
- {#1{\caption@Error{Undefined style `#2'}}}%
- {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ #1{style}{#2}%
+ {\caption@set{style}{#2}%
+ \caption@style % defines \caption@sty & \caption@slsty
\ifx\caption@setstyle@flag\@undefined
- \let\caption@setstyle@flag\relax
+ \let\caption@setstyle@flag\relax % prevent \caption@resetstyle if called recursively
\caption@resetstyle
\caption@xsetup\caption@sty
\let\caption@setstyle@flag\@undefined
\else
\caption@xsetup\caption@sty
- \fi
- \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
- \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
- \expandafter{\caption@sls}}}
+ \fi}%
+ {}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@resetstyle}
-% \changes{v1.1}{2007/02/04}{%
-% This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
+% \changes{v1.1}{2007/02/04}{This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}}
% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
% \changes{v1.2}{2007/11/17}{Usage of \opt{size=} added}
% \changes{v1.2b}{2008/05/06}{Usage of \opt{rule} added}
% \changes{v1.5}{2012/03/15}{\opt{box=parbox} added}
% \changes{v1.6}{2013/05/01}{\opt{box=none} added, \opt{box=parbox} changed to \opt{parbox=parbox}}
-% This resets (nearly) all caption options to the base ones.
-% \emph{Note that this does not touch the skips and the positioning!}
+% |\caption@resetstyle|\\
+% This resets (nearly) all caption options to the base ones.
+% \emph{Note that this does not touch the skips and the positioning.}
% \begin{macrocode}
\newcommand*\caption@resetstyle{%
\caption@setup{%
box=none,boxcolor=white,parbox=parbox,%
format=plain,labelformat=default,labelsep=colon,textformat=simple,%
- justification=justified,font=,size=,labelfont=,textfont=,%
+ font=,labelfont=,textfont=,size=,%
+ justification=justified,slc,rule,strut,%
margin=0pt,minmargin=0,maxmargin=0,%
- indent=0pt,parindent=0pt,hangindent=0pt,%
- slc,rule,strut}%
- \caption@clearsetup{singleline}}
+ indent=0pt,parindent=0pt,hangindent=0pt}}
% \end{macrocode}
% \end{macro}
%
@@ -1488,31 +1771,69 @@
% \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}}
% \changes{v1.5}{2012/03/15}{\opt{box=default} added to caption style \opt{default}}
% Currently there are two pre-defined styles, called `base' \& `default'.
-% The first one is a perfect match to the behavior of |\@makecaption| offered
-% by the standard \LaTeX\ document classes (and was called `default' in
-% \thispackage\ \version{1.0}), the second one matches the document
+% The first one is a perfect match to the behavior of |\@make|\-|caption|
+% offered by the standard \LaTeX\ document classes (and was called `default'
+% in \thispackage\ \version{1.0}), the second one matches the document
% class actually used.
% \begin{macrocode}
\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
- box=default,format=default,labelsep=default,textformat=default,%
- justification=default,font=default,labelfont=default,textfont=default}
+ box=default,%
+ format=default,labelformat=default,labelsep=default,textformat=default,%
+ font=default,labelfont=default,textfont=default,size=default,%
+ justification=default,slc=default,margin=default,%
+ indent=default,parindent=default,hangindent=default}
% \end{macrocode}
%
+% \begin{macro}{\DeclareCaptionSinglelinecheck}
+% \changes{v2.0}{2019/09/10}{This macro added}
+% |\DeclareCaptionSinglelinecheck|\marg{name}\marg{code}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionSinglelinecheck[2]{%
+ \caption@decl{singlelinecheck}{#1}{#2}}
+\@onlypreamble\DeclareCaptionSinglelinecheck
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added}
% \begin{macrocode}
-\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@setsinglelinecheck{#1}}
\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
% \end{macrocode}
%
+% These are the pre-defined single-line-check code snippets.
+% \begin{macrocode}
+\DeclareCaptionSinglelinecheck{on}{\@firstoftwo}
+\DeclareCaptionSinglelinecheck{off}{\@secondoftwo}
+% \end{macrocode}
+%
+% `default' usually maps to `on'.
+% \begin{macrocode}
+\SetCaptionDefault{singlelinecheck}{on}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setsinglelinecheck}
+% \changes{v2.0}{2018/03/13}{This macro added}
+% |\caption@setsinglelinecheck|\marg{value}\\
+% sets the single-line-check either on or off,
+% where \meta{value} could be either a \meta{name} or boolean value.
+% \begin{macrocode}
+\newcommand*\caption@setsinglelinecheck[1]{%
+ \caption@ifdecl{singlelinecheck}{#1}%
+ {\caption@set{singlelinecheck}{#1}}%
+ {\caption@set@bool\caption@singlelinecheck{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
% \section{Boxes}
%
% \begin{macro}{\DeclareCaptionBox}
% \changes{v1.5}{2012/03/15}{This macro added}
-% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
% \begin{macrocode}
\newcommand*\DeclareCaptionBox[2]{%
- \global\long\@namedef{caption@box@#1}##1##2{#2}}
+ \caption@decl{box}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionBox
% \end{macrocode}
% \end{macro}
@@ -1520,31 +1841,15 @@
% \changes{v1.5}{2012/03/15}{Option \opt{box=} added}
% \changes{v1.6}{2013/05/01}{Option \opt{parbox=} added}
% \begin{macrocode}
-\DeclareCaptionOption{box}{\caption@setbox{#1}}
-\DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}}
+\DeclareCaptionOption{box}{\caption@set{box}{#1}}
+\DeclareCaptionOption{parbox}{\caption@set{parbox}{#1}}
+\caption@setmapping{parbox}{box}
% \end{macrocode}
%
-% \begin{macro}{\caption@setbox}
-% |\caption@setbox|\marg{name}\par
-% Selecting a caption box simply means saving the code (in |\caption@box|).
-% \begin{macrocode}
-\newcommand*\caption@setbox{%
- \caption@set@box\caption@box}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@set@box[2]{%
- \@ifundefined{caption@box@#2}%
- {\caption@Error{Undefined box `#2'}}%
- {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}}
-% \end{macrocode}
-% \end{macro}
-%
% There are four pre-defined boxes, called `empty', `none',
% `parbox', and `colorbox'.
-% \changes{v1.0i}{2006/05/13}{We define \cs{captionbox} instead of
-% \cs{caption@start/endbox}}
-% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from
-% \cs{parbox-t} to \cs{parbox-b}}
+% \changes{v1.0i}{2006/05/13}{We define \cs{captionbox} instead of \cs{caption@start/endbox}}
+% \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{captionbox} changed from \cs{parbox-t} to \cs{parbox-b}}
% \changes{v1.2}{2007/11/11}{\cs{captionbox} renamed to \cs{caption@parbox}}
% \changes{v1.5}{2012/03/15}{\cs{caption@parbox} adapted to \cs{DeclareCaptionBox}}
% \changes{v1.6}{2013/05/02}{Option \opt{boxsep=} added}
@@ -1552,34 +1857,34 @@
\DeclareCaptionBox{empty}{}
\DeclareCaptionBox{none}{#2}
\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
-%\DeclareCaptionBox{colorbox}{%
-% \colorbox{\caption@boxcolor}{\caption@box@parbox{\dimexpr #1-2\fboxsep}{#2}}}
-\DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{%
- \setlength\caption@tempdima{#1}%
- \addtolength\caption@tempdima{-2\fboxsep}%
- \linewidth\caption@tempdima
- \hsize\caption@tempdima
- #2}}
+\DeclareCaptionBox{colorbox}{%
+ \colorbox\caption@boxcolor{%
+ \setlength\caption@tempdima{#1}%
+ \addtolength\caption@tempdima{-2\fboxsep}%
+ \linewidth\caption@tempdima
+ \hsize\caption@tempdima
+ #2}}
\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
% \end{macrocode}
%
-% `default' usually maps to `none`.
+% `default' usually maps to `none' resp.~`parbox'.
% \begin{macrocode}
-\def\caption@box@default{\caption@box@none}
+\SetCaptionDefault{box}{none}
+%\SetCaptionDefault{parbox}{parbox}
% \end{macrocode}
%
% \section{Formats}
%
% \begin{macro}{\DeclareCaptionFormat}
-% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces
-% between arguments do make any harm}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces between arguments do make any harm}
% \changes{v1.0c}{2005/02/09}{Starred variant added}
% \changes{v1.1c}{2007/10/15}{Optional argument added}
-% |\DeclareCaptionFormat|\marg{name}\marg{code with \#1, \#2, and \#3}\\
-% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\par
-% The starred form causes the code being typeset in vertical (instead of
-% horizontal) mode, but does not support the |indention=| option.
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@ifh} renamed to \cs{caption@ifhmode}}
+% |\DeclareCaptionFormat*|\marg{name}\marg{code with \#1, \#2, and \#3}\\
+% The starred form causes the code being typeset in vertical (instead of
+% horizontal) mode, but does not support the |indention=| option.
% \begin{macrocode}
\newcommand*\DeclareCaptionFormat{%
\caption@teststar\caption@declareformat\@gobble\@firstofone}
@@ -1592,62 +1897,44 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\caption@@declareformat#1#2[#3]#4{%
- \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
- \global\long\@namedef{caption@slfmt@#2}##1##2##3{#3}%
- \global\long\@namedef{caption@fmt@#2}##1##2##3{#4}}
+ \caption@decl[\edef]{format}{#2}{%
+ \unexpanded{\let\caption@ifhmode#1}%
+ \unexpanded{\long\def\caption@slfmt}####1####2####3\unexpanded{{#3}}%
+ \unexpanded{\long\def\caption@fmt}####1####2####3\unexpanded{{#4}}}}
\@onlypreamble\caption@@declareformat
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@useformat}
+% \changes{v2.0}{2020/07/31}{This macro added}
+% |\caption@useformat|\marg{name}\\
+% expands |\caption@fmt| based on the given format \meta{name}.
% \begin{macrocode}
-\DeclareCaptionOption{format}{\caption@setformat{#1}}
-% \end{macrocode}
-%
-% \begin{macro}{\caption@setformat}
-% |\caption@setformat|\marg{name}\par
-% Selecting a caption format simply means saving the code (in |\caption@fmt|)
-% and if the code should be used in horizontal or vertical mode (|\caption@ifh|).
-% \begin{macrocode}
-\newcommand*\caption@setformat[1]{%
- \@ifundefined{caption@fmt@#1}%
- {\caption@Error{Undefined format `#1'}}%
- {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
- \expandafter\let\expandafter\caption@slfmt\csname caption@slfmt@#1\endcsname
- \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
+\newcommand*\caption@useformat[1]{% used by caption-koma.sto
+ \caption@checkdecl{format}{#1}{%
+ \begingroup
+ \@nameuse{caption@format@#1}\global\let\caption@tempa\caption@fmt
+ \endgroup\caption@tempa}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\DeclareCaptionDefaultFormat}
-% \changes{v1.2a}{2008/01/31}{This macro added}
% \begin{macrocode}
-\newcommand*\DeclareCaptionDefaultFormat[1]{%
- \expandafter\def\expandafter\caption@fmt@default\expandafter
- {\csname caption@fmt@#1\endcsname}%
- \expandafter\def\expandafter\caption@slfmt@default\expandafter
- {\csname caption@slfmt@#1\endcsname}%
- \expandafter\def\expandafter\caption@ifh@default\expandafter
- {\csname caption@ifh@#1\endcsname}}
-\@onlypreamble\DeclareCaptionDefaultFormat
+\DeclareCaptionOption{format}{\caption@set{format}{#1}}
% \end{macrocode}
-% \end{macro}
%
-% \changes{v1.0a}{2004/01/23}{%
-% Caption format \opt{default} renamed to \opt{normal}}
-% \changes{v1.0e}{2005/05/12}{%
-% Caption format \opt{normal} renamed to \opt{@normal}}
-% \changes{v1.0f}{2005/08/25}{%
-% Caption format \opt{@normal} renamed to \opt{plain} and documented}
-% \changes{v1.1c}{2007/10/14}{%
-% Single-line variant of caption format \opt{hang} added}
+% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} renamed to \opt{normal}}
+% \changes{v1.0e}{2005/05/12}{Caption format \opt{normal} renamed to \opt{@normal}}
+% \changes{v1.0f}{2005/08/25}{Caption format \opt{@normal} renamed to \opt{plain} and documented}
+% \changes{v1.1c}{2007/10/14}{Single-line variant of caption format \opt{hang} added}
% There are two pre-defined formats, called `plain' and `hang'.
% \begin{macrocode}
\DeclareCaptionFormat{plain}{#1#2#3\par}
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionFormat{hang}[#1#2#3\par]{%
- \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ \caption@iflabelseparatorwithnewline
{\caption@Error{%
- The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ The option `labelsep=\caption@labelsep@name' does not work\MessageBreak
with `format=hang'}}%
{\@hangfrom{#1#2}%
\advance\caption@parindent\hangindent
@@ -1655,47 +1942,35 @@
\caption@@par#3\par}}
% \end{macrocode}
%
-% \changes{v1.0a}{2004/01/23}{Caption format \opt{default} linked to \opt{plain}}
-% \changes{v1.0d}{2005/04/28}{Bugfix 05-04-28: Missing \cs{caption@ifh@default} added}
% `default' usually maps to `plain'.
% \begin{macrocode}
-\DeclareCaptionDefaultFormat{plain}
+\SetCaptionDefault{format}{plain}
% \end{macrocode}
%
% \section{Label formats}
%
% \begin{macro}{\DeclareCaptionLabelFormat}
-% \changes{v1.0a}{2004/01/17}{%
-% Pass through argument \#2 so extra spaces between arguments do make any harm}
-% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
% \begin{macrocode}
\newcommand*\DeclareCaptionLabelFormat[2]{%
- \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+ \caption@decl{labelformat}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionLabelFormat
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
-\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
+\DeclareCaptionOption{labelformat}{\caption@set{labelformat}{#1}}
% \end{macrocode}
%
-% \begin{macro}{\caption@setlabelformat}
-% |\caption@setlabelformat|\marg{name}\par
-% Selecting a caption label format simply means saving the code (in |\caption@lfmt|).
-% \begin{macrocode}
-\newcommand*\caption@setlabelformat[1]{%
- \@ifundefined{caption@lfmt@#1}%
- {\caption@Error{Undefined label format `#1'}}%
- {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
-% \end{macrocode}
-% \end{macro}
-%
% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
% \changes{v1.7}{2015/09/16}{Caption label format \opt{autodot} added}
% \changes{v1.7}{2016/05/22}{Caption label format \opt{autodot} fixed}
% \changes{v1.8}{2016/05/22}{Caption label format \opt{unnumbered} added}
% There are six pre-defined label formats, called `empty', `simple',
% `parens', `brace', `autodot', and `unnumbered'.
+%
% \begin{macrocode}
\DeclareCaptionLabelFormat{empty}{}
\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
@@ -1705,63 +1980,120 @@
\DeclareCaptionLabelFormat{unnumbered}{#1}
% \end{macrocode}
%
-% `default' usually maps to `simple'.
+% \changes{v2.0}{2020/08/03}{Caption label format \opt{original} added}
+% The label format `original' tries to preserve the original definition
+% of the label format which was defined by |\fnum@|\meta{environment}.
+% If no original definition is available, use the label format `simple'
+% as fallback.
+%
+% \begin{macrocode}
+\DeclareCaptionLabelFormat{original}{%
+ \caption@ifdefined\caption@original@fnum
+ {\caption@original@fnum}%
+ {\caption@labelformat@simple{#1}{#2}}}
+% \end{macrocode}
+%
+% `default' usually maps to `original'.
% \begin{macrocode}
-\def\caption@lfmt@default{\caption@lfmt@simple}
+\SetCaptionDefault{labelformat}{original}
% \end{macrocode}
%
% \section{Label separators}
%
% \begin{macro}{\DeclareCaptionLabelSeparator}
-% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
-% between arguments do make any harm}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
% \changes{v1.0f}{2005/08/25}{Starred variant added}
% \changes{v1.1}{2007/07/13}{Test for CR added}
% \changes{v1.3}{2011/08/06}{Test for CR revised}
-% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
-% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\par
-% The starred form causes the label separator to be typeset \emph{without} using |\captionlabelfont|.
+% \changes{v2.0}{2018/05/15}{Variant with two stars added}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption@iflf} renamed to \cs{caption@iflabelfont}}
+% \changes{v2.0}{2020/07/27}{\cs{caption@lsep} renamed to \cs{caption@labelsep}}
+% \changes{v2.0}{2020/07/27}{Definition of \cs{caption@labelsep@name} added}
+% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator*|\marg{name}\marg{code}\\
+% |\DeclareCaptionLabelSeparator**|\marg{name}\marg{condition}\marg{code}\\
+% The starred form causes the label separator to be typeset \emph{without}
+% using |\caption|\-|label|\-|font|.
+% The two-starred form uses \meta{condition} to decide if the label separator
+% should be typeset with or without using |\caption|\-|label|\-|font|.
% \begin{macrocode}
\newcommand\DeclareCaptionLabelSeparator{%
- \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+ \@ifstar
+ \DeclareCaptionLabelSeparator@
+ {\caption@declarelabelseparator\@firstofone}}
\@onlypreamble\DeclareCaptionLabelSeparator
% \end{macrocode}
% \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator@{%
+ \@ifstar
+ \DeclareCaptionLabelSeparator@@
+ {\caption@declarelabelseparator\@gobble}}
+\@onlypreamble\DeclareCaptionLabelSeparator@
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\DeclareCaptionLabelSeparator@@[2]{%
+ \caption@declarelabelseparator
+ {#2\@gobble\@firstofone}%
+ {#1}}
+\@onlypreamble\DeclareCaptionLabelSeparator@@
+% \end{macrocode}
+% \begin{macrocode}
\newcommand\caption@declarelabelseparator[3]{%
- \global\@namedef{caption@iflf@#2}{#1}%
- \global\long\@namedef{caption@lsep@#2}{#3}%
- \caption@@declarelabelseparator{#2}#3\\\@nil}
-\@onlypreamble\caption@declarelabelseparator
+ \caption@decl{labelseparator}{#2}%
+ {\def\caption@iflabelfont{#1}%
+ \def\caption@labelsep@name{#2}%
+ \def\caption@labelsep{#3}}%
% \end{macrocode}
+% Unfortunately |\Declare|\-|Float|\-|Separators| of the \package{floatrow}
+% package mis-uses |\Declare|\-|Caption|\-|Label|\-|Separator| instead of
+% storing the definition on its own. Since the \package{floatrow} package is
+% unmaintained we have to store the separator definition inside
+% |\caption@lsep@|\meta{name} for \package{floatrow}, too. (Sigh!)
% \begin{macrocode}
-\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
- \def\@tempa{#3}\ifx\@tempa\@empty \else
- \caption@g@addto@list\caption@lsepcrlist{#1}%
- \fi}
-\@onlypreamble\caption@@declarelabelseparator
+ \@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
+% than \cs{caption@lsep} (which is usually undefined).}
+% \begin{macrocode}
+\newcommand*\caption@lsep@default{\caption@labelseparator@default\caption@labelsep}%
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@declarelabelseparator
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@LabelSeparatorWithNewline}
+% \changes{v2.0}{2020/07/27}{This macro added}
+% |\caption@LabelSeparatorWithNewline|\marg{name}\\
+% adds the given label separator to a list of label separators which uses
+% |\\| internally. (They are incompatible to the `hang' caption format.)
% \begin{macrocode}
-\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
-\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
+\newcommand*\caption@LabelSeparatorWithNewline[1]{%
+ \caption@g@addto@list\caption@labelsep@crlist{#1}}
+\@onlypreamble\caption@LabelSeparatorWithNewline
% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\caption@setlabelseparator}
-% |\caption@setlabelseparator|\marg{name}\par
-% Selecting a caption label separator simply means saving the code (in |\caption@lsep|).
+% \begin{macro}{\caption@iflabelseparatorwithnewline}
+% \changes{v2.0}{2020/07/31}{This macro added}
+% |\caption@iflabelseparatorwithnewline|\marg{yes-code}\marg{no-code}\\
+% tests if the current label separator uses |\\| internally.
% \begin{macrocode}
-\newcommand*\caption@setlabelseparator[1]{%
- \@ifundefined{caption@lsep@#1}%
- {\caption@Error{Undefined label separator `#1'}}%
- {\edef\caption@lsepname{#1}%
- \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
- \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+\newcommand*\caption@iflabelseparatorwithnewline{%
+ \caption@ifin@list\caption@labelsep@crlist\caption@labelsep@name}
% \end{macrocode}
% \end{macro}
%
-% \changes{v1.0e}{2005/06/11}{Bugfix 05-03-23: Caption label separator
-% \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
+% \begin{macrocode}
+\DeclareCaptionOption{labelsep}{\caption@set{labelseparator}{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@set{labelseparator}{#1}}
+% \end{macrocode}
+%
+% \changes{v1.0e}{2005/06/11}{Bugfix 05-03-23: Caption label separator \opt{newline} implementation changed from \cs{newline} to \cs{\textbackslash}}
% \changes{v1.0f}{2005/08/24}{Caption label separator \opt{endash} added}
% There are seven pre-defined label separators, called `none', `colon', `period', `space',
% `quad', `newline', and `endash'.
@@ -1772,71 +2104,44 @@
\DeclareCaptionLabelSeparator{space}{ }
\DeclareCaptionLabelSeparator*{quad}{\quad}
\DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+\caption@LabelSeparatorWithNewline{newline} % does not work with "format=hang"
\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
% \end{macrocode}
%
% \begin{macro}{\captionnewline}
% \changes{v1.12}{2020/05/30}{This macro added}
-% Will be used in the caption label separator |new|\-|line|,
-% and re-defined for |long|\-|table| environments.
+% \changes{v2.0}{2020/07/31}{\cs{relax} added to definition}
+% |\captionnewline|\\
+% will be used in the caption label separator |new|\-|line|,
+% and re-defined for |long|\-|table| environments
+% (in package \package{ltcaption}).
% \begin{macrocode}
-\newcommand*\captionnewline{\\}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@setdefaultlabelsep}
-% \changes{v1.2d}{2009/03/29}{This macro added}
-% \begin{macrocode}
-\newcommand*\caption@setdefaultlabelsep[1]{%
- \ifx\caption@lsep\caption@lsep@default
- \caption@set@default@labelsep{#1}%
- \caption@setlabelseparator{default}%
- \else
- \caption@set@default@labelsep{#1}%
- \fi}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@set@default@labelsep[1]{%
- \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
- \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
+\newcommand*\captionnewline{\\\relax}
% \end{macrocode}
% \end{macro}
%
% `default' usually maps to `colon'.
% \begin{macrocode}
-\caption@set@default@labelsep{colon}
+\SetCaptionDefault{labelseparator}{colon}
% \end{macrocode}
%
% \section{Text formats}
%
% \begin{macro}{\DeclareCaptionTextFormat}
% \changes{v1.0j}{2007/02/18}{This macro added}
-% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
+% \changes{v2.0}{2019/09/10}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
% \begin{macrocode}
\newcommand*\DeclareCaptionTextFormat[2]{%
- \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+ \caption@decl{textformat}{#1}##1{#2}}
\@onlypreamble\DeclareCaptionTextFormat
% \end{macrocode}
% \end{macro}
%
-% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
% \begin{macrocode}
-\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
-\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+\DeclareCaptionOption{textformat}{\caption@set{textformat}{#1}}
% \end{macrocode}
%
-% \begin{macro}{\caption@settextformat}
-% \changes{v1.0j}{2007/02/18}{This macro added}
-% |\caption@settextformat|\marg{name}\par
-% Selecting a caption text format simply means saving the code (in |\caption@tfmt|).
-% \begin{macrocode}
-\newcommand*\caption@settextformat[1]{%
- \@ifundefined{caption@tfmt@#1}%
- {\caption@Error{Undefined text format `#1'}}%
- {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
-% \end{macrocode}
-% \end{macro}
-%
% There are three pre-defined text formats, called `empty', `simple' and `period'.
% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
@@ -1848,9 +2153,9 @@
\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
\def\caption@tempa{#2}%
\ifx\caption@tempa\@empty
- \caption@getlabel#1\label{}\@nil
+ \caption@getlabel{#1}%
\else
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\fi}
% \end{macrocode}
% \begin{macrocode}
@@ -1860,16 +2165,21 @@
%
% `default' usually maps to `simple'.
% \begin{macrocode}
-\def\caption@tfmt@default{\caption@tfmt@simple}
+\SetCaptionDefault{textformat}{simple}
% \end{macrocode}
%
% \begin{macro}{\caption@getlabel}
% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
% \changes{v1.8d}{2019/09/01}{Bugfix: Global definition of \cs{caption@thelabel} added}
-% Gets the label command out of the (first) caption text and stores it to |\caption@thelabel|.
-% \begin{macrocode}
-\long\def\caption@getlabel#1\label#2#3\@nil{%
+% \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
+% |\caption@the|\-|label|.
+% \begin{macrocode}
+\newcommand\caption@getlabel[1]{%
+ \caption@@getlabel#1\label{}\@nil}
+\long\def\caption@@getlabel#1\label#2#3\@nil{%
\def\@tempa{#2}%
\ifx\@tempa\@empty
\let\caption@thelabel\relax
@@ -1877,33 +2187,38 @@
\def\@tempb{*}%
\ifx\@tempa\@tempb
\def\caption@thelabel{\label*}%
- \caption@@getlabel#3\@nil
+ \caption@@@getlabel#3\@nil
\else
\def\caption@thelabel{\label}%
- \caption@@getlabel{#2}#3\@nil
+ \caption@@@getlabel{#2}#3\@nil
\fi
\fi}
% \end{macrocode}
% \begin{macrocode}
-\long\def\caption@@getlabel#1#2\@nil{%
+\long\def\caption@@@getlabel#1#2\@nil{%
\def\@tempa{#1}%
\def\@tempb{[}%
\ifx\@tempa\@tempb
- \caption@@@getlabel#1#2\@nil
+ \caption@@@@getlabel#1#2\@nil
\else
\l@addto@macro\caption@thelabel{{#1}}%
\fi}
% \end{macrocode}
% \begin{macrocode}
-\long\def\caption@@@getlabel[#1]#2\@nil{%
+\long\def\caption@@@@getlabel[#1]#2\@nil{%
\l@addto@macro\caption@thelabel{[{#1}]}%
- \caption@@getlabel#2\@nil}
+ \caption@@@getlabel#2\@nil}
% \end{macrocode}
% \begin{macrocode}
\let\caption@thelabel\relax
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+% \begin{macrocode}
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
+% \end{macrocode}
+%
% \section{Fonts}
%
% \begin{macro}{\DeclareCaptionFont}
@@ -1911,79 +2226,56 @@
% \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.10}{2020/05/10}{Optional argument \opt{package} added}
-% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
+% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
% \begin{macrocode}
\newcommand*\DeclareCaptionFont{%
- \@ifnextchar[%]
- \caption@declare@font
- \caption@declarefont}
+ \caption@decl@package{font}{\caption@declarefont}}
\@onlypreamble\DeclareCaptionFont
% \end{macrocode}
% \begin{macrocode}
-\def\caption@declare@font[#1]#2{%
- \global\@namedef{caption@fnt@#2@package}{#1}%
- \caption@@declarefont{#2}}
-\@onlypreamble\caption@declare@font
+\newcommand*\caption@declarefont[2]{%
+ \caption@decl{font}{#1}##1{#2}%
+ \define@key{caption@font}{#1}[]{\caption@addto@font{#1}{##1}}}
+\@onlypreamble\caption@@declarefont
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@declarefont[1]{%
- \global\@nameundef{caption@fnt@#1@package}%
- \caption@@declarefont{#1}}
-\@onlypreamble\caption@declarefont
+\newcommand*\caption@addto@font[1]{%
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@@declarefont[2]{%
- \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#1}{#2}}%
- \caption@@@declarefont{#1}{#2}}
-\@onlypreamble\caption@@declarefont
+% Load package first, if necessary
+ \caption@load@package{font}{#1}%
% \end{macrocode}
+% Add the content to \cs{caption@fnt}
% \begin{macrocode}
-\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
-\@onlypreamble\caption@@@declarefont
+ \caption@add@to@font{font}{#1}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@addto@fnt[2]{%
- \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
- \caption@ifdefined\caption@package
- {\caption@requirepackage\caption@package{#1}}% load package, if necessary
- {}%
- \l@addto@macro\caption@fnt{#2}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\DeclareCaptionDefaultFont}
-% \changes{v1.1}{2006/05/14}{This macro added}
-% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionFont} to \cs{DeclareCaptionDefaultFont}}
-% |\DeclareCaptionDefaultFont|\marg{name}\marg{code}
-% \begin{macrocode}
-\newcommand*\DeclareCaptionDefaultFont[2]{%
- \global\@namedef{caption#1@default}{#2}}
-\@onlypreamble\DeclareCaptionDefaultFont
+\newcommand*\caption@add@to@font[3]{%
+ \expandafter\g@addto@macro\expandafter\caption@fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
-\DeclareCaptionDefaultFont{font}{}
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
-\DeclareCaptionDefaultFont{labelfont}{}
+\caption@setmapping{labelfont}{font}
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
-\DeclareCaptionDefaultFont{textfont}{}
+\caption@setmapping{textfont}{font}
% \end{macrocode}
%
% \begin{macro}{\caption@setfont}
% \changes{v1.0j}{2007/01/30}{Usage of \cs{caption@setkeys} with optional argument}
% \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
-% |\caption@setfont|\marg{name}\marg{keyval-list of names}\par
-% Selecting a caption font means saving all the code snippets
-% in |\caption|\meta{name}.
+% |\caption@setfont|\marg{name}\marg{keyval-list of names}\\
+% Selecting a caption font means saving all the code snippets
+% in |\caption|\meta{name}.
% \begin{macrocode}
\newcommand*\caption@setfont[1]{%
\expandafter\let\csname caption#1\endcsname\@empty
@@ -1993,38 +2285,18 @@
%
% \begin{macro}{\caption@addtofont}
% \changes{v1.2}{2007/11/17}{This macro added}
-% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\par
-% Like |\caption@setfont|, but adds the code snippets to |\caption|\meta{name}.\par
-% Because we use |\setkeys| recursive here we need to do this inside an
-% extra group.
+% |\caption@addtofont|\marg{name}\marg{keyval-list of names}\\
+% Like |\caption@set|\-|font|, but adds the code snippets to |\caption|\meta{name}.
+% Because we use |\set|\-|keys| recursive here we need to do this inside an
+% extra group.
% \begin{macrocode}
\newcommand*\caption@addtofont[2]{%
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
\begingroup
- \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
- \define@key{caption@fnt}{default}[]{%
- \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
- \caption@setkeys[caption]{caption@fnt}{#2}%
- \global\let\caption@tempa\caption@fnt
+ \define@key{caption@font}{default}[]{\caption@add@to@font{#1}{default}{##1}}%
+ \caption@setkeys[caption]{caption@font}{#2}%
\endgroup
- \expandafter\let\csname caption#1\endcsname\caption@tempa}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@font}
-% \changes{v1.1}{2007/05/07}{This macro added}
-% |\caption@font|\marg{keyval-list of names}\\
-% |\caption@font*|\marg{keyval-code}\par
-% Sets the given font, e.g.~|\caption@font{small,it}|
-% is equivalent to |\small\itshape|.
-% \begin{macrocode}
-\newcommand*\caption@font{%
- \caption@teststar\caption@@font\@firstofone
- {\caption@setkeys[caption]{caption@fnt}}}
-\newcommand*\caption@@font[2]{%
- \begingroup
- \def\caption@fnt{\endgroup}%
- #1{#2}%
- \caption@fnt}
+ \expandafter\let\csname caption#1\endcsname\caption@fnt}
% \end{macrocode}
% \end{macro}
%
@@ -2063,7 +2335,31 @@
\DeclareCaptionFont{Huge}{\Huge}
% \end{macrocode}
%
-% \changes{v1.8}{2018/05/01}{Font size \texttt{smaller} added}
+% \changes{v1.8}{2018/05/01}{Font sizes \texttt{smaller} and \texttt{larger} added}
+% \begin{macrocode}
+\DeclareCaptionFont{smaller}{\caption@smaller}
+\DeclareCaptionFont{larger}{\caption@larger}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{none}{}
+\DeclareCaptionFont{normal}{%
+ \caption@font@normalcolor\@unused
+ \caption@font@normalfont\@unused
+ \caption@font@normalsize\@unused
+ \caption@font@singlespacing\@unused}
+% \end{macrocode}
+%
+% `default' usually maps to `none'.
+% \begin{macrocode}
+\SetCaptionDefault{font}{none}
+\SetCaptionDefault{labelfont}{none}
+\SetCaptionDefault{textfont}{none}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@smaller}
+% |\caption@smaller|\\
+% selects a font size which is smaller than the current one.
% \begin{macrocode}
\newcommand\caption@smaller{%
\ifx\@currsize\tiny
@@ -2091,10 +2387,12 @@
Cannot determine current font size.\MessageBreak
Try setting it with `size=' explicitly}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-\DeclareCaptionFont{smaller}{\caption@smaller}
% \end{macrocode}
+% \end{macro}
%
-% \changes{v1.8}{2018/05/02}{Font size \texttt{larger} added}
+% \begin{macro}{\caption@larger}
+% |\caption@larger|\\
+% selects a font size which is larger than the current one.
% \begin{macrocode}
\newcommand\caption@larger{%
\ifx\@currsize\tiny
@@ -2122,23 +2420,20 @@
Cannot determine current font size.\MessageBreak
Try setting it with `size=' explicitly}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-\DeclareCaptionFont{larger}{\caption@larger}
% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\caption@hypersetup}
+% |\caption@hypersetup|\marg{options}\\
+% expands to |\hypersetup|\marg{options} if defined, to nothing otherwise.
% \begin{macrocode}
-\DeclareCaptionFont{singlespacing}{}
+\newcommand*\caption@hypersetup{\caption@ifdefined\hypersetup\hypersetup\@gobble}
+\DeclareCaptionFont{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup{font={hypersetup=...}}
+\DeclareCaptionOption{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
% \end{macrocode}
+% \end{macro}
%
-% \begin{macrocode}
-%\DeclareCaptionFont{normal}{%
-% \caption@font{normalcolor,normalfont,normalsize,singlespacing}
-\DeclareCaptionFont{normal}{%
- \caption@font*{%
- \KV@caption@fnt@normalcolor\@unused
- \KV@caption@fnt@normalfont\@unused
- \KV@caption@fnt@normalsize\@unused
- \KV@caption@fnt@singlespacing\@unused}}
-% \end{macrocode}
+% \section{Sizes}
%
% \changes{v1.0a}{2004/01/23}{Option \opt{size=} now sets \cs{captionsize} instead of \cs{captionfont}}
% The old versions \version{1.x} of \thispackage\ offered this
@@ -2146,51 +2441,46 @@
% so old documents will work fine.
% \begin{macrocode}
\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
-\DeclareCaptionDefaultFont{size}{}
+\caption@setmapping{size}{font}
+% \end{macrocode}
+%
+% `default' usually maps to `none'.
+% \begin{macrocode}
+\SetCaptionDefault{size}{none}
% \end{macrocode}
%
% \section{Justifications}
%
% \begin{macro}{\DeclareCaptionJustification}
-% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces
-% between arguments do make any harm}
+% \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces between arguments do make any harm}
% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
-% |\DeclareCaptionJustification|\marg{name}\marg{code}
+% \changes{v2.0}{2020/07/26}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionJustification|\oarg{package}\marg{name}\marg{code}
% \begin{macrocode}
\newcommand*\DeclareCaptionJustification{%
- \def\caption@@@declarefont##1##2{%
- \global\@namedef{caption@hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
- \let\caption@@@declarefont\@gobbletwo}%
- \DeclareCaptionFont}
-\@onlypreamble\DeclareCaptionJustification
+% \caption@decl@package{justification}{\caption@decl{justification}}} % Because of floatrow it isn't so easy...
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\DeclareCaptionDefaultJustification}
-% \changes{v1.1}{2007/07/03}{This macro added}
-% \changes{v1.2a}{2008/01/31}{Renamed from \cs{DeclareDefaultCaptionJustification} to \cs{DeclareCaptionDefaultJustification}}
-% |\DeclareCaptionDefaultJustification|\marg{code}
+% Unfortunately the (unmaintained) \package{floatrow} uses the old storage scheme
+% of the \package{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
+% additionally, so |\flrow@FBo|\-|Align| will still work fine.
% \begin{macrocode}
-\newcommand*\DeclareCaptionDefaultJustification[1]{%
- \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
- \DeclareCaptionDefaultFont{@hj}{#1}}
-\@onlypreamble\DeclareCaptionDefaultJustification
+ \caption@withoptargs\caption@declare@justification}
% \end{macrocode}
-% \end{macro}
-%
% \begin{macrocode}
-\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
-\DeclareCaptionDefaultJustification{}
+\newcommand*\caption@declare@justification[3]{%
+ \caption@decl@package{justification}{\caption@decl{justification}}#1{#2}{#3}%
+ \expandafter\let\csname caption@hj@#2\expandafter\endcsname\csname caption@justification@#2\endcsname}
+\@onlypreamble\DeclareCaptionJustification
% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\caption@setjustification}
-% \changes{v1.1}{2007/07/03}{Mapped to \cs{caption@setfont}}
-% |\caption@setjustification|\marg{name}\par
-% Selecting a caption justification simply means saving the code (in |\caption@hj|).
% \begin{macrocode}
-\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+\DeclareCaptionOption{justification}{%
+ \caption@load@package{justification}{#1}%
+ \caption@set{justification}{#1}}
% \end{macrocode}
-% \end{macro}
%
% These are the pre-defined justification code snippets.
% \begin{macrocode}
@@ -2202,10 +2492,15 @@
\DeclareCaptionJustification{raggedright}{\raggedright}
% \end{macrocode}
%
+% `default' usually maps to `justified'.
+% \begin{macrocode}
+\SetCaptionDefault{justification}{justified}
+% \end{macrocode}
+%
% \begin{macro}{\centerfirst}
% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerfirst} to \cs{centerfirst}}
-% Please blame Frank Mittelbach for the code of |\centerfirst| |:-)|
+% Please blame Frank Mittelbach for the code of |\center|\-|first| |:-)|
% \begin{macrocode}
\providecommand\centerfirst{%
\let\\\@centercr
@@ -2224,7 +2519,7 @@
% \begin{macro}{\centerlast}
% \changes{v1.0j}{2007/01/21}{Bugfix: Usage of \cs{@centercr} added (Thanks to Olga!)}
% \changes{v1.0j}{2007/01/21}{This macro renamed from \cs{caption@centerlast} to \cs{centerlast}}
-% This is based on code from Anne Br\"uggemann-Klein\cite{Anne}
+% This one is based on code from Anne Br\"uggemann-Klein\cite{Anne}.
% \begin{macrocode}
\providecommand\centerlast{%
\let\\\@centercr
@@ -2238,8 +2533,8 @@
%
% \begin{macro}{\abovecaptionskip}
% \begin{macro}{\belowcaptionskip}
-% Usually these skips are defined within the document class, but some
-% document classes don't do so.
+% Usually these skips are defined within the document class, but some
+% document classes don't.
% \begin{macrocode}
\caption@ifundefined\abovecaptionskip{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
@@ -2258,8 +2553,8 @@
%
% \begin{macro}{\caption@rule}
% \changes{v1.2b}{2008/05/06}{This macro added}
-% |\caption@rule|\par
-% Draws an invisible rule to adjust the ``skip'' setting.
+% |\caption@rule|\\
+% Draws an invisible rule to adjust the ``skip'' setting.
% \begin{macrocode}
\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
% \end{macrocode}
@@ -2284,57 +2579,71 @@
% usually has to take care for himself that this hint actually matches the
% right position.
%
+% \begin{macro}{\caption@declare@position}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@declare@position|\marg{name}\marg{code}\\
+% declares a captionposition setting of the given \meta{name},
+% \meta{code} must either expand to |\@first|\-|of|\-|two| (top) or
+% |\@second|\-|of|\-|two| (below).
+% \begin{macrocode}
+\newcommand*\caption@declare@position[2]{%
+ \caption@decl{position}{#1}{#2}}
+\@onlypreamble\caption@declare@position
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
\DeclareCaptionOption{position}{\caption@setposition{#1}}
% \end{macrocode}
% \changes{v1.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
% \begin{macrocode}
-\DeclareCaptionOption{figureposition}{%
- \captionsetup*[figure]{position=#1}}
+\DeclareCaptionOption{figureposition}{\captionsetup*[figure]{position=#1}}
\@onlypreamble@key{caption}{figureposition}
% \end{macrocode}
% \begin{macrocode}
-\DeclareCaptionOption{tableposition}{%
- \captionsetup*[table]{position=#1}}
+\DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
\@onlypreamble@key{caption}{tableposition}
% \end{macrocode}
%
% \begin{macro}{\caption@setposition}
-% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
-% \opt{below}, and \opt{a} are allowed, too}
+% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b}, \opt{below}, and \opt{a} are allowed, too}
% \changes{v1.0c}{2004/08/10}{Usage of \cs{caption@defaultpos} added}
-% |\caption@setposition|\marg{position}\par
-% Selecting the caption position means that we put |\caption@position| to
-% the right value. \emph{Please do \textbf{not} use the internal macro
-% \cs{caption@position} in your own package or document, but use the wrapper
-% macro \cs{caption@iftop} instead.}
-% \begin{macrocode}
-\newcommand*\caption@setposition[1]{%
- \caption@ifinlist{#1}{d,default}{%
- \let\caption@position\caption@defaultpos
- }{\caption@ifinlist{#1}{t,top,above}{%
- \let\caption@position\@firstoftwo
- }{\caption@ifinlist{#1}{b,bottom,below}{%
- \let\caption@position\@secondoftwo
- }{\caption@ifinlist{#1}{a,auto}{%
- \let\caption@position\@undefined
- }{%
- \caption@Error{Undefined position `#1'}%
- }}}}}
+% \changes{v2.0}{2020/07/27}{Uses \cs{caption@set} now}
+% |\caption@setposition|\marg{position}\\
+% puts |\caption@position| to the right value.
+% \emph{Please do \textbf{not} use the internal macro
+% \cs{caption@position} in your own package or document, but use the
+% wrapper command \cs{caption@iftop} instead.}\par
+% (Note: Since this command is used by the \package{floatrow} package as well
+% its syntax should not change.)
+% \begin{macrocode}
+\newcommand*\caption@setposition{\caption@set{position}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@defaultpos}
+% These are the pre-defined position code snippets.
+% \begin{macrocode}
+\caption@declare@position{t}{\@firstoftwo}
+\caption@declare@position{top}{\@firstoftwo}
+\caption@declare@position{above}{\@firstoftwo}
+\caption@declare@position{b}{\@secondoftwo}
+\caption@declare@position{bottom}{\@secondoftwo}
+\caption@declare@position{below}{\@secondoftwo}
+\caption@declare@position{a}{\caption@autoposition}% needed by floatrow package, \flrow@cappos
+\caption@declare@position{auto}{\caption@autoposition}
+% \end{macrocode}
+%
% \changes{v1.1}{2007/05/08}{Default position changed from `bottom' to `auto'}
-% The default `position' is `auto', this means that \thispackage\ will try
-% to guess the current position of the caption.
-% (But in many cases, for example in |longtable|s, this is doomed to fail!)\par
-% The setting `bottom' correspondents to the |\@makecaption| implementation
-% in the standard \LaTeX\ document classes, but `auto' should give better
-% results in most cases.
+% `default' usually maps to `auto'.
% \begin{macrocode}
-%\caption@setdefaultpos{a}% default = auto
-\let\caption@defaultpos\@undefined
+\SetCaptionDefault{position}{auto}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@autoposition}
+% \changes{v2.0}{2020/07/27}{This macro added}
+% If in doubt, `position=auto' maps to `position=below'.
+% \begin{macrocode}
+\let\caption@autoposition\@secondoftwo
% \end{macrocode}
% \end{macro}
%
@@ -2342,70 +2651,51 @@
% \changes{v1.0a}{2004/01/23}{Split into \cs{caption@iftop} \& \cs{caption@fixposition}}
% \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption@defaultpos}}
% \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
-% |\caption@iftop|\marg{true-code}\marg{false-code}\par
-% (If the |position=| is set to |auto| we assume a |bottom| position here.)
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@iftop|\marg{true-code}\marg{false-code}\\
+% Since version \version{2.0} this command is identical to |\caption@position|.
% \begin{macrocode}
-\newcommand*\caption@iftop{%
- \ifx\caption@position\@undefined
- \let\caption@position\@secondoftwo
-% = \caption@setposition b%
- \fi
- \caption@position}
+\newcommand*\caption@iftop{\caption@position}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@fixposition}
-% \changes{v1.0b}{2004/05/16}{%
-% Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
-% |\caption@fixposition|\par
-% This macro checks if the `position' is set to `auto'.
-% If yes, |\caption@autoposition| will be called to
-% set |\caption@position| to a proper value we can actually use.
+% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
+% \changes{v1.0b}{2004/05/16}{Split into \cs{caption@fixposition} & \cs{caption@autoposition}}
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@fixposition|\\
+% We try to guess the current position of the caption by checking |\prev|\-|depth|.\par
+% 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.)\par
+% 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.
% \begin{macrocode}
\newcommand*\caption@fixposition{%
- \ifx\caption@position\@undefined
- \caption@autoposition
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@autoposition}
-% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
-% |\caption@autoposition|\par
-% We guess the current position of the caption by checking |\prevdepth|.\par
-% A different solution would be setting the |\spacefactor| to something
-% not much less than 1000 (for example 994) in |\caption@start| and
-% checking this value here by |\ifnum\spacefactor=994|.
-% (It's implemented in the \package{threeparttable}
-% package\cite{threeparttable} this way.)\par
-% Another idea would be checking |\@ifminipage|, but since some packages
-% typeset the caption within a simple |\vbox| this does not seem to be a
-% good one.
-% \begin{macrocode}
-\newcommand*\caption@autoposition{%
\ifvmode
\edef\caption@tempa{\the\prevdepth}%
\caption@Debug{\protect\prevdepth=\caption@tempa}%
\ifdim\prevdepth>-\p@
- \let\caption@position\@secondoftwo
+ \let\caption@autoposition\@secondoftwo % position=below
\else
- \let\caption@position\@firstoftwo
+ \let\caption@autoposition\@firstoftwo % position=above
\fi
-% = \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
\else
\caption@Debug{no \protect\prevdepth}%
- \let\caption@position\@secondoftwo
-% = \caption@setposition b%
+ \let\caption@autoposition\@secondoftwo % position=below
\fi}
% \end{macrocode}
% \end{macro}
+%
% \begin{macro}{\caption@setautoposition}
% \changes{v1.1}{2007/06/10}{This macro added}
-% |\caption@setautoposition|\marg{position}\par
-% replaces the above algorithm by a different one (or a fixed position setting).
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+% |\caption@setautoposition|\marg{position}\\
+% replaces the above algorithm by a different one (or a fixed position setting).
% \begin{macrocode}
\newcommand*\caption@setautoposition[1]{%
- \def\caption@autoposition{\caption@setposition{#1}}}
+ \def\caption@fixposition{\caption@@set{position}{autoposition}{#1}}}
% \end{macrocode}
% \end{macro}
%
@@ -2413,9 +2703,10 @@
%
% \begin{macro}{\AtBeginCaption}
% \begin{macro}{\AtEndCaption}
-% |\AtBeginCaption| \marg{code}\\
-% |\AtEndCaption| \marg{code}\par
-% These hooks can be used analogous to |\AtBeginDocument| and |\AtEndDocument|.
+% |\AtBeginCaption|\marg{code}\\
+% |\AtEndCaption|\marg{code}\\
+% These hooks can be used analogous to |\At|\-|Begin|\-|Document| and
+% |\At|\-|End|\-|Document|.
% \begin{macrocode}
\newcommand*\caption@beginhook{}
\newcommand*\caption@endhook{}
@@ -2436,10 +2727,14 @@
%
% \begin{macro}{\caption@setlist}
% \changes{v1.2a}{2008/03/20}{This macro added}
-% |\caption@setlist|\marg{boolean}
+% |\caption@setlist|\marg{boolean value}\\
+% sets the `list' option to either `off' or `on'.
% \begin{macrocode}
\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
% \end{macrocode}
+% \begin{macrocode}
+\caption@setlist{on}
+% \end{macrocode}
% \end{macro}
%
% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
@@ -2451,7 +2746,8 @@
%
% \begin{macro}{\caption@setlisttype}
% \changes{v1.4}{2011/08/30}{This macro added}
-% |\caption@setlisttype|\marg{type}
+% |\caption@setlisttype|\marg{type}\\
+% sets the `listtype' option to the given \meta{type}.
% \begin{macrocode}
\newcommand*\caption@setlisttype{%
\caption@setlisttype@ext{}%
@@ -2463,9 +2759,11 @@
\ifx#1\@empty \let#1\@undefined \fi}
% \end{macrocode}
% \end{macro}
+%
% \begin{macro}{\caption@setlisttype@ext}
% \changes{v1.4}{2011/08/30}{This macro added}
-% |\caption@setlisttype@ext|\marg{type extension}
+% |\caption@setlisttype@ext|\marg{type extension}\\
+% sets the `listtype' option to the given \meta{type extension}.
% \begin{macrocode}
\newcommand*\caption@setlisttype@ext{%
\caption@@setlisttype\caption@listtype@ext}
@@ -2475,10 +2773,11 @@
% \begin{macro}{\DeclareCaptionListFormat}
% \changes{v1.1}{2004/07/15}{This macro added}
% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
-% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
+% \changes{v2.0}{2020/07/26}{Uses \cs{caption@decl} now}
+% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
% \begin{macrocode}
\newcommand*\DeclareCaptionListFormat[2]{%
- \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+ \caption@decl{listformat}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionListFormat
% \end{macrocode}
% \end{macro}
@@ -2486,53 +2785,33 @@
% \changes{v1.1}{2007/07/15}{Option \opt{listofformat=} added}
% \changes{v1.2}{2007/11/17}{Option \opt{listofformat=} renamed to \opt{listformat=}}
% \begin{macrocode}
-\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
+\DeclareCaptionOption{listformat}{\caption@set{listformat}{#1}}
% \end{macrocode}
%
-% \begin{macro}{\caption@setlistformat}
-% \changes{v1.1}{2004/07/15}{This macro added}
-% \changes{v1.2}{2007/11/17}{Renamed from \cs{caption@setlistofformat} to \cs{caption@setlistformat}}
-% |\caption@setlistformat|\marg{name}\par
-% Selecting a caption list format simply means saving the code (in |\caption@lstfmt|).
-% \begin{macrocode}
-\newcommand*\caption@setlistformat[1]{%
- \@ifundefined{caption@lstfmt@#1}%
- {\caption@Error{Undefined list format `#1'}}%
- {\expandafter\let\expandafter\caption@lstfmt
- \csname caption@lstfmt@#1\endcsname}}
-% \end{macrocode}
-% \end{macro}
-%
-% There are five pre-defined list formats, taken from the \package{subfig} package.
+% There are seven pre-defined list formats. (The first five were taken from the \package{subfig} package.)
% \begin{macrocode}
\DeclareCaptionListFormat{empty}{}
\DeclareCaptionListFormat{simple}{#1#2}
-\DeclareCaptionListFormat{parens}{#1(#2)}
\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
\DeclareCaptionListFormat{subparens}{(#2)}
+\DeclareCaptionListFormat{period}{#1#2.}
+\DeclareCaptionListFormat{subperiod}{#2.}
% \end{macrocode}
%
-% \begin{macro}{\caption@setdefaultlistformat}
-% \changes{v1.2d}{2009/03/29}{This macro added}
-% \begin{macrocode}
-\newcommand*\caption@setdefaultlistformat[1]{%
- \ifx\caption@lstfmt\caption@lstfmt@default
- \caption@set@default@listformat{#1}%
- \caption@setlistformat{default}%
- \else
- \caption@set@default@listformat{#1}%
- \fi}
-% \end{macrocode}
+% `default' usually maps to `subsimple'.
% \begin{macrocode}
-\newcommand*\caption@set@default@listformat[1]{%
- \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
+\SetCaptionDefault{listformat}{subsimple}
% \end{macrocode}
-% \end{macro}
%
-% `default' usually maps to `subsimple'.
+% \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.)
% \begin{macrocode}
-\caption@set@default@listformat{subsimple}
+\newcommand*\caption@lstfmt{\caption@listformat}
% \end{macrocode}
+% \end{macro}
%
% \section{Debug option}
% \changes{v1.0k}{2007/03/04}{Debug option added}
@@ -2551,12 +2830,70 @@
\setkeys{caption}{debug=0}
% \end{macrocode}
%
-% \section{Document classes \& Babel support}
+% \section{Document class support}
+% \changes{v2.0}{2018/05/11}{Document class support re-written}
+%
+% \begin{macro}{\@makecaption@standard}
+% \begin{macrocode}
+% article|report|book.sty [2005/09/16 v1.4f Standard LaTeX document class]
+\newcommand\@makecaption@standard[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@standard
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption@arabic}
+% \begin{macrocode}
+% arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)]
+\newcommand\@makecaption@arabic[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+ \if@rl{
+ \ifdim \wd\@Arabitempboxa >\hsize
+ \textRL{#2} : #1\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+ \fi}\else{
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}\fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@arabic
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption@latvian}
+% \begin{macrocode}
+% latvian.ldf [2018/02/19 v2.0b Latvian support from the babel system]
+\newcommand\@makecaption@latvian[2]{%
+ \vskip10\p@
+ \sbox\@tempboxa{#1\if\empty#2\else: #2\fi}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1: #2\par
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}
+\@onlypreamble\@makecaption@latvian
+% \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.)
+% 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}
@@ -2564,8 +2901,8 @@
%
% \begin{macro}{\caption@documentclass}
% \changes{v1.8e}{2018/05/11}{This macro added}
-% Determine document class used.
-% Set |\caption@document|\-|class| by good-guessing, if not already set.
+% Determine document class used.
+% Set |\caption@document|\-|class| by good-guessing, if not already set.
% \begin{macrocode}
\caption@ifundefined\caption@documentclass{%
% \end{macrocode}
@@ -2589,19 +2926,19 @@
\caption@InfoNoLine{KOMA-Script document class detected}%
\def\caption@documentclass{koma}%
% \end{macrocode}
-% If |\@captionheadfont| is defined, we assume it's a AMS or SMF document class.
+% If |\@captionheadfont| is defined, we assume it's a AMS or SMF document class.
% \begin{macrocode}
}{\caption@ifdefined\@captionheadfont{%
\caption@InfoNoLine{AMS or SMF document class detected}%
- \def\caption@documentclass{ams}%
+ \def\caption@documentclass{ams-smf}%
% \end{macrocode}
-% If |\@CaptionFonts| is defined, we assume it's a NTG Dutch document class.
+% If |\CaptionFonts| is defined, we assume it's a NTG Dutch document class.
% \begin{macrocode}
}{\caption@ifdefined\CaptionFonts{%
\caption@InfoNoLine{NTG document class detected}%
\def\caption@documentclass{ntg}%
% \end{macrocode}
-% If |\cph@font| and |\cpb@font| are defined, we assume it's a NTG Dutch document class.
+% If |\cph@font| and |\cpb@font| are defined, we assume it's the thesis document class.
% \begin{macrocode}
}{\caption@ifdefined\cph@font{%
\caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo
@@ -2612,453 +2949,376 @@
\def\caption@documentclass{thesis}%
}{%
% \end{macrocode}
-% If the definition of |\@makecaption| matches the one from the standard \LaTeX\ document classes
-% |article|, |report|, or |book|, we assume it's either one of them or is compatible to them.
+% If the definition of |\@make|\-|caption| matches the one from the standard
+% \LaTeX\ document classes |article|, |report|, or |book|, we assume it's
+% either one of them or is compatible to them.
% \begin{macrocode}
- % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
- \long\def\caption@tempa#1#2{%
- \vskip\abovecaptionskip
- \sbox\@tempboxa{#1: #2}%
- \ifdim \wd\@tempboxa >\hsize
- #1: #2\par
- \else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
- \fi
- \vskip\belowcaptionskip}}
- \ifx\caption@tempa\@makecaption
- \caption@InfoNoLine{Standard document class detected}%
+ \ifx\@makecaption\@undefined
+ \caption@InfoNoLine{Document class w/o caption stuff detected}%
\else
+ \ifx\@makecaption\@makecaption@standard
+ \caption@InfoNoLine{Standard document class detected}%
+ \else
+ \ifx\@makecaption\@makecaption@arabic
+ \caption@InfoNoLine{arabic babel option detected}%
+ \else
+ \ifx\@makecaption\@makecaption@latvian
+ \caption@InfoNoLine{latvian babel option detected}%
+ \else
% \end{macrocode}
-% Otherwise we are clueless and use standard default settings for the captions anyway.
-% (And we unset the |document|\-|class| flag to indicate that the content of |\caption@document|\-|class| is not correct.)
+% Otherwise we are clueless and use standard default settings for the captions.
+% (And we unset the |document|\-|class| flag to indicate that the content of
+% |\caption@document|\-|class| is not correct.)
% \begin{macrocode}
- \caption@InfoNoLine{%
- Unknown document class (or package),\MessageBreak
- standard defaults will be used}%
- \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
- \caption@setbool{documentclass}{0}%
+ \caption@InfoNoLine{%
+ 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
+ \fi
+ \fi
+ \fi
\fi
- \def\caption@documentclass{base}%
- }}}}}}%
-}{}
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@ifclassloaded}
-% \changes{v1.8e}{2019/09/09}{This macro added}
-% |\caption@ifclassloaded|\marg{name}\marg{yes-code}\marg{no-code}
% \begin{macrocode}
-\newcommand*\caption@ifclassloaded[1]{%
- \edef\caption@tempa{#1}%
- \ifx\caption@tempa\caption@documentclass
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi}
+ \let\caption@documentclass\@empty % don't load adaption code later on
+ }}}}}}}%
+}{}
% \end{macrocode}
% \end{macro}
%
-% \subsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
-%
-% Since this is the default, there is no extra work to be done here.
-%
-% \subsection{The elsarticle classes}
-% \changes{v1.5}{2013/01/06}{elsarticle class support added}
-%
+% \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).
% \begin{macrocode}
-\caption@ifclassloaded{elsarticle}{%
+\newcommand*\AtCaptionPackage{%
+ \g@addto@macro\caption@documentclass@code}
+\@onlypreamble\AtCaptionPackage
% \end{macrocode}
% \begin{macrocode}
- \DeclareCaptionDefaultFont{font}{\footnotesize}
+\providecommand*\caption@documentclass@code{}
+\@onlypreamble\caption@documentclass@code
% \end{macrocode}
+% \end{macro}
+%
+% \section{Babel support}
+%
+% \begin{macro}{\caption@IfBabelPackageLoaded}
+% |\caption@IfBabelPackageLoaded|\marg{option}\marg{cmd}\marg{yes-code}\marg{no-code}\\
+% expands the given \meta{yes-code} if |\caption@if|\-|babel@|\meta{option}
+% is set and \meta{cmd} is defined.
+% Otherwise the \meta{no-code} is expanded.\par
+% This way the adaption could be prevented by defining
+% \begin{quote}|\def\caption@ifbabel@|\meta{option}|{false}|\end{quote}
% \begin{macrocode}
-}{}
+\newcommand*\caption@IfBabelPackageLoaded[4]{%
+ \caption@ifdefined#2\@firstofone\caption@AtBeginDocument{%
+ \caption@if@bool{\@nameuse{caption@ifbabel@#1}}%
+ {\def\caption@tempa{\caption@ifdefined#2}}%
+ {\let\caption@tempa\@secondoftwo}%
+ \caption@tempa
+ {\caption@InfoNoLine{#1 babel package is loaded}#3}%
+ {#4}}}
+\@onlypreamble\caption@IfBabelPackageLoaded
% \end{macrocode}
+% \end{macro}
%
-% \subsection{The \AmS{} \& \SmF{} classes}
-% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
+% \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}
%
% \begin{macrocode}
-\caption@ifclassloaded{ams}{%
+\DeclareCaptionLabelSeparator{arabi}{\if@rl\space\fi: }
% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelArabi}
+% |\caption@IfBabelArabic|\marg{yes-code}\marg{no-code}
% \begin{macrocode}
- \let\captionmargin\captionindent % set to 3pc by AMS class
- \begingroup\edef\@tempa{\endgroup
- \noexpand\caption@g@addto@list\noexpand\caption@sty@default
- {margin=\the\captionmargin
- \caption@ifdefined\smf@makecaption{,maxmargin=.1\linewidth}{}}}
- \@tempa
- \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
- \DeclareCaptionLabelSeparator{default}{.\enspace}
- \DeclareCaptionDefaultFont{font}{\@captionfont}
- \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
- \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
- \captionsetup[figure]{position=b}
- \captionsetup[table]{position=t}
+\newcommand*\caption@IfBabelArabi{%
+ \caption@IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
+\@onlypreamble\caption@IfBabelArabi
% \end{macrocode}
% \begin{macrocode}
-}{}
+\providecommand*\caption@ifbabel@arabi{true}
% \end{macrocode}
-%
-% \subsection{The beamer class (Part one)}
-% \changes{v1.1}{2007/03/10}{\package{beamer} class support added}
-% \changes{v1.3}{2011/08/06}{\package{beamer} class support revised}
-% \changes{v1.5}{2013/04/27}{The \package{beamer} template \texttt{caption label separator} will be used now}
-% \changes{v1.7}{2016/05/22}{Re-definition of label format \texttt{simpleMagyar} added to \package{beamer} class support}
-% \changes{v1.7}{2018/04/15}{Re-definition of label format \texttt{simpleMagyar} revised}
-% \changes{v1.7}{2018/05/01}{Definition of \package{beamer} default label font revised}
+% \end{macro}
%
% \begin{macrocode}
-\caption@ifclassloaded{beamer}{%
+\caption@IfBabelArabi{%
% \end{macrocode}
%
-% \begin{macro}{\caption@ifbeamertemplate}
-% |\caption@ifbeamertemplate|\marg{caption template name}\marg{yes-code}\marg{no-code}\\
-% tests if the given beamer caption template was selected by the user (or not).
+% \begin{macro}{\caption@rl}
+% \changes{v1.8}{2018/05/20}{This macro added}
% \begin{macrocode}
- \newcommand*\caption@ifbeamertemplate[1]{%
- \begingroup
- \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
- \@nameuse{beamer@@tmpop@caption@#1}%
- \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
- \endgroup\expandafter\@firstoftwo
- \else
- \endgroup\expandafter\@secondoftwo
- \fi}
+ \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}%
% \end{macrocode}
% \end{macro}
%
+% If the language `arabic' or `farsi' is selected, we switch the default label separator to `arabi'.
+%
% \begin{macrocode}
- \DeclareCaptionLabelFormat{default}{%
- \caption@ifbeamertemplate{numbered}%
- \caption@lfmt@simple
- \caption@lfmt@unnumbered
- {#1}{#2}}
-% \end{macrocode}
-% The \package{magyar} babel package redefines the current label format to a one called |simple|\-|Magyar|,
-% defined within |\@@magyar@caption|\-|fix| which will be executed |\At|\-|Begin|\-|Document|.
-% \begin{macrocode}
- \DeclareCaptionLabelFormat{default@magyar}{%
- \caption@ifbeamertemplate{numbered}%
- \caption@lfmt@simple@magyar
- \caption@lfmt@unnumbered
- {#1}{#2}}
- \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
- \@ifundefined{@@magyar@captionfix}{}{%
- \g@addto@macro\@@magyar@captionfix{%
- \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
- \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}}
+ \caption@ifdefined\extrasarabic{%
+ \addto\extrasarabic{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
+ \caption@ifdefined\extrasfarsi{%
+ \addto\extrasfarsi{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
% \end{macrocode}
+%
% \begin{macrocode}
- \caption@declarelabelseparator
- {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
- {default}
- {\caption@ifbeamertemplate{caption name own line}{\\}%
- {\usebeamertemplate{caption label separator}}}
- \DeclareCaptionDefaultFont{font}{%
- \usebeamerfont*{caption}%
- \usebeamercolor[fg]{caption}}
- \DeclareCaptionDefaultFont{labelfont}{%
- \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
- \usebeamercolor[fg]{caption name}%
- \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
- \usebeamerfont{caption name}}
- \DeclareCaptionDefaultJustification{\raggedright}
+}{%
+ \let\caption@rl\@firstofone
+}
% \end{macrocode}
+%
+% \subsection{The french babel option}
+% \changes{v1.1}{2006/05/14}{\package{frenchb} babel support added}
+% \changes{v2.0}{2020/08/01}{\package{french} babel support updated}
+%
+% We provide a dummy `french' caption label separator (so |labelsep=french| works fine);
+% it will be re-defined dependant on the `french' package used later on.
% \begin{macrocode}
- \DeclareOption{beamerclass}{%
- \renewcommand\caption@ifslc{%
- \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
- % Since the beamer class do not offer a `list of figures' we switch this support off.
- \captionsetup{list=0}}
- \PassOptionsToPackage{beamerclass}{caption3}
+\caption@ifdecl{labelseparator}{french}
+ {\let\caption@french@labelseparator\@undefined}%
+ {\caption@@set{labelseparator}{labelseparator@french}{default}%
+ \let\caption@french@labelseparator\caption@labelseparator@french}
% \end{macrocode}
%
-% If the \package{beamer} document class is used, we offer a beamer
-% template called `caption3' which can be used with option `beamer' or
-% |\setbeamertemplate{caption}[caption3]|.\par
-% (Note that this is of no use when the \package{caption} package is used, too.)
+% \begin{macro}{\caption@IfBabelFrench}
+% |\caption@IfBabelFrench|\marg{yes-code}\marg{no-code}
% \begin{macrocode}
- \defbeamertemplate{caption}{caption3}{%
- \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
+\newcommand*\caption@IfBabelFrench{%
+ \caption@IfBabelPackageLoaded{french}{\FB@makecaption}}
+\@onlypreamble\caption@IfBabelFrench
% \end{macrocode}
% \begin{macrocode}
- \DeclareOption{beamer}{%
- % \usebeamertemplate**{caption} will set font
- \DeclareCaptionDefaultFont{font}{}%
- \setbeamertemplate{caption}[caption3]}
+\providecommand*\caption@ifbabel@french{true}
% \end{macrocode}
-% \begin{macrocode}
+% \end{macro}
%
-% \begin{macrocode]
-}{}
+% \begin{macrocode}
+\caption@IfBabelFrench{%
% \end{macrocode}
%
-% \subsection{The KOMA-Script classes}
-% \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added}
+% If the language `french' is selected, we switch the default label separator to `french'
+% which uses |\if|\-|FB|\-|Customise|\-|Fig|\-|Tab|\-|Captions| and |\Caption|\-|Separator|.
%
% \begin{macrocode}
-\caption@ifclassloaded{koma}{%
-% \end{macrocode}
-% \begin{macrocode}
- \DeclareCaptionFormat{default}[#1#2#3\par]{%
- \ifdofullc@p
- \caption@ifin@list\caption@lsepcrlist\caption@lsepname
- {\caption@Error{%
- The option `labelsep=\caption@lsepname' does not work\MessageBreak
- with \noexpand\setcaphanging (which is set by default)}}%
- {\caption@fmt@hang{#1}{#2}{#3}}%
- \else
- #1#2%
- \ifdim\cap@indent<\z@
- \par
- \noindent\hspace*{-\cap@indent}%
- \else\if@capbreak
- \par
- \fi\fi
- #3\par
- \fi}
- \DeclareCaptionLabelSeparator{default}{\captionformat}
- \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
- \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
-% \end{macrocode}
-%
-% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script:
-% A special version of options `parindent' and `parskip' added}
-% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of
-% `parskip' and `parindent' options revised and moved into caption kernel}
-% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and
-% `parindent' are obsolete now, removed}
-% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and
-% `parindent' re-added, since they still collide with the current
-% version of the subfig package (Sigh!)}
-%
-% There is an option clash between the \KOMAScript\ document classes
-% and the \package{caption} kernel, both define the options |parindent| and
-% |parskip| but with different meaning.
-% Furthermore the ones defined by the \package{caption} kernel take a
-% value as parameter but the \KOMAScript\ ones do not.
-% So we need special versions of the options |parindent| and |parskip| here
-% which determine if a value is given (and therefore should be treated as
-% our option) or not (and therefore should be ignored by us).\footnote{%^^A
-% This problem was completely solved due a change of \cs{caption@ProcessOptions}
-% in \thispackage\ \version{1.0h}, but we still need this workaround since
-% these options would otherwise still collide with the current version $1.3$
-% of the \package{subfig} package (Sigh!)}
-% \begin{macrocode}
- \let\caption@KV@parindent\KV@caption@parindent
- \DeclareCaptionOption{parindent}[]{%
- \ifx,#1,%
- \caption@Debug{Option `parindent' ignored}%
- \else
- \caption@KV@parindent{#1}%
- \fi}%
+ \ifx\caption@french@labelseparator\caption@labelseparator@french % still set to dummy label separator?
+ \DeclareCaptionLabelSeparator{french}{%
+ \ifFBCustomiseFigTabCaptions
+ \CaptionSeparator
+ \else
+ \space : %
+ \fi}%
+ \fi
+ \caption@ifdefined\extrasfrench{%
+ \addto\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
% \end{macrocode}
+%
+% Suppress the warning about load order (since it's not longer valid anymore).
% \begin{macrocode}
- \let\caption@KV@parskip\KV@caption@parskip
- \DeclareCaptionOption{parskip}[]{%
- \ifx,#1,%
- \caption@Debug{Option `parskip' ignored}%
- \else
- \caption@KV@parskip{#1}%
- \fi}%
+ \caption@AtBeginDocument{\@nameuse{@FBwarning@capsepfalse}}%
% \end{macrocode}
+%
% \begin{macrocode}
}{}
% \end{macrocode}
%
-% \subsection{The \NTG{} Dutch classes}
-% \changes{v1.1}{2007/04/06}{NTG classes support added}
+% \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}
%
+% \begin{macro}{\caption@IfFrenchLe}
+% |\caption@IfFrenchLe|\marg{yes-code}\marg{no-code}
% \begin{macrocode}
-\caption@ifclassloaded{ntg}{%
+\newcommand*\caption@IfFrenchLe{%
+ \caption@IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
+\@onlypreamble\caption@IfBabelFrenchLe
% \end{macrocode}
% \begin{macrocode}
- \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
- \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+\providecommand*\caption@ifbabel@frenchle{true}
% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
-}{}
+\caption@IfFrenchLe{%
% \end{macrocode}
%
-% \subsection{The thesis class}
-% \changes{v1.2a}{2008/01/31}{thesis class support added}
-% \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised}
+% If the language `french' is selected, we switch the default label separator to `french'
+% which uses |\caption|\-|separator|, and switch the default font to `it' and the default label font to `up'.
%
% \begin{macrocode}
-\caption@ifclassloaded{thesis}{%
+ \ifx\caption@french@labelseparator\caption@labelseparator@french % still set to dummy label separator?
+ \DeclareCaptionLabelSeparator{french}{\captionseparator\space}%
+ \fi
+ \g@addto@macro\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\let\caption@original@labelseparator#1}{french}%
+ \caption@switchdefault{font}{\let\caption@original@font#1}{it}%
+ \caption@switchdefault{labelfont}{\let\caption@original@labelfont#1}{up}}%
+ \g@addto@macro\extrasenglish{%
+ \caption@restoredefault{labelseparator}{\caption@original@labelseparator}%
+ \caption@restoredefault{font}{\caption@original@font}%
+ \caption@restoredefault{labelfont}{\caption@original@labelfont}}%
% \end{macrocode}
+%
+% Since the \package{frenchle} package overwrites |\caption|\-|font| and |\caption|\-|label|\-|font|
+% (within |\GOfrench|) we need to save them beforehand and restore them afterwards.
+%
% \begin{macrocode}
- \DeclareCaptionDefaultFormat{hang}
- \DeclareCaptionDefaultFont{labelfont}{\cph@font}
- \DeclareCaptionDefaultFont{textfont}{\cpb@font}
+ \caption@AtBeginDocument{%
+ \let\captionfont@original\captionfont
+ \let\captionlabelfont@original\captionlabelfont}%
+ \g@addto@macro\GOfrench{%
+ \let\captionfont\captionfont@original
+ \let\captionlabelfont\captionlabelfont@original}%
% \end{macrocode}
+%
% \begin{macrocode}
}{}
% \end{macrocode}
%
-% \subsection{The arabic Babel option}
-% \changes{v1.8}{2018/05/20}{\package{arabic} babel package support added}
+% \subsection{The hungarian \& magyar babel option}
+% \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}
%
% \begin{macrocode}
-\caption@ifdefined\ArabiCoreLoaded{%
+\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
% \end{macrocode}
%
-% \begin{macro}{\caption@rl}
-% \changes{v1.8}{2018/05/20}{This macro added}
+% \begin{macro}{\caption@IfBabelHungarian}
+% |\caption@IfBabelHungarian|\marg{yes-code}\marg{no-code}
% \begin{macrocode}
- \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}
+\newcommand*\caption@IfBabelHungarian{%
+ \caption@IfBabelPackageLoaded{hungarian}{\magyar@opt@defaults}}
+\@onlypreamble\caption@IfBabelHungarian
% \end{macrocode}
-% \end{macro}
-%
% \begin{macrocode}
- \def\fnum@figure{\figurename\nobreakspace\thefigure}%
- \def\fnum@table{\tablename\nobreakspace\thetable}%
-% \end{macrocode}
-% \begin{macrocode}
- \DeclareCaptionLabelSeparator{arabi}{ : }
- \DeclareCaptionLabelSeparator{default}{%
- \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi}
+\providecommand*\caption@ifbabel@hungarian{true}
% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
-}{%
- \let\caption@rl\@firstofone
-}
+\caption@IfBabelHungarian{%
% \end{macrocode}
%
-% \subsection{The frenchb Babel option}
-% \changes{v1.1}{2006/05/14}{\package{frenchb} babel package support added}
+% If the language `hungarian' or `magyar' is selected,
+% we switch the default label format to `magyar', the default separator to `period',
+% and the default list format to `subperiod'.
%
% \begin{macrocode}
-\caption@ifdefined\FB@makecaption{%
-% \end{macrocode}
-% \begin{macrocode}
- \ifx\@makecaption\STD@makecaption
- \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
- \def\caption@frenchb{% supress frenchb warning
- \let\STD@makecaption\@makecaption
- \let\FB@makecaption\@makecaption}
- \else
- \ifx\@makecaption\@undefined\else
- \caption@InfoNoLine{%
- The definition of \protect\@makecaption\space
- has been changed,\MessageBreak
- frenchb will NOT customize it}%
- \fi
- \fi
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
% \end{macrocode}
+%
% \begin{macrocode}
}{}
% \end{macrocode}
%
-% \subsection{The frenchle/pro package}
-% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
+% \subsection{The latvian babel option}
%
% \begin{macrocode}
-\caption@ifdefined\frenchTeXmods{%
+\DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
% \end{macrocode}
+%
+% \begin{macro}{\caption@IfBabelLatvian}
+% |\caption@IfBabelLatvian|\marg{yes-code}\marg{no-code}
% \begin{macrocode}
- \DeclareCaptionDefaultFont{textfont}{\itshape}%
- \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+\newcommand*\caption@IfBabelLatvian{%
+ \caption@IfBabelPackageLoaded{latvian}{\bbl@latvianindent}}
+\@onlypreamble\caption@IfBabelLatvian
% \end{macrocode}
% \begin{macrocode}
-}{}
+\providecommand*\caption@ifbabel@latvian{true}
% \end{macrocode}
-%
-% \subsection{The hungarian and magyar Babel option}
-% \changes{v1.3}{2009/03/29}{\package{magyar} package support added}
-% \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised}
-% \changes{v1.8b}{2018/08/26}{\package{magyar} package support revised}
+% \end{macro}
%
% \begin{macrocode}
-\DeclareCaptionListFormat{subperiod}{#2.}
+\caption@IfBabelLatvian{%
% \end{macrocode}
%
+% If the language `latvian' is selected, we switch the default label format to `latvian'.
+%
% \begin{macrocode}
-\def\caption@tempa#1{%
- \@ifpackagewith{babel}{#1}{%
- \caption@InfoNoLine{#1 babel option is loaded}%
- \expandafter\addto\csname extras#1\endcsname{%
- % change default labelsep and listformat
- \caption@setdefaultlabelsep{period}%
- \caption@setdefaultlistformat{subperiod}}%
- \expandafter\addto\csname noextras#1\endcsname{%
- % change default labelsep and listformat
- \caption@setdefaultlabelsep{colon}%
- \caption@setdefaultlistformat{subsimple}}%
- }{}}
+ \caption@ifdefined\extraslatvian{%
+ \addto\extraslatvian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{latvian}}}{}%
% \end{macrocode}
+%
% \begin{macrocode}
-\caption@tempa{hungarian}
-\caption@tempa{magyar}
+}{}
% \end{macrocode}
%
-% TODO: babel-latvian/latvian.ldf
-%
% \section{Package support}
%
-% \begin{macro}{\caption@xpackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption@xpackage|\marg{macro}\marg{package}\marg{option}
-% expands the given macro if the given package is not loaded.
-% (Note: We cannot use |\@ifpackageloaded| here since it's not available after |\AtBeginDocument|.)
+% \begin{macro}{\caption@ifpackageloaded}
+% \changes{v2.0}{2020/07/26}{This macro added}
+% |\caption@ifpackageloaded|\marg{package}\marg{yes-code}\marg{no-code}\\
+% expands the given code if the given package is (not) loaded.
+% (Note: We cannot use |\@if|\-|package|\-|loaded| here since it's not
+% available after |\At|\-|Begin|\-|Document|.)
% \begin{macrocode}
-\newcommand*\caption@xpackage[2]{%
- \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
- \expandafter\@firstofone
+\newcommand*\caption@ifpackageloaded[1]{%
+ \expandafter\ifx\csname ver@#1.\caption@pkgextension\endcsname\relax
+ \expandafter\@secondoftwo
\else
- \expandafter\@gobbletwo
- \fi
- {#1{#2}}}
+ \expandafter\@firstoftwo
+ \fi}
% \end{macrocode}
% \begin{macrocode}
\let\caption@pkgextension\@pkgextension
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@loadpackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption@loadpackage|\marg{package}\marg{caption option}
-% loads the given package immediately.
-% \begin{macrocode}
-\newcommand*\caption@loadpackage{%
- \caption@xpackage\caption@@loadpackage}
-% \end{macrocode}
+% \begin{macro}{\caption@pkg@list}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% We used this in the past as list of packages loaded
+% |\At|\-|Begin|\-|Document|.
+% (Note: Old |.aux| files could contain
+% |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
+% so this macro should always be defined, even if we don't use it anymore.)
% \begin{macrocode}
-\newcommand*\caption@@loadpackage[2]{%
- \caption@Info{Option `#2' requires the `#1' package}%
- \RequirePackage{#1}\relax}
+\newcommand*\caption@pkg@list{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@requirepackage}
% \changes{v1.10}{2020/05/10}{This macro added}
-% |\caption@requirepackage|\marg{package}\marg{caption option}
-% indicates that the given package option needs a package.
+% \changes{v2.0}{2020/07/27}{This macro revised}
+% |\caption@requirepackage|\marg{package}\marg{option}\marg{value}\\
+% indicates that the given package option needs a package.
% \begin{macrocode}
-\newcommand*\caption@requirepackage{%
- \caption@xpackage\caption@@requirepackage}
+\newcommand*\caption@requirepackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@requirepackage[2]{%
- \@cons\caption@packagelist{{#1}{#2}}}% load package later on
+ \@cons\caption@packagelist{{#1}{#2}}} % load package later on
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@pkg@list}
-% \changes{v1.4b}{2012/01/12}{This macro added}
-% We used this in the past as list of packages loaded |\AtBeginDocument|.
-% (Note: Old |.aux| files could contain |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
-% so this macro should always be defined, even if we change the following code in the future.)
% \begin{macrocode}
-\newcommand*\caption@pkg@list{}
+\caption@AtBeginDocument{%
+ \renewcommand*\caption@@requirepackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@packagelist}
% \changes{v1.11}{2020/05/10}{This macro added}
-% We use this as list of packages loaded |\AtBeginDocument|.
+% We use this as list of packages loaded |\At|\-|Begin|\-|Document|.
% \begin{macrocode}
\newcommand*\caption@packagelist{}
\@onlypreamble\caption@packagelist
@@ -3071,45 +3331,131 @@
\g@addto@macro\caption@tempa{%
\caption@loadpackage{#1}{#2}}}%
\caption@packagelist
- \caption@tempa
+ \caption@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@loadpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% \changes{v2.0}{2020/07/26}{This macro revised}
+% |\caption@loadpackage|\marg{package}\marg{option}\marg{value}\\
+% loads the given package immediately.
+% \begin{macrocode}
+\newcommand*\caption@loadpackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
% \end{macrocode}
% \begin{macrocode}
- \renewcommand*\caption@@loadpackage[2]{%
- \caption@Error{Option `#2' requires the `#1' package}}%
- \let\caption@@requirepackage\caption@@loadpackage
- }
+\caption@AtBeginDocument{%
+ \let\caption@@loadpackage\caption@@requirepackage}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@usepackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption@usepackage|\marg{package}\marg{option}\marg{code}
-% loads the given package and executes the given code.
-% (Note: Since the package might use the crappy \package{keyval}
-% package, too, we need to save \& restore some macros here, otherwise this
-% recursion won't work properly.)
+% \subsection{The floatrow package}
+% \changes{v2.0}{2020/07/28}{Adaptions to the \package{floatrow} package added}
+%
+% Since the \package{floatrow} package is not maintained anymore,
+% we have to make adaptions to \thispackage~\version{2.0} here.
+% Please note that we only support the version $0.3b$ of the \package{floatrow} package,
+% so older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+%
% \begin{macrocode}
-\newcommand*\caption@usepackage[3]{%
- \IfCaptionOptionCheck
- {\caption@requirepackage{#1}{#2}}%
- {\let\KV@prefix@ORI\KV@prefix
- \let\@tempc@ORI\@tempc
- \caption@loadpackage{#1}{#2}%
- #3%
- \let\@tempc\@tempc@ORI
- \let\KV@prefix\KV@prefix@ORI}}
+\caption@AtBeginDocument{%
+ \def\@tempa{2008/08/02 v0.3b floatrow: float package extension}%
+ \expandafter\ifx\csname ver@floatrow.sty\endcsname\@tempa
+ \caption@InfoNoLine{floatrow package v0.3b is loaded}%
+% \end{macrocode}
+%
+% \begin{macro}{\captionlabel}
+% |\caption@format| needs to be expanded prior the use of |\caption@@@make|.
+% \begin{macrocode}
+ \renewcommand\captionlabel[1]{{% l.559
+ \def\FR@tmp{\@captype}%
+ \ifnum\floatbox@depth>\@ne
+ \def\FR@tmp{sub\@captype}\caption@setsubtype*{\FR@tmp}\stepcounter{\FR@tmp}%
+ \fi
+ \caption@format % <= This line added
+ \caption@@@make{\caption@fnum\FR@tmp}{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow@setstyle}
+% This patch isn't working since |\flrow@setstyle| will be used by
+% \package{floatrow} right after loading \package{caption3}.
+% For this reason we still define |\caption@sty@|\meta{name} in
+% |\Declare|\-|Caption|\-|Style| instead.
+% \begin{macrocode}
+% \renewcommand*\flrow@setstyle[1]{% l.986
+% \@ifundefined{flrow@sty@#1}%
+% {\flrow@error{Undefined float style `#1'}}%
+% {\FBstyle@reset
+% \def\flrow@capsetup{%
+% \caption@ifdecl{style}{#1}{\caption@setstyle*{#1}}{}%
+% \caption@setoptions{#1}}%
+% \flrow@esetup{\csname flrow@sty@#1\endcsname}}}
+% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\flrow@FBoAlign}
+% This patch isn't working since |\flrow@FBoAlign| will be used by
+% \package{floatrow} right after loading \package{caption3}.
+% For this reason we still define |\caption@hj@|\meta{name} in
+% |\Declare|\-|Caption|\-|Justification| instead.
+% \begin{macrocode}
+% \renewcommand*\flrow@FBoAlign[1]{% l.1168
+% \caption@ifdecl{justification}{#1}%
+% {\expandafter\let\expandafter\floatobjectset
+% \csname caption@justification@#1\endcsname}%
+% {\flrow@error{Undefined object setting `#1'}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow@setFRsep}
+% This patch isn't working since |\flrow@setFRsep| will be used by
+% \package{floatrow} right after loading \package{caption3}.
+% For this reason we still define |\caption@lsep@|\meta{name} in
+% |\Declare|\-|Caption|\-|Label|\-|Separator| instead.
+% \begin{macrocode}
+% \renewcommand*\flrow@setFRsep[2]{% l.1187
+% \caption@ifdecl{labelseparator}{#2}%
+% {\@nameuse{caption@labelseparator@#2}% defines \caption@labelsep
+% \let#1\caption@labelsep}%
+% {\flrow@error{Undefined float separator `#2'}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \fi}
+% \end{macrocode}
+%
% \subsection{The newfloat package}
%
% \begin{macro}{\caption@newfloat}
% \changes{v1.4b}{2012/01/12}{This macro added}
% \changes{v1.8h}{2020/01/03}{Usage of \cs{caption@ifpackageloaded} replaced by \cs{RequirePackage}}
% \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption@usepackage}}
-% |\caption@newfloat|\marg{option}\marg{code}
-% loads the \package{newfloat} package and executes the given code afterwards.
-% \begin{macrocode}
-\newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
+% \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}
+% package, too, we need to save \& restore some macros here, otherwise this
+% recursion won't work properly.)
+% \begin{macrocode}
+\newcommand*\caption@newfloat[2]{%
+ \IfCaptionOptionCheck
+ {\caption@requirepackage{newfloat}{#1}}%
+ {\let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@loadpackage{newfloat}{#1}%
+ #2%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}}
+% \end{macro}
% \end{macrocode}
% \end{macro}
%
@@ -3138,8 +3484,9 @@
% \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.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
-% |\caption@SetName|\marg{float}\marg{name}
-% \begin{macrocode}
+% |\caption@SetName|\marg{float}\marg{name}\\
+% loads the \package{newfloat} package and uses |\newfloat@set|\-|name|.
+% \begin{macrocode}
\newcommand*\caption@SetName[2]{%
\caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
\@onlypreamble\caption@SetName
@@ -3152,7 +3499,8 @@
% \end{macrocode}
%
% \begin{macro}{\caption@setname}
-% |\caption@setname|\marg{float}\marg{name}
+% |\caption@setname|\marg{float}\marg{name}\\
+% sets the given float name, e.g.: `Figure` for `figure`.
% \begin{macrocode}
\newcommand*\caption@setname[2]{%
\@namedef{#1name}{#2}}
@@ -3173,10 +3521,11 @@
% \changes{v1.2}{2007/12/21}{This macro added}
% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
-% |\caption@within|\marg{float}\marg{value}
+% |\caption@within|\marg{float}\marg{value}\\
+% loads the \package{newfloat} package and uses |\newfloat@set|\-|within|.
% \begin{macrocode}
\newcommand*\caption@within[2]{%
- \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
+ \caption@newfloat{#1within=#2}{\newfloat@setwithin{#1}{#2}}}
% \end{macrocode}
% \end{macro}
%
@@ -3185,7 +3534,7 @@
%
% \begin{macrocode}
\DeclareCaptionOption{within}{%
- \caption@newfloat{within}{\newfloatsetup{within=#1}}}
+ \caption@newfloat{within=#1}{\newfloatsetup{within=#1}}}
\DeclareCaptionOptionNoValue{without}{%
\caption@newfloat{without}{\newfloatsetup{without}}}
% \end{macrocode}
@@ -3227,14 +3576,15 @@
% \end{macrocode}
%
% \subsection{The subfig package}
-% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+% \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}
%
% Since the \package{subfig} package is not maintained anymore,
-% we have to make several adaptions to \thispackage~\version{1.1} here.
-% Please note that we only support the version $1.3$ of the \package{subfig} package here.
-% So older versions do not work with this version of \thispackage, and newer
+% 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,
+% so older versions do not work with this version of \thispackage, and newer
% versions are expected to be adapted.
+%
% \begin{macrocode}
\caption@AtBeginDocument{%
\def\@tempa{2005/06/28 ver: 1.3 subfig package}%
@@ -3253,7 +3603,7 @@
% \end{macrocode}
%
% \begin{macro}{\@dottedxxxline}
-% New version of |\@dottedxxxline|
+% New version of |\@dottedxxxline|
% \begin{macrocode}
\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
\begingroup
@@ -3269,7 +3619,7 @@
%
% \begin{macro}{\sf@subfloat}
% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
-% New version of |\sf@subfloat|
+% New version of |\sf@subfloat|
% \begin{macrocode}
\def\sf@NEW@subfloat{%
\begingroup
@@ -3297,21 +3647,10 @@
%
% Make the \package{subfig} package documentation compile.
% \begin{macrocode}
-%%\@ifl@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
% \end{macrocode}
%
-% \section{Execution of options}
-%
-% \begin{macrocode}
-\captionsetup{style=default,position=default,%
- list,listformat=default,twoside=\if@twoside 1\else 0\fi}
-% \end{macrocode}
-% \begin{macrocode}
-\ProcessOptions*
-% \end{macrocode}
-%
% \section{Making an `List of' entry}
%
% \begin{macro}{\caption@addcontentsline}
@@ -3324,10 +3663,9 @@
% \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}
-% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
-% Makes an entry in the list-of-whatever, if requested,
-% i.e.~the argument \meta{list entry} is not empty and
-% |listof=| was set to |true|.
+% |\caption@addcontentsline|\marg{type}\marg{list entry}\\
+% makes an entry in the list-of-whatever, if requested, i.e.~the argument
+% \meta{list entry} is not empty and |list|\-|of=| was set to |true|.
% \begin{macrocode}
\newcommand\caption@addcontentsline[2]{%
\caption@ifcontentsline{#2}{%
@@ -3357,7 +3695,7 @@
\caption@add@contentsline
{\csname ext@#1\endcsname}%
{#1}%
- {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\caption@listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
{\ignorespaces #2}%
\caption@chkfloat{#1}{#2}}}}
% \end{macrocode}
@@ -3400,39 +3738,54 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@aboveskip}
+% \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.
+% \begin{macrocode}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\caption@fnum}
% \changes{v1.1}{2007/08/21}{This macro added}
-% |\caption@fnum|\marg{float type}\par
-% Typesets the caption label; as replacement for |\fnum@|\meta{float type}.
+% \changes{v2.0}{2020/08/03}{The original definition will be stored in \cs{caption@original@fnum}}
+% |\caption@fnum|\marg{float type}\\
+% typesets the caption label; this acts as replacement for |\fnum@|\meta{float type}.
% \begin{macrocode}
-\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+\newcommand*\caption@fnum[1]{%
+ \expandafter\let\expandafter\caption@original@fnum\csname caption@fnum@#1\endcsname % for label format `original'
+ \caption@labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@make}
-% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\par
-% Typesets the caption.
+% |\caption@make|\marg{float name}\marg{ref.\ number}\marg{text}\\
+% typesets the caption.
% \begin{macrocode}
-\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+\newcommand\caption@make[2]{\caption@@make{\caption@labelformat{#1}{#2}}}
% \end{macrocode}
% \end{macro}
%
% \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: \cs{hskip}\cs{captionmargin} to the end
-% of caption 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: \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}
-% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifh} added}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption@ifhmode} added}
% \changes{v1.0c}{2005/02/09}{Bugfix: \cs{leavevmode} added}
% \changes{v1.0f}{2005/08/24}{Uses \cs{sbox} instead of \cs{setbox} in single-line-check}
% \changes{v1.0g}{2005/12/04}{Uses \cs{caption@slc} now}
-% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside
-% single-line-check replaced by \cs{relax}}
-% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be
-% typeset in horizontal mode}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@calcmargin} inside single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption@startbox} will always be typeset in horizontal mode}
% \changes{v1.0i}{2006/05/13}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
% \changes{v1.0j}{2007/01/04}{Oops, bugfix 04-05-05 got lost in v1.0h, re-added}
% \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added}
@@ -3443,7 +3796,7 @@
% \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.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
-% |\caption@@make|\marg{caption label}\marg{caption text}
+% |\caption@@make|\marg{caption label}\marg{caption text}
% \begin{macrocode}
\newcommand\caption@@make[2]{%
\begingroup
@@ -3456,56 +3809,49 @@
\caption@stepthecounter
\caption@beginhook
% \end{macrocode}
-%
-% Typeset the outer box |\caption@box|
+% Typeset the outer box |\caption@box|
% \begin{macrocode}
\caption@box\hsize{%
% \end{macrocode}
-%
-% Special single-line treatment (option |singlelinecheck=|)
+% Special single-line treatment (option |singlelinecheck=|)
% \begin{macrocode}
- \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}%
+ \caption@singlelinecheck{\caption@slc{#1}{#2}\caption@singleline\caption@multiline}{\caption@multiline}%
% \end{macrocode}
-%
-% Typeset the left margin (option |margin=|)
+% Typeset the left margin (option |margin=|)
% \begin{macrocode}
\caption@calcmargin
\caption@tempdima\captionmargin
\ifdim\captionmargin@=\z@ \else
\caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}%
\fi
- \caption@ifh{\advance\caption@tempdima\caption@indent}%
+ \caption@ifhmode{\advance\caption@tempdima\caption@indent}%
\hspace\caption@tempdima
% \end{macrocode}
-%
-% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
-% to typeset the caption.
-% \Note{\cs{captionindent} is \emph{not} supported if the caption format
-% was defined with \cs{DeclareCaptionFormat*}.}
+% We actually use a |\vbox| of width |\captionwidth - \caption@indent|
+% to typeset the caption.
+% \Note{\cs{captionindent} is \emph{not} supported if the caption format
+% was defined with \cs{DeclareCaptionFormat*}.}
% \begin{macrocode}
\caption@tempdima\captionwidth
- \caption@ifh{\advance\caption@tempdima-\caption@indent}%
+ \caption@ifhmode{\advance\caption@tempdima-\caption@indent}%
\caption@parbox\caption@tempdima{%
% \end{macrocode}
-%
-% Typeset the indention (option |indention=|)\\
-% {\small Bugfix 04-05-05:
-% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
+% Typeset the indention (option |indention=|)\\
+% {\small Bugfix 04-05-05:
+% |\hskip-\caption@indent| replaced by |\ifdim\caption@indent=\z@|\ldots}
% \begin{macrocode}
- \caption@ifh{%
+ \caption@ifhmode{%
\ifdim\caption@indent=\z@
\leavevmode
\else
\hskip-\caption@indent
\fi}%
% \end{macrocode}
-%
-% Typeset the caption itself and close the |\caption@parbox|
+% Typeset the caption itself and close the |\caption@parbox|
% \begin{macrocode}
\caption@@@make{#1}{#2}}%
% \end{macrocode}
-%
-% Typeset the right margin (option |margin=|)
+% Typeset the right margin (option |margin=|)
% \begin{macrocode}
\caption@tempdima\captionmargin
\ifdim\captionmargin@=\z@ \else
@@ -3513,12 +3859,10 @@
\fi
\hspace\caption@tempdima
% \end{macrocode}
-%
-% Close the outer box |\caption@box|
+% Close the outer box |\caption@box|
% \begin{macrocode}
}%
% \end{macrocode}
-%
% \begin{macrocode}
\caption@endhook}
% \end{macrocode}
@@ -3534,14 +3878,14 @@
% \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}}
-% |\caption@calcmargin|\par
-% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
-% values.
+% |\caption@calcmargin|\\
+% calculates |\caption|\-|margin| and |\caption|\-|width|, so both contain
+% valid values.
% \begin{macrocode}
\newcommand*\caption@calcmargin{%
\caption@calcmargin@hook
% \end{macrocode}
-% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set
+% Check margin, if |\caption@min|\-|margin| or |\caption@max|\-|margin| is set
% \begin{macrocode}
\ifx\caption@maxmargin\@undefined \else
\ifdim\captionmargin>\caption@maxmargin\relax
@@ -3579,23 +3923,22 @@
% \end{macro}
%
% \begin{macro}{\caption@slc}
-% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} added}
-% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{caption@sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption@justification}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption@setup}\cs{\caption@sls} added after \cs{begingroup}}
% \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} added}
-% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
-% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.1c}{2007/10/14}{\cs{caption@setup}\cs{\caption@opt@SingleLine} outsourced to \cs{caption@SingleLine}}
% \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}}
% \changes{v1.5}{2012/12/26}{Merged into a single macro again}
-% \changes{v1.5}{2013/04/14}{Definition and usage of \cs{ifsinglelinecaption} added}
-% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\par
-% This one does the single-line-check.
+% \changes{v1.5}{2013/04/14}{Usage of \cs{ifsinglelinecaption} added}
+% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\\
+% This one does the single-line-check.
% \begin{macrocode}
\newcommand\caption@slc[4]{%
\caption@Debug{Begin SLC}%
\singlelinecaptiontrue
\begingroup
\caption@singleline
- \let\caption@hj\@empty
+ \let\caption@justification\relax
\caption@calcmargin % calculate \captionwidth
\caption@prepareslc
\sbox\@tempboxa{\caption@@@make{#1}{#2}}%
@@ -3609,47 +3952,72 @@
\fi
\caption@Debug{End SLC}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifsinglelinecaption}
+% \changes{v1.5}{2013/04/14}{This definition added}
+% |\ifsinglelinecaption|\\
+% could be used inside own caption formats to test if the caption is
+% currently typeset as single-line caption (or not).
% \begin{macrocode}
\newif\ifsinglelinecaption
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@singleline}
+% \changes{v1.1c}{2007/10/14}{This macro extracted from \cs{caption@slc}}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added}
+% \changes{v1.1d}{2007/10/23}{This macro renamed from \cs{caption@SingleLine} to \cs{caption@singleline} for consistency}
+% |\caption@singleline|\\
+% prepares the typesetting of a single-line caption.
% \begin{macrocode}
\newcommand*\caption@singleline{%
- \caption@xsetup\caption@opt@singleline
+ \caption@xsetup\caption@slsty % Note: This could change \caption@format
+ \caption@format % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
\let\caption@fmt\caption@slfmt}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\caption@multiline}
+% \changes{v2.0}{2020/07/28}{This macro added}
+% |\caption@multiline|\\
+% prepares the typesetting of a multi-line caption.
+% \begin{macrocode}
+\newcommand*\caption@multiline{%
+ \caption@format} % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@prepareslc}
% \changes{v1.0b}{2004/05/16}{Bugfix: 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@hj}\cs{relax} added}
+% \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.1}{2007/06/13}{\cs{let}\cs{caption@hj}\cs{relax} moved to \cs{caption@slc}}
+% \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}
% \changes{v1.1c}{2007/10/06}{Definition of \cs{caption@l@stepcounter} added}
% \changes{v1.3}{2011/07/07}{Bugfix 11-07-06: Redefinition of \cs{footnote} and \cs{footnotemark} added, redefinition of \cs{stepcounter} and \cs{refstepcounter} dropped}
-% \changes{v1.4a}{2011/10/21}{Redefinition of \cs{pagenote} from \textsf{memoir} document class added}
% \changes{v1.4a}{2011/10/22}{Redefinition of \cs{footnote} revised}
% \changes{v1.5}{2013/04/13}{Redefinition os \cs{glsunset} added}
% \changes{v1.8}{2018/01/21}{Redefinition of \cs{endnote} added (thanks to Markus Kohm)}
% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
% \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{v1.12b}{2020/07/20}{Special adaption to \class{beamer} added}
-% |\caption@prepareslc|\par
-% Re-define anything which would disturb the single-line-check.
+% |\caption@prepareslc|\\
+% re-defines anything which could disturb the single-line-check.
% \begin{macrocode}
\providecommand*\caption@prepareslc{}
\g@addto@macro\caption@prepareslc{%
\let\label\caption@gobble
\let\hypertarget\@gobbletwo
% \end{macrocode}
-% We re-define \cs{footnote} so
-% \begin{enumerate}
-% \item The footnote counter will not be increased twice (but still the correct footnote mark will be used within the single-line-check)
-% \item The footnote text will not be evaluated twice
-% \end{enumerate}
+% We re-define \cs{footnote} so
+% \begin{enumerate}
+% \item The footnote counter will not be increased twice (but still the
+% correct footnote mark will be used within the single-line-check)
+% \item The footnote text will not be evaluated twice
+% \end{enumerate}
% \begin{macrocode}
\let\caption@footnote@ORI\footnote
\def\footnote{\caption@withoptargs\caption@footnote}%
@@ -3658,7 +4026,7 @@
\let\caption@footnotetext@ORI\@footnotetext
\let\@footnotetext\caption@gobble
% \end{macrocode}
-% Same for \cs{endnote}
+% Same for \cs{endnote}
% \begin{macrocode}
\let\caption@endnote@ORI\endnote
\def\endnote{\caption@withoptargs\caption@endnote}%
@@ -3667,22 +4035,19 @@
\let\caption@endnotetext@ORI\@endnotetext
\let\@endnotetext\caption@gobble
% \end{macrocode}
-% \begin{macrocode}
- \let\pagenote\caption@gobble
-% \end{macrocode}
-% Adaption to the \package{acronym} package\par
-% See also \url{https://tex.stackexchange.com/questions/428788}
+% Adaption to the \package{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
-% 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
-% See also \url{https://tex.stackexchange.com/questions/108368}
+% Adaption to the \package{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
+% See also \url{https://tex.stackexchange.com/questions/108368}
% \begin{macrocode}
\let\glsunset\@gobble
% \end{macrocode}
@@ -3715,88 +4080,66 @@
\newcommand*\caption@l@stepcounter[1]{%
\advance\csname c@#1\endcsname\@ne\relax}
% \end{macrocode}
-% The patch above assumes that the optional arguments of \cs{footnote} and
-% \cs{footnotemark} match. Since this is not the case in \class{beamer} based documents,
-% and since \class{beamer} extents the syntax of \cs{footnote} in a special way,
-% we need a special patch here.\par
-% \emph{Note:} For this patch we assume that \cs{footnote} will always end with the usage of
-% \cs{beamer@footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
-% in \class{beamer} to offer a less dirty patch.)
-% \begin{macrocode}
-\caption@ifclassloaded{beamer}{%
- \g@addto@macro\caption@prepareslc{%
- \def\footnote{%
- \begingroup
- \let\stepcounter\caption@l@stepcounter
- \renewcommand<>\beamer@framefootnotetext[1]{%
- \endgroup}%
- \let\@footnotetext\beamer@framefootnotetext
- \caption@footnote@ORI}}}{}
-% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@applyfont}
% \changes{v1.3}{2010/09/04}{This macro added}
-% |\caption@applyfont|\par
-% This macro executes the font relevant macros, i.e. by default
-% the options set by |justification=|, |font=|, and |size=|.
+% |\caption@applyfont|\\
+% applies the relevant font settings, i.e. by default
+% the options set by |justification=|, |font=|, and |size=|.
% \begin{macrocode}
\newcommand*\caption@applyfont{%
- \caption@hj\captionfont\captionsize}
+ \caption@justification\captionfont\captionsize}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@@@make}
% \changes{v1.0b}{2004/05/16}{Bugfix 04-05-06: \cs{allowhyphens} added}
-% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of
-% \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
+% \changes{v1.0c}{2005/02/12}{Bugfix 04-12-16: Use some kind of \cs{@startstrut}\cs{strutbox} instead of \cs{strut}}
% \changes{v1.0c}{2005/02/12}{Bugfix 05-01-23: \cs{@finalstrut}\cs{strutbox} added}
-% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty};
-% \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption@ifempty}; \cs{let}\cs{caption@ifstrut}\cs{@secondoftwo} added}
% \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption@star} changed}
% \changes{v1.0f}{2005/08/24}{Check for empty label added}
% \changes{v1.0f}{2005/08/25}{\cs{caption@iflf} added}
-% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@tfmt} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption@textformat} added}
% \changes{v1.1}{2007/05/07}{Bugfix: \cs{ifhmode} added to \cs{@finalstrut}}
% \changes{v1.2}{2007/11/17}{Made option \opt{size=} stronger than \opt{font=}}
% \changes{v1.3}{2010/09/04}{Uses \cs{caption@applyfont} now}
% \changes{v1.3}{2010/11/01}{Bugfix: If the caption text is empty, the text format will be set to \opt{simple} now}
-% \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{captiontextend}}
-% |\caption@@@make|\marg{caption label}\marg{caption text}\par
-% This one finally typesets the caption paragraph, without margin and indention.
+% \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}}
+% |\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}
-%
-% If the label is empty, we use no caption label separator.
+% If the label is empty, we use no caption label separator.
% \begin{macrocode}
\sbox\@tempboxa{#1}%
\ifdim\wd\@tempboxa=\z@
- \let\caption@lsep\relax
+ \caption@set{labelseparator}{none}%
% \@capbreakfalse
\fi
% \end{macrocode}
-%
-% If the text is empty, we use no caption label separator, too.
-% (And no text format either.)
+% If the text is empty, we use no caption label separator, too.
+% (And no text format either.)
% \begin{macrocode}
\caption@ifempty{#2}{%
- \let\caption@lsep\@empty
- \let\caption@tfmt\@firstofone
+ \caption@set{labelseparator}{none}%
+ \caption@set{textformat}{simple}%
% \@capbreakfalse
% \let\caption@ifstrut\@secondoftwo
}%
% \end{macrocode}
-%
-% Take care that |\caption@parindent| and |\caption@hangindent| will be used
-% to typeset the paragraph.
+% \begin{macrocode}
+ \caption@labelseparator % defines \caption@iflabelfont, \caption@labelsep and \caption@labelsep@name (the latter is needed by \caption@fmt)
+% \end{macrocode}
+% Take care that |\caption@par|\-|indent| and |\caption@hang|\-|indent|
+% will be used to typeset the paragraph.
% \begin{macrocode}
\@setpar{\@@par\caption@@par}\caption@@par
% \end{macrocode}
-%
-% Finally typeset the caption.
+% Finally typeset the caption.
% \begin{macrocode}
\caption@applyfont
\caption@fmt
@@ -3808,26 +4151,26 @@
\fi}%
{\ifcaption@star\else
\begingroup
- \caption@iflf\captionlabelfont
- \relax\caption@lsep
+ \caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep
\endgroup
\fi}%
{{\captiontextfont
- \captiontextstart
+ \caption@textstart
\caption@ifstrut
{\vrule\@height\ht\strutbox\@width\z@}%
{}%
\nobreak\hskip\z@skip % enable hyphenation
- \caption@tfmt{#2}%
+ \caption@textformat{#2}%
% \caption@ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
\caption@ifstrut
{\ifhmode\@finalstrut\strutbox\fi}%
{}%
- \captiontextend}}}
+ \caption@textend}}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\captiontextstart{}
-\newcommand*\captiontextend{\par}
+\newcommand*\caption@textstart{}
+\newcommand*\caption@textend{\par}
% \end{macrocode}
% \end{macro}
%
@@ -3836,12 +4179,12 @@
% \changes{v1.1}{2007/07/04}{Re-defines itself now}
% \changes{v1.2a}{2007/01/22}{Revised so \cs{label} will be detected, too}
% \changes{v1.2b}{2008/08/02}{Revised so \cs{index} and \cs{glossary} will be detected, too}
-% |\caption@ifempty|\marg{text}\marg{true} (\emph{no} \meta{false})\par
-% This one tests if the \meta{text} is actually empty.
-% \Note{This will be done without expanding the text,
-% therefore this is far away from being bullet-proof.}
-% \Note{This macro is re-defining itself so only
-% the first test (in a group) will actually be done.}
+% |\caption@ifempty|\marg{text}\marg{yes-code}\\
+% tests if the \meta{text} is actually empty.
+% \Note{This will be done without expanding the text,
+% therefore this is far away from being bullet-proof.}
+% \Note{This macro is re-defining itself so only
+% the first test (in a group) will actually be done.}
% \begin{macrocode}
\newcommand\caption@ifempty[1]{%
\caption@if@empty{#1}%
@@ -3890,8 +4233,8 @@
%
% \begin{macro}{\caption@@par}
% \changes{v1.0f}{2005/08/22}{Made this definition global}
-% |\caption@@par|\par
-% This command will be executed with every |\par| inside the caption.
+% |\caption@@par|\\
+% will be expanded with every |\par| inside the caption.
% \begin{macrocode}
\newcommand*\caption@@par{%
\parindent\caption@parindent\hangindent\caption@hangindent}%
@@ -3909,36 +4252,58 @@
% \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 as \package{newfloat} package}
-% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}\\
+% loads the \package{newfloat} package and uses |\Declare|\-|Floating|\-|Environment|.
% \begin{macrocode}
\newcommand*\DeclareCaptionType{%
- \caption@loadpackage{newfloat}{}%
+ \caption@loadpackage{newfloat}{declare type}%
\DeclareFloatingEnvironment}
\@onlypreamble\DeclareCaptionType
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@ForEachType}
+% \begin{macro}{\ForEachCaptionType}
% \changes{v1.4a}{2011/10/29}{This macro added}
-% |\caption@ForEachType|\marg{code}
-% will execute the given code for all (known) floating environments.
+% \changes{v1.13}{2020/07/29}{Renamed from \cs{caption@ForEachType} to \cs{ForEachCaptionType} and starred variant added}
+% |\ForEachCaptionType*|\marg{code with \#1}\\
+% 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).
+% \begin{macrocode}
+\newcommand*\ForEachCaptionType{%
+ \@ifstar
+ {\caption@foreach@type\@gobble}%
+ {\caption@foreach@type\@iden}}
+% \end{macrocode}
% \begin{macrocode}
-\newcommand\caption@ForEachType[1]{%
+\newcommand\caption@foreach@type[2]{%
\caption@ifdefined\ForEachFloatingEnvironment
- {\ForEachFloatingEnvironment{#1}}%
- {\def\@elt##1{#1}%
+ {\ForEachFloatingEnvironment*{#2}}%
+ {\def\@elt##1{#2}%
\caption@ifdefined\c@figure\@elt\@gobble{figure}%
\caption@ifdefined\c@table\@elt\@gobble{table}%
- \let\@elt\relax
- \newfloat@addtohook{#1}}}
+ \let\@elt\relax}%
+ #1{\newfloat@addtohook{#2}}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@addtohook}
+% |\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.
% \begin{macrocode}
\providecommand\newfloat@addtohook[1]{%
\toks@=\expandafter{\newfloat@hook{##1}#1}%
\edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
\@tempa}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat@hook}
+% Hook used in |\Declare|\-|Floating|\-|Environment|.
% \begin{macrocode}
\providecommand*\newfloat@hook[1]{}
% \end{macrocode}
@@ -3954,11 +4319,13 @@
% \changes{v1.5}{2013/01/10}{Bugfix: Definition of autoref string corrected}
% \changes{v1.6}{2013/06/17}{Bugfix: \cs{c@tocdepth} will be set (locally) now}
% \changes{v1.8g}{2020/01/02}{Check revised if the sub-type is already defined or not}
-% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
-% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
-% The starred variant provides the numbering format
-% \meta{type}|.|\meta{subtype} while the non-starred variant simply
-% uses \meta{subtype}.
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@l@addto@list} instead of \cs{@cons} now}
+% \changes{v1.13}{2020/07/29}{Usage of \cs{caption@subtype@hook} added}
+% \changes{v1.13}{2020/07/29}{We don't re-use existing counters anymore (This was a bad idea anyway)}
+% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\\
+% The starred variant provides the numbering format
+% \meta{type}|.|\meta{subtype} while the non-starred variant simply uses
+% \meta{subtype}.
% \begin{macrocode}
\newcommand*\DeclareCaptionSubType{%
\caption@teststar\caption@declaresubtype\@firstoftwo\@secondoftwo}
@@ -3973,39 +4340,42 @@
\def\caption@@declaresubtype#1[#2]#3{%
\@ifundefined{c@#3}%
{\caption@Error{No float type '#3' defined}}%
+ {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
+\@onlypreamble\caption@@declaresubtype
% \end{macrocode}
-% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
-% If not, define the counter and list entry.
% \begin{macrocode}
- {\caption@ifsubtype{sub#3}%
- {\caption@Debug{Modify subtype `sub#3'}}%
- {\caption@Debug{New subtype `sub#3'}%
- \@ifundefined{c@sub#3}%
- {\newcounter{sub#3}\relax}%
- {\caption@Warning{Using already defined counter `sub#3'}}%
- \@addtoreset{sub#3}{#3}%
- \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
- \caption@declaresublistentry{#3}%
- \@cons\caption@subtypelist{{#3}}}%
+\newcommand*\caption@@@declaresubtype[4]{%
% \end{macrocode}
-% Support of \package{titletoc} package
% \begin{macrocode}
- \caption@ifdefined\contentsuse{%
- \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}{}%
+% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
+% If not, define the counter and list entry.
+% \begin{macrocode}
+ \caption@ifin@list\caption@subtypelist{#4}%
+ {\caption@Debug{Modify subtype `#4'}}%
+ {\caption@Debug{New subtype `#4'}%
+ \newcounter{#4}[{#3}]%
+ \@namedef{ext@#4}{\csname ext@#3\endcsname}%
+ \caption@declaresublistentry{#3}%
+ \caption@l@addto@list\caption@subtypelist{#4}%
+ \caption@subtype@hook{#4}}%
% \end{macrocode}
+% Support of \package{titletoc} package
% \begin{macrocode}
- \@namedef{sub#3name}{}%
- \@namedef{sub#3autorefname}{\csname #3autorefname\endcsname}%
- #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
- {\@namedef{p@sub#3}{}%
- \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
- {\@namedef{p@sub#3}{\csname the#3\endcsname}%
- \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
- \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
- }}
+ \caption@ifdefined\contentsuse{%
+ \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
% \end{macrocode}
% \begin{macrocode}
-\@onlypreamble\caption@@declaresubtype
+ \@namedef{#4name}{}%
+ \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\@namedef{p@#4}{}%
+ \@namedef{the#4}{\csname the#3\endcsname.\@nameuse{#2}{#4}}}%
+ {\@namedef{p@#4}{\csname the#3\endcsname}%
+ \@namedef{the#4}{\@nameuse{#2}{#4}}}%
+ \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
+% \end{macrocode}
+% \begin{macrocode}
+\@onlypreamble\caption@@@declaresubtype
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@declaresublistentry{%
@@ -4026,12 +4396,12 @@
% \begin{macrocode}
\long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption@nil#3{%
\def\@tempa{#1}%
-% Does \l@(sub)subsection start with \@dottedtocline?
+% Does \l@(sub)subsection start with \@dottedtocline?
\ifx\@tempa\@empty
-% Yes
+% Yes
\caption@@@@declaresublistentry{#3}#2\caption@nil
\else
-% No
+% No
\caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption@nil
\fi}
\@onlypreamble\caption@@@declaresublistentry
@@ -4067,8 +4437,8 @@
% \end{macro}
%
% \begin{macro}{\caption@subtypelist}
-% An \cs{@elt}-list containing the subtypes defined
-% with |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% A list containing the sub-types defined with
+% |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \begin{macrocode}
\newcommand*\caption@subtypelist{}
% \end{macrocode}
@@ -4076,53 +4446,68 @@
%
% \begin{macro}{\caption@ifsubtype}
% \changes{v1.8g}{2020/01/02}{This macro added}
-% This macro checks if the given subtype was defined
-% with |\Declare|\-|Caption|\-|Sub|\-|Type| or not.
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@ifin@list} now}
+% |\caption@ifsubtype|\marg{yes-code}\marg{no-code}\\
+% checks if the given subtype was defined with
+% |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \begin{macrocode}
-\newcommand*\caption@ifsubtype[1]{%
- \begingroup
- \let\next\@secondoftwo
- \edef\@tempa{#1}%
- \def\@elt##1{%
- \def\@tempb{sub##1}%
- \ifx\@tempa\@tempb
- \let\next\@firstoftwo
- \fi}%
- \caption@subtypelist
- \expandafter\endgroup\next}
+\newcommand*\caption@ifsubtype{%
+ \caption@ifin@list\caption@subtypelist}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ForEachCaptionSubType}
+% \changes{v1.13}{2020/07/29}{This macro added as replacement for \cs{caption@For}}
+% |\ForEachCaptionSubType*|\marg{code with \#1}\\
+% will execute the given code for each (known) sub-type.
+% The starred variant will only work for already existing sub-types,
+% i.e.~no hook will be placed inside |\Declare|\-|Caption|\-|Sub|\-|Type|.
+% \begin{macrocode}
+\newcommand*\ForEachCaptionSubType{%
+ \@ifstar
+ {\caption@foreach@subtype\@gobble}%
+ {\caption@foreach@subtype\@iden}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\caption@foreach@subtype[2]{%
+ \caption@for@list\caption@subtypelist{#2}%
+ #1{\caption@addto@subtype@hook{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand\caption@addto@subtype@hook[1]{%
+ \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
+ \@tempa}
+% \end{macrocode}
+% \begin{macrocode}
+\providecommand*\caption@subtype@hook[1]{}
% \end{macrocode}
% \end{macro}
%
% Unfortunately the \class{memoir} document class resets the
% \texttt{subfigure} resp.~\texttt{subtable} counter at the begin
% of floating environments, i.e.~at |\@float|.
-% As a side-effect |\Continued|\-|Float| does not work correctly.
+% As a side-effect |\continued|\-|float| does not work correctly.
% For that reason we need to introduce macros to save and restore
% all sub-caption counters here.
%
-% \begin{macro}{\caption@restorecounters}
-% \changes{v1.5}{2013/05/01}{This macro added}
-% |\caption@restore|\-|counters| restores all counters saved with
-% |\caption@save|\-|counter|.
-% \begin{macrocode}
-\newcommand*\caption@restorecounters{%
- \caption@restore@counters
- \global\let\caption@restore@counters\@empty}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@restore@counters{}
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\caption@savesubcounters}
% \changes{v1.5}{2013/05/01}{This macro added}
-% |\caption@save|\-|sub|\-|counters| saves all sub-caption counters,
-% so they can be restored with |\caption@restore|\-|counters| later on.
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption@for@list} now for iterating the list}
+% |\caption@save|\-|sub|\-|counters|\\
+% saves all sub-caption counters,
+% so they can be restored with |\caption@restore|\-|counters| later on.
% \begin{macrocode}
\newcommand*\caption@savesubcounters{%
- \def\@elt##1{\caption@savecounter{sub##1}}%
- \caption@subtypelist
- \let\@elt\relax}%
+ \caption@for@list\caption@subtypelist{\caption@savecounter{##1}}}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@savecounter}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@save|\-|counter|\marg{counter}\\
+% saves the given counter, so it can be restored with
+% |\caption@restore|\-|counters| later on.
% \begin{macrocode}
\newcommand*\caption@savecounter[1]{%
\edef\caption@tempa{%
@@ -4132,26 +4517,42 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption@For}
-% \changes{v1.1a}{2007/09/07}{This macro added}
-% \changes{v1.2}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption@For}}
-% |\caption@For|\marg{elt-list}\marg{code with \#1}\\
-% |\caption@For*|\marg{elt-list}\marg{code with \#1}
+% \begin{macro}{\caption@restorecounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+% |\caption@restore|\-|counters|
+% restores all counters saved with |\caption@save|\-|counter|.
% \begin{macrocode}
-\newcommand*\caption@For{%
- \caption@withoptargs\caption@@For}
-%\@onlypreamble\caption@For
+\newcommand*\caption@restorecounters{%
+ \caption@restore@counters
+ \global\let\caption@restore@counters\@empty}
% \end{macrocode}
% \begin{macrocode}
-\newcommand\caption@@For[3]{%
- \caption@AtBeginDocument#1{%
- \def\@elt##1{#3}%
- \@nameuse{caption@#2}%
- \let\@elt\relax}}%
-%\@onlypreamble\caption@@For
+\newcommand*\caption@restore@counters{}
% \end{macrocode}
% \end{macro}
%
+% \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
+% \end{macrocode}
+%
+% \begin{macrocode}
+\captionsetup{style=default,position=default,listformat=default}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+%
% \iffalse
%</package>
% \fi
diff --git a/Master/texmf-dist/source/latex/caption/ltcaption.dtx b/Master/texmf-dist/source/latex/caption/ltcaption.dtx
index 314528d58b3..a4f75ae72a2 100644
--- a/Master/texmf-dist/source/latex/caption/ltcaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/ltcaption.dtx
@@ -19,11 +19,15 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
@@ -33,9 +37,7 @@
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{ltcaption.drv}%
- [2013/06/01 v1.4 This package fixes caption problems with
- other-than-centered aligned longtables]
+\ProvidesFile{ltcaption.drv}[2013/06/01 v1.4 This package fixes caption problems with other-than-centered aligned longtables]
\hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up.
%
\documentclass{ltxdoc}
diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx
index a3b8bdb2ee8..90586d10d99 100644
--- a/Master/texmf-dist/source/latex/caption/subcaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx
@@ -19,21 +19,25 @@
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files
-% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
-% caption.sty, caption2.sty, caption3.sty,
-% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
% and the user manuals
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{232}
+% \CheckSum{228}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{subcaption.drv}[2019/09/10 v1.3 Adds a sub-caption feature to the caption package]
+\ProvidesFile{subcaption.drv}[2020/08/24 v1.3 Adds a sub-caption feature to the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -176,7 +180,7 @@
%
% The default settings for |sub|captions are:
% \begin{quote}
-% |margin=0pt,size=smaller,labelformat=parens,labelsep=space,|\\
+% |margin=0pt,font+=smaller,labelformat=parens,labelsep=space,|\\
% |skip=6pt,list=false,hypcap=false|~\footnote{%^^A
% This means that sub-captions are not listed in the List of Figures
% or Tables by default, but you can enable that by
@@ -197,7 +201,7 @@
% \item Local settings
% {\small(|\captionsetup{|\ldots|}| inside |figure| or |table| environment)}
% \item Default `sub' settings
-% {\small(|margin=0pt,size=smaller,|\ldots, see above)}
+% {\small(|margin=0pt,font+=smaller,|\ldots, see above)}
% \item Custom `sub' settings
% {\small(|\usepackage[|\ldots|]{subcaption}| and |\captionsetup[sub]{|\ldots|}|)}
% \item Environmental `sub' settings
@@ -349,7 +353,16 @@
% \begin{background}
% The |\sub|\-|caption|\-|box| is a |\par|\-|box| with
% |\set|\-|caption|\-|sub|\-|type| as first contents line.
-% \iffalse See implementation for details.\fi
+% \iffalse
+% Prepared with |\Declare|\-|Caption|\-|Sub|\-|Type| (offered by the
+% \package{caption} package), the caption package command |\set|\-|caption|\-|sub|\-|type|
+% becames available.
+% Analogous to the |\set|\-|caption|\-|type| command of the \package{caption} package,
+% the |\set|\-|caption|\-|sub|\-|type| command sets the sub-type of the box or environment
+% (so |\caption| will typeset a sub-caption instead of an ordinary one),
+% places a proper hyperlink anchor (non-starred variant only),
+% executes options associated with the sub-type etc.
+% \fi
% \end{background}
%
% \PageBreak
@@ -416,7 +429,7 @@
% The |subfigure| \& |subtable| environments are just simple |minipage|
% environments with |\set|\-|caption|\-|sub|\-|type| as first contents line.
% These environments are defined with the help of
-% |\caption@For{subtypelist}|, which executes code for every sub-type
+% |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|, which executes code for every sub-type
% declared with |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \end{background}
%
@@ -466,14 +479,6 @@
% \bigskip
%
% \begin{background}
-% Prepared with |\Declare|\-|Caption|\-|Sub|\-|Type| (offered by the
-% \package{caption} package), the caption package command |\set|\-|caption|\-|sub|\-|type|
-% becames available.
-% Analogous to the |\set|\-|caption|\-|type| command of the \package{caption} package,
-% the |\set|\-|caption|\-|sub|\-|type| command sets the sub-type of the box or environment
-% (so |\caption| will typeset a sub-caption instead of an ordinary one),
-% places a proper hyperlink anchor (non-starred variant only),
-% executes options associated with the sub-type etc.\par
% The |\subcaption| command is just a simple combination of
% |\set|\-|caption|\-|sub|\-|type*| and |\caption|.
% \end{background}
@@ -484,9 +489,6 @@
% \DescribeMacro\DeclareCaptionSubType
% For using the sub-caption feature of the \package{caption} package some
% commands and counters must be prepared. This is done with
-% \iffalse\footnote{%^^A
-% \cs{newsubfloat} offered by the \package{subfig} package\cite{subfig}
-% could be used for this purpose as well.}\fi
% \begin{quote}
% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}
@@ -536,8 +538,8 @@
% \end{minipage}
%
% \begin{background}
-% |\Declare|\-|Caption|\-|Sub|\-|Type| is an integral part of the \package{caption}
-% package kernel.
+% |\Declare|\-|Caption|\-|Sub|\-|Type| and |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
+% are integral parts of the \package{caption} package kernel.
% \end{background}
%
% \PageBreak
@@ -797,12 +799,16 @@
%
% \pagebreak[3]
% \section{Beyond this package}
-% \label{floatrow}
+% \label{keyfloat}\label{floatrow}
%
% For a more advanced usage of the sub-caption feature of the
-% \package{caption} package, please take a look at the \package{floatrow}
-% package\cite{floatrow} which provides the powerful \texttt{subfloatrow}
-% environment for typesetting sub-figures.
+% \package{caption} package, please take a look at the excellent
+% \package{keyfloat} package\cite{keyfloat} which provides the environments
+% |key|\-|sub|\-|figs|, |key|\-|sub|\-|tabs|, and |key|\-|sub|\-|floats| for
+% typesetting sub-figures and sub-tables.
+%
+% Furthermore the \package{floatrow} package\cite{floatrow} provides the
+% |sub|\-|float|\-|row| environment for typesetting sub-figures.
%
% \iffalse
% --------------------------------------------------------------------------- %
@@ -840,6 +846,11 @@
% \href{http://www.ctan.org/pkg/hypcap}%
% {\emph{The hypcap package -- Adjusting anchors of captions}},
% 2007/04/09
+% \bibitem{keyfloat}
+% Brian Duun:\\
+% \href{http://www.ctan.org/pkg/keyfloat}%
+% {\emph{The \LaTeX\ keyfloat Package}},
+% 2019/09/23
% \iffalse
% \bibitem{subfig}
% Steven D. Cochran:\\
@@ -924,37 +935,39 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{subcaption}[2020/01/22 v1.3d Sub-captions (AR)]
+\ProvidesPackage{subcaption}[2020/08/23 v1.3g Sub-captions (AR)]
% \end{macrocode}
%
% \subsection{Initial code}
%
% Since we base on the \package{caption} package we load it here.
% \begin{macrocode}
-\RequirePackage{caption}[2020/01/03] % needs v3.4h or newer
+\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
% \end{macrocode}
%
% \begin{macro}{\subcaption@CheckCompatibility}
% \changes{v1.1}{2011/09/01}{Compatibility error added}
% \changes{v1.1}{2016/05/22}{The presence of \package{subfigure} or \package{subfig} will be checked \cs{AtBeginDocument}, too}
+% \changes{v1.3g}{2020/08/01}{Error text adapted to \package{caption} package~\version{4.0}}
% Since we are incompatible to them an error message will be issued when
% the \package{subfigure} or \package{subfig} package is loaded.
% \begin{macrocode}
-\newcommand\subcaption@CheckCompatibility{%
+\newcommand*\subcaption@CheckCompatibility{%
% \end{macrocode}
% \begin{macrocode}
- \@ifundefined{caption@ifcompatibility}{}{%
- \caption@ifcompatibility{%
- \caption@Error{%
- The `subcaption' package does not work correctly\MessageBreak
- in compatibility mode}}{}}%
+ \caption@ifcompatibility{%
+ \PackageError{subcaption}%
+ {This package does not work with\MessageBreak
+ caption option `compatibility=v1'}%
+ {\subcaption@eh}%
+ \endinput}{}%
% \end{macrocode}
% \begin{macrocode}
\@ifpackageloaded{subfigure}{%
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfigure package}%
- {\subcaption@EH}%
+ {\subcaption@eh}%
\endinput}{}%
% \end{macrocode}
% \begin{macrocode}
@@ -962,27 +975,23 @@
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfig package}%
- {\subcaption@EH}%
+ {\subcaption@eh}%
\endinput}{}%
% \end{macrocode}
% \begin{macrocode}
}
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\subcaption@EH{%
+\newcommand*\subcaption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `subcaption' package, especially the\MessageBreak
section about errors.\MessageBreak\@ehc}
% \end{macrocode}
% \begin{macrocode}
\subcaption@CheckCompatibility
-% \end{macrocode}
-% \begin{macrocode}
\caption@AtBeginDocument{%
\subcaption@CheckCompatibility
- \let\subcaption@CheckCompatibility\@undefined
- \let\subcaption@EH\@undefined
-}
+ \let\subcaption@CheckCompatibility\@undefined}
% \end{macrocode}
% \end{macro}
%
@@ -990,9 +999,9 @@
%
% \changes{v1.1}{2011/10/30}{Adapted to the newfloat package}
% We call |\Declare|\-|Caption|\-|Sub|\-|Type| for |figure|, |table|,
-% and each caption type declared with |\Declare|\-|Floating|\-|Environment| here.
+% and each floating environment declared with |\Declare|\-|Floating|\-|Environment| here.
% \begin{macrocode}
-\caption@ForEachType{\DeclareCaptionSubType{#1}}
+\ForEachCaptionType{\DeclareCaptionSubType{#1}}
% \end{macrocode}
%
% \begin{macro}{\newsubfloat}
@@ -1055,20 +1064,21 @@
% \begin{macro}{subtable}
% \changes{v1.2}{2016/02/21}{Optional argument values `B' and `T' added}
% \changes{v1.3d}{2020/01/22}{Definition and usage of \cs{@subfloatboxreset} added}
+% \changes{v1.3e}{2020/07/29}{Uses \cs{ForEachCaptionSubType} (instead of \cs{caption@For}) to define the environments now}
% This is just an ordinary \env{minipage} environment with
% |\setcaptionsubtype| as first contents line.
-% It will be defined using the helper macro |\caption@For{sub|\-|type|\-|list}|
-% offered by the \package{caption} kernel, so for every caption type
-% declared with |\Declare|\-|Floating|\-|Environment| a corresponding
+% It will be defined using the helper macro |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
+% offered by the \package{caption} kernel, so for every caption sub-type
+% declared with |\Declare|\-|Caption|\-|Sub|\-|Type| a corresponding
% `sub' environment will be defined automatically.
% \begin{macrocode}
-\caption@For{subtypelist}{%
- \newenvironment{sub#1}%
+\ForEachCaptionSubType{%
+ \newenvironment{#1}%
{\@ifnextchar[%]
\subcaption@iminipage
{\subcaption@iminipage[c]}}%
{\subcaption@endminipage
- \endminipage}}%
+ \endminipage}}
% \end{macrocode}
% We pass all other optional arguments using the generic helper macro
% |\caption@with|\-|opt|\-|args| offered by the \package{caption} kernel).
@@ -1183,13 +1193,14 @@
% \end{macrocode}
%
% \begin{macro}{\subcaption@setrefformat}
+% \changes{v1.3g}{2020/07/27}{Adapted to \package{caption3} v2.0}
% |\subcaption@setrefformat|\marg{name}\par
% Selecting a subref format simply means saving the code (in |\subcaption@reffmt|).
% \begin{macrocode}
\newcommand*\subcaption@setrefformat[1]{%
- \@ifundefined{caption@lfmt@#1}%
+ \@ifundefined{caption@labelformat@#1}%
{\caption@Error{Undefined label format `#1'}}%
- {\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}
+ {\expandafter\let\expandafter\subcaption@reffmt\csname caption@labelformat@#1\endcsname}}
% \end{macrocode}
% \begin{macrocode}
\subcaption@setrefformat{simple}
@@ -1200,11 +1211,12 @@
%
% We use |\caption@ExecuteOptions| and |\caption@ProcessOptions| here to add
% the options to the `|sub|' option list instead of executing them immediately.
-% \changes{v1.1}{2018/05/01}{Bugfix: Option \texttt{font+=small} changed to \texttt{size=smaller}}
+% \changes{v1.1}{2018/05/01}{Option \texttt{font+=smaller} changed to \texttt{size=smaller}}
+% \changes{v1.3e}{2020/07/27}{Option \texttt{size=smaller} changed back to \texttt{font+=smaller}}
% \begin{macrocode}
\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
\caption@ExecuteOptions{subcaption}{%
- size=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
+ font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
\caption@ProcessOptions*{subcaption}
% \end{macrocode}
%
@@ -1218,6 +1230,7 @@
% \changes{v1.3}{2019/08/31}{This macro re-added and revised}
% \changes{v1.3a}{2019/09/01}{\cs{ignorespaces} copied from \cs{sf@@@subfloat}}
% \changes{v1.3b}{2020/01/03}{Previous definition of \cs{subfloat} will be overwritten}
+% \changes{v1.3f}{2020/07/29}{Bugfix: Usage of \cs{caption@hj@default} replaced by \cs{captionbox@innerpos@default}}
% |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}\par
% If \meta{sub-caption} is given, we map this to |\sub|\-|caption|\-|box|
% but transfer the |\label| from \meta{body} to \meta{sub-caption}.
@@ -1237,7 +1250,7 @@
% \end{macrocode}
% \begin{macrocode}
\long\def\@@@subfloat#1#2#3{%
- \caption@getlabel#3\label{}\@nil
+ \caption@getlabel{#3}%
#1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
\global\let\caption@thelabel\relax
\ignorespaces}
@@ -1250,7 +1263,7 @@
{\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
{}% no optional arguments for \caption
{}% no sub-caption
- [\wd\@tempboxa][\caption@hj@default]%
+ [\wd\@tempboxa][\captionbox@innerpos@default]%
{\unhbox\@tempboxa}%
\ignorespaces}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/caption/totalcount.dtx b/Master/texmf-dist/source/latex/caption/totalcount.dtx
deleted file mode 100644
index a2e0d934a39..00000000000
--- a/Master/texmf-dist/source/latex/caption/totalcount.dtx
+++ /dev/null
@@ -1,384 +0,0 @@
-% \iffalse meta-comment
-%
-% This is file `totalcount.dtx'.
-%
-% Copyright (C) 2010-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
-%
-% --------------------------------------------------------------------------
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
-% This work has the LPPL maintenance status "maintained".
-%
-% This Current Maintainer of this work is Axel Sommerfeldt.
-%
-% This work consists of the file totalcount.dtx,
-% and the derived file totalcount.sty.
-%
-% \fi
-% \CheckSum{126}
-%
-% \iffalse
-%<*driver>
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{totalcount.drv}[2013/05/12 v1.0 Total values of counters]
-\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
-%\errorcontextlines=3
-%
-\documentclass{ltxdoc}
-\setlength\parindent{0pt}
-\setlength\parskip{\smallskipamount}
-%
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx,courier}
- \usepackage[scaled=0.90]{helvet}
-% \addtolength\marginparwidth{15pt}
-\fi
-%
-\usepackage[bottom]{footmisc}
-\usepackage{hypdoc}
-\ifpdf\usepackage{hypdestopt}\fi
-\hypersetup{pdfkeywords={LaTeX, package, totalcount},pdfstartpage={},pdfstartview={}}
-%
-\usepackage{totalcount}[2008/02/16]
-%
-\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
-\let\package\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$}
-%
-\usepackage{marvosym}
-\makeatletter
-\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
-\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
-\makeatother
-%
-\begin{document}
- \DocInput{totalcount.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-% \def\thispackage{the \package{totalcount} package}
-% \def\Thispackage{The \package{totalcount} package}
-%
-% \GetFileInfo{totalcount.drv}
-% \let\docdate\filedate
-% \let\docversion\fileversion
-% \GetFileInfo{totalcount.sty}
-%
-% \title{\texorpdfstring{\Thispackage\thanks{%^^A
-% This package has version number \docversion.}}%^^A
-% {The totalcount package}}
-% \author{Axel Sommerfeldt\\
-% \url{https://gitlab.com/axelsommerfeldt/caption}}
-% \date{\docdate}
-% \maketitle
-%
-% \begin{abstract}
-% This package offers commands for typesetting total values of counters.
-% \end{abstract}
-%
-% \iffalse\clearpage\fi
-% \setcounter{tocdepth}{2}
-% \tableofcontents
-%
-% \iffalse\clearpage\fi
-% \pagebreak[3]
-% \section{Loading the package}
-%
-% Load this package using
-% \begin{quote}
-% |\usepackage|\oarg{options}|{totalcount}|\quad,
-% \end{quote}
-% where \meta{options} is a list of names of \LaTeX\ counters, e.g.:
-% \begin{quote}
-% |\usepackage[figure,table]{totalcount}|\quad.
-% \end{quote}
-% \pagebreak[3]
-% This way the commands |\total|\-|figures| and |\total|\-|tables| will be defined which
-% are typesetting the total number of figures resp.~tables, e.g.:
-% \begin{quote}
-% |This document contains \totalfigures\ figures.|
-% \end{quote}
-% \pagebreak[3]
-% Furthermore the commands |\if|\-|total|\-|figures| and |\if|\-|total|\-|tables| are offered
-% for typesetting text only if the document contains figures resp.~tables at all, e.g.:
-% \begin{quote}
-% |\iftotalfigures|\\
-% | \listoffigures|\\
-% |\fi|
-% \end{quote}
-% \pagebreak[3]
-% This should work with other counters as well (for example |equation|,
-% or |lst|\-|listing| offered by the \package{listings} package~\cite{listings}),
-% but please note that using the |page| counter here is not supported.
-%
-% \pagebreak[3]
-% \section{\cs{DeclareTotalCounter}}
-% \begin{quote}
-% |\DeclareTotalCounter|\marg{counter}
-% \end{quote}
-% actually defines the commands |\total|\meta{counter}|s| and |\if|\-|total|\meta{counter}|s|.
-%
-% \pagebreak[3]
-% So in fact
-% \begin{quote}
-% |\usepackage[figure,table]{totalcount}|
-% \end{quote}
-% is identical to
-% \begin{quote}
-% |\usepackage{totalcount}|\\
-% |\DeclareTotalCounter{figure}|\\
-% |\DeclareTotalCounter{table}|
-% \end{quote}
-%
-% \pagebreak[3]
-% \section{Spacing}
-% The space after all \LaTeX\ commands without (optional or mandatory) arguments
-% like |\total|\-|figures| will not be typeset,
-% so these commands needs to be finished with an additional backslash or an empty
-% pair of curly braces right before the space character,
-% or to be finished with a tilde (swung dash),
-% so \TeX\ will be prevented from omitting the following space character.
-%
-% \pagebreak[3]
-% This could be avoided by defining new commands with the help of
-% the \package{xspace} package~\cite{xspace}.
-% When using \thispackage\ with the package option |xspace| this will be actually done,
-% so after
-% \begin{quote}
-% |\usepackage[figure,table,xspace]{totalcount}|
-% \end{quote}
-% code like
-% \begin{quote}
-% |This document contains \totalfigures figures.|
-% \end{quote}
-% will give correct results without a missing space between the total number of figures
-% and the word ``figures''.
-%
-% \pagebreak[3]
-% \section{Thanks}
-% I would like to thank Herbert Vo\ss\ since the implementation of this package is
-% based on an idea from him which could be found at
-% \url{http://texnik.dante.de/cgi-bin/mainFAQ.cgi?file=counter/counter#number}.
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \StopEventually{%^^A
-% \begin{thebibliography}{9}
-% \bibitem{listings}
-% Carsten Heinz \& Brooks Moses:\\
-% \href{http://www.ctan.org/pkg/listings}%
-% {\emph{The Listings Package}},\\
-% 2007/02/22
-% \bibitem{xspace}
-% David Carlisle and Morten H\o gholm:\\
-% \href{http://www.ctan.org/pkg/xspace}%
-% {\emph{The xspace package}},
-% 2009/10/20
-% \end{thebibliography}
-% }
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \DoNotIndex{\\,\_,\ ,\@@par}
-% \DoNotIndex{\@bsphack}
-% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
-% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
-% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
-% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
-% \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
-% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
-% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
-% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
-% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
-% \DoNotIndex{\@testopt}
-% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
-% \DoNotIndex{\p@,\z@}
-% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
-% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
-% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
-% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
-% \DoNotIndex{\fi,\footnotesize,\global}
-% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
-% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
-% \DoNotIndex{\ifx,\ignorespaces,\itshape}
-% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
-% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
-% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
-% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
-% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
-% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
-% \DoNotIndex{\providecommand,\quad}
-% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\rightskip,\rmfamily}
-% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
-% \DoNotIndex{\small,\string,\space,\strut}
-% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
-% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
-% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
-% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
-% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
-% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
-% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
-% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \setlength{\parskip}{0pt plus 1pt}
-% \changes{v1.0}{2008/02/16}{First version}
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \clearpage
-% \section{The implementation}
-% \iffalse
-%<*package>
-% \fi
-%
-% \subsection{Identification}
-%
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{totalcount}[2018/01/21 v1.0a Total values of counters (AR)]
-% \end{macrocode}
-%
-% \subsection{Initial code}
-%
-% \begin{macro}{\DeclareTotalCounter}
-% \changes{v1.0}{2013/05/12}{Usage of \cs{totalcount@counters} delayed}
-% |\DeclareTotalCounter|\marg{counter name}
-% \begin{macrocode}
-\newcommand*\DeclareTotalCounter[1]{%
- \newcounter{totalcount@#1}%
- \@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}%
- \@namedef{total#1es}{\@nameuse{total#1s}}%
- \expandafter\newif\csname iftotal#1s\endcsname
- \@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}%
-% \@nameuse{totalcount@set@#1}%
- \AtBeginDocument{\@ifundefined{c@#1}%
- {\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
- {\@cons\totalcount@counters{{#1}}}}}
-\@onlypreamble\DeclareTotalCounter
-% \end{macrocode}
-% \begin{macrocode}
-\let\totalcount@counters\@empty
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Declaration of options}
-%
-% \begin{macrocode}
-\newcommand*\totalcount@xspace{}
-\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}}
-% \end{macrocode}
-% \begin{macrocode}
-\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
-% \end{macrocode}
-%
-% \subsection{Execution of options}
-%
-% \begin{macrocode}
-\ProcessOptions\relax
-\ifx\totalcount@xspace\@empty\else
- \RequirePackage{xspace}
-\fi
-% \end{macrocode}
-%
-% \subsection{Main code}
-%
-% \begin{macro}{\totalcount@addtocounter}
-% |\totalcount@addtocounter|\marg{counter name}
-% \begin{macrocode}
-\newcommand*\totalcount@addtocounter[1]{%
- \@ifundefined{c@totalcount@#1}{}{%
- \addtocounter{totalcount@#1}{\value{#1}}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@stpelt}
-% |\@stpelt|\marg{counter name}
-% \begin{macrocode}
-\let\totalcount@stpelt@ORI\@stpelt
-\renewcommand*\@stpelt[1]{%
- \totalcount@addtocounter{#1}%
- \totalcount@stpelt@ORI{#1}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\totalcount@set}
-% \changes{v1.0a}{2018/01/21}{A negative counter value will be handled correctly now}
-% |\totalcount@set|\marg{counter name}\marg{value}
-% \begin{macrocode}
-\newcommand*\totalcount@set[2]{%
- \@ifundefined{c@totalcount@#1}%
-% {\global\@namedef{totalcount@set@#1}{\totalcount@set{#1}{#2}}}%
- {}%
- {\global\@namedef{total#1s}{#2\totalcount@xspace}%
- \ifnum#2<1\relax \else
- \global\@nameuse{total#1strue}%
- \fi}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-\AtBeginDocument{\AtEndDocument{%
- \begingroup
- \@tempswafalse
- \if@filesw
- \immediate\write\@mainaux{%
- \string\providecommand\string\totalcount@set[2]{}}%
- \fi
- \def\@elt#1{%
- \totalcount@addtocounter{#1}%
- \edef\totalcount@tempa{\the\value{totalcount@#1}}%
- \expandafter\let\expandafter\totalcount@tempb\csname total#1s\endcsname
- \@expandtwoargs\totalcount@set{#1}{\totalcount@tempa}%
- \expandafter\ifx\csname total#1s\endcsname\totalcount@tempb \else
- \@tempswatrue
- \fi
- \if@filesw
- \immediate\write\@mainaux{%
- \string\totalcount@set{#1}{\totalcount@tempa}}%
- \fi}%
- \totalcount@counters
- \if@tempswa
- \PackageWarningNoLine{totalcount}{%
- Total counter(s) have changed.\MessageBreak
- Rerun to get them right}%
- \fi
- \endgroup}}%
-% \end{macrocode}
-%
-% \iffalse
-%</package>
-% \fi
-%
-% \iffalse
-% --------------------------------------------------------------------------- %
-% \fi
-%
-% \Finale
-%
-\endinput
diff --git a/Master/texmf-dist/tex/latex/caption/bicaption.sty b/Master/texmf-dist/tex/latex/caption/bicaption.sty
index 046bede13e7..4c2b2b3bab7 100644
--- a/Master/texmf-dist/tex/latex/caption/bicaption.sty
+++ b/Master/texmf-dist/tex/latex/caption/bicaption.sty
@@ -25,21 +25,21 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{bicaption}[2016/03/27 v1.2 Bilingual Captions (AR)]
-\RequirePackage{caption}[2018/05/11] % needs v3.4 or newer
-\caption@AtBeginDocument{\caption@ifcompatibility{%
- \caption@Error{%
- The `bicaption' package does not work correctly\MessageBreak
- in compatibility mode}}{}}
+\ProvidesPackage{bicaption}[2020/08/23 v1.2a Bilingual Captions (AR)]
+\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
\newcommand*\bicaption@Info[1]{%
\PackageInfo{bicaption}{#1}}
\newcommand*\bicaption@InfoNoLine[1]{%
@@ -55,6 +55,16 @@
\newcommand*\bicaption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `bicaption' package.\MessageBreak\@ehc}
+\newcommand*\bicaption@CheckCompatibility{%
+ \caption@ifcompatibility{%
+ \bicaption@Error
+ {This package does not work with\MessageBreak
+ caption option `compatibility=v1'}%
+ \endinput}{}}
+\bicaption@CheckCompatibility
+\caption@AtBeginDocument{%
+ \bicaption@CheckCompatibility
+ \let\bicaption@CheckCompatibility\@undefined}
\newcount\bicaption@lang
\DeclareCaptionOption{bi-lang}{%
\caption@ifinlist{#1}{0,all,both}{%
@@ -212,7 +222,7 @@
\long\def\@@@bicaption[#1]#2{%
\caption@dblarg{\@@@@bicaption{#1}{#2}}}
\long\def\@@@@bicaption#1#2[#3]#4{%
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\bicaption@ifswap
{\bicaption@setup{#1}{#2}%
\bicaption@cmd[{#3}]{#4}}%
@@ -232,7 +242,7 @@
\caption@dblarg{\LT@@@@bicaption{#1}{#2}}}
\long\def\LT@@@@bicaption#1#2[#3]#4{%
\gdef\bicaption@LTsetup{%
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\bicaption@LT@setup}%
\gdef\bicaption@LT@setup{%
\bicaption@ifswap
diff --git a/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto b/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto
new file mode 100644
index 00000000000..1c999f0862c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto
@@ -0,0 +1,54 @@
+%%
+%% This is file `caption-ams-smf.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-ams-smf.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ams-smf.sto}[2020/08/22 v2.0 Adaption of the caption package to the AMS and SMF document classes (AR)]
+\SetCaptionDefault*{margin}{\the\captionindent}
+\DeclareCaptionLabelSeparator{default}{.\enspace}
+\DeclareCaptionFont{ams@font}{\@captionfont}
+\DeclareCaptionFont{ams@labelfont}{\@captionheadfont}
+\DeclareCaptionFont{ams@textfont}{\@captionfont\upshape}
+\SetCaptionDefault{font}{ams@font}
+\SetCaptionDefault{labelfont}{ams@labelfont}
+\SetCaptionDefault{textfont}{ams@textfont}
+\AtCaptionPackage{\setlength\belowcaptionskip{0pt}}
+\captionsetup{position=t,figureposition=b}
+\endinput
+%%
+%% End of file `caption-ams-smf.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-beamer.sto b/Master/texmf-dist/tex/latex/caption/caption-beamer.sto
new file mode 100644
index 00000000000..3adb4194fa8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-beamer.sto
@@ -0,0 +1,107 @@
+%%
+%% This is file `caption-beamer.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-beamer.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-beamer.sto}[2020/08/22 v2.0 Adaption of the caption package to the beamer document classes (AR)]
+\newcommand*\caption@ifbeamertemplate[1]{%
+ \begingroup
+ \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \@nameuse{beamer@@tmpop@caption@#1}%
+ \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi}
+\DeclareCaptionSinglelinecheck{default}{%
+ \caption@ifbeamertemplate{caption name own line}%
+ \@secondoftwo % \@secondoftwo -> singlelinecheck=off
+ \@firstoftwo} % \@firstoftwo -> singlelinecheck=on
+\g@addto@macro\caption@prepareslc{%
+ \def\footnote{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \renewcommand<>\beamer@framefootnotetext[1]{%
+ \endgroup}%
+ \let\@footnotetext\beamer@framefootnotetext
+ \caption@footnote@ORI}}
+\DeclareCaptionLabelFormat{default}{%
+ \caption@ifbeamertemplate{numbered}%
+ \caption@labelformat@simple
+ \caption@labelformat@unnumbered
+ {#1}{#2}}
+\DeclareCaptionLabelFormat{simpleMagyar}{%
+ \caption@ifbeamertemplate{numbered}%
+ {#2.\bothIfSecond{\nobreakspace}{#1}}%
+ {\caption@labelformat@unnumbered{#1}{#2}}}
+\let\@@magyar@captionfix\relax
+\AtBeginDocument{\let\@@magyar@captionfix\relax}
+\DeclareCaptionLabelSeparator**{default}%
+ {\caption@ifbeamertemplate{caption name own line}}%
+ {\caption@ifbeamertemplate{caption name own line}%
+ {\\}%
+ {\usebeamertemplate{caption label separator}}}
+\DeclareCaptionFont{beamer@font}{%
+ \usebeamerfont*{caption}%
+ \usebeamercolor[fg]{caption}}
+\SetCaptionDefault{font}{beamer@font}
+\DeclareCaptionFont{beamer@labelfont}{%
+ \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
+ \usebeamercolor[fg]{caption name}%
+ \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
+ \usebeamerfont{caption name}}
+\SetCaptionDefault{labelfont}{beamer@labelfont}
+\DeclareCaptionFont{beamer@textfont}{}
+\SetCaptionDefault{textfont}{beamer@textfont}
+\SetCaptionDefault{justification}{raggedright}
+\captionsetup{list=off}
+\AtCaptionPackage{%
+ \expandafter\let\expandafter\caption@beamer@figure
+ \csname\string\figure\endcsname
+ \@namedef{\string\figure}[#1]{%
+ \caption@beamer@figure[#1]% use original beamer code first
+ \caption@settype{figure}} % set "type=figure" afterwards
+ \expandafter\let\expandafter\caption@beamer@table
+ \csname\string\table\endcsname
+ \@namedef{\string\table}[#1]{%
+ \caption@beamer@table[#1]% use original beamer code first
+ \caption@settype{table}} % set "type=table" afterwards
+}
+\endinput
+%%
+%% End of file `caption-beamer.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto b/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto
new file mode 100644
index 00000000000..8274efbd6d2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto
@@ -0,0 +1,45 @@
+%%
+%% This is file `caption-elsarticle.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-elsarticle.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-elsarticle.sto}[2020/08/22 v2.0 Adaption of the caption package to the elsarticle document class (AR)]
+\SetCaptionDefault{font}{footnotesize}
+\endinput
+%%
+%% End of file `caption-elsarticle.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-koma.sto b/Master/texmf-dist/tex/latex/caption/caption-koma.sto
new file mode 100644
index 00000000000..81fa13cf223
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-koma.sto
@@ -0,0 +1,183 @@
+%%
+%% This is file `caption-koma.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-koma.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-koma.sto}[2020/08/22 v2.0 Adaption of the caption package to the KOMA-Script document classes (AR)]
+\expandafter\let\expandafter\caption@koma@setcapwidth
+ \csname\string\setcapwidth\endcsname
+\@namedef{\string\setcapwidth}[#1]#2{%
+ \caption@koma@setcapwidth[{#1}]{#2}%
+ \caption@setcapwidth@opt{#1}%
+ \caption@setcapwidth}
+\newcommand*\caption@setcapwidth@opt[1]{}
+\AtCaptionPackage{\renewcommand*\caption@setcapwidth@opt[1]{%
+ \ifx\\#1\\\else
+ \caption@ifdefined\cap@margin{%
+ \def\@tempa{captionbeside}%
+ \ifx\@tempa\@currenvir\else\caption@Warning{%
+ Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+ \fi}{}%
+ \fi}}
+\newcommand*\caption@setcapwidth{%
+ \captionsetup{width=\cap@width}}
+\def\caption@tempa{\hsize}%
+\ifx\caption@tempa\cap@width \else
+ \caption@setcapwidth
+\fi
+\expandafter\let\expandafter\caption@koma@setcapmargin
+ \csname\string\@setcapmargin\endcsname
+\@namedef{\string\@setcapmargin}[#1]#2{%
+ \caption@koma@setcapmargin[{#1}]{#2}%
+ \caption@setcapmargin}
+\expandafter\let\expandafter\caption@koma@@setcapmargin
+ \csname\string\@@setcapmargin\endcsname
+\@namedef{\string\@@setcapmargin}[#1]#2{%
+ \caption@koma@@setcapmargin[{#1}]{#2}%
+ \caption@setcapmargin}
+\newcommand*\caption@setcapmargin{%
+ \begingroup
+ \let\onelinecaptionsfalse\relax
+ \def\@twoside{0}%
+ \def\if@twoside{\def\@twoside{1}\iffalse}%
+ \cap@margin
+ \def\@tempa{\endgroup}%
+ \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
+ \def\hspace##1##{\@firstofone}%
+ \edef\@tempa{\endgroup
+ \noexpand\captionsetup{%
+ twoside=\@twoside,slc=0,%
+ margin={\cap@left,\cap@right}}}%
+ \fi\fi
+ \@tempa}
+\ifx\cap@margin\relax \else
+ \caption@setcapmargin
+\fi
+\let\caption@koma@setcapindent\@setcapindent
+\renewcommand*\@setcapindent[1]{%
+ \caption@koma@setcapindent{#1}%
+ \caption@setcapindent}
+\let\caption@koma@@setcapindent\@@setcapindent
+\renewcommand*\@@setcapindent[1]{%
+ \caption@koma@@setcapindent{#1}%
+ \caption@setcapindent}
+\newcommand*\caption@setcapindent{%
+ \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
+\caption@ifdefined\cap@indent{\caption@setcapindent}{}
+\let\caption@koma@parindent\KV@caption@parindent
+\DeclareCaptionOption{parindent}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parindent' ignored}%
+ \else
+ \caption@koma@parindent{#1}%
+ \fi}%
+\let\caption@koma@parskip\KV@caption@parskip
+\DeclareCaptionOption{parskip}[]{%
+ \ifx,#1,%
+ \caption@Debug{Option `parskip' ignored}%
+ \else
+ \caption@koma@parskip{#1}%
+ \fi}%
+\g@addto@macro\onelinecaptionstrue{\caption@setsinglelinecheck{true}}%
+\g@addto@macro\onelinecaptionsfalse{\caption@setsinglelinecheck{false}}%
+\ifonelinecaptions
+ \onelinecaptionstrue
+\else
+ \onelinecaptionsfalse
+\fi
+\DeclareCaptionFormat{default}[#1#2#3\par]{%
+ \ifdofullc@p
+ \caption@useformat{hang}{#1}{#2}{#3}%
+ \else
+ #1#2%
+ \ifdim\cap@indent<\z@
+ \par
+ \noindent\hspace*{-\cap@indent}%
+ \else\if@capbreak
+ \par
+ \fi\fi
+ #3\par
+ \fi}
+\SetCaptionDefault{labelformat}{autodot}
+\DeclareCaptionLabelSeparator{default}{\captionformat}
+\DeclareCaptionFont{scr@font}{\scr@fnt@caption}
+\DeclareCaptionFont{scr@labelfont}{\scr@fnt@captionlabel}
+\SetCaptionDefault{font}{scr@font}
+\SetCaptionDefault{labelfont}{scr@labelfont}
+\g@addto@macro\@captionabovetrue{\caption@setposition{t}}%
+\g@addto@macro\@captionabovefalse{\caption@setposition{b}}%
+\if@captionabove
+ \@captionabovetrue
+\else
+ \@captionabovefalse
+\fi
+\AtBeginCaption{\caption@AtBeginLongtable{%
+ \def\@captionabovetrue{\LT@captionsetup{position=t}}%
+ \def\@captionabovefalse{\LT@captionsetup{position=b}}}}
+\g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}%
+\g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}%
+\if@tablecaptionabove
+ \@tablecaptionabovetrue
+\else
+ \@tablecaptionabovefalse
+\fi
+\caption@ifdefined\@figurecaptionabovetrue{%
+ \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}%
+ \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}%
+ \if@figurecaptionabove
+ \@figurecaptionabovetrue
+ \else
+ \@figurecaptionabovefalse
+ \fi}{}
+\AtCaptionPackage{%
+ \let\caption@koma@figureposition\KV@caption@figureposition
+ \DeclareCaptionOption{figureposition}{%
+ \caption@WarningNoLine{%
+ Option `figureposition=#1' has no effect\MessageBreak
+ when used with a KOMA-Script document class}%
+ \caption@koma@figureposition{#1}}
+ \let\caption@koma@tableposition\KV@caption@tableposition
+ \DeclareCaptionOption{tableposition}{%
+ \caption@WarningNoLine{%
+ Option `tableposition=#1' has no effect\MessageBreak
+ when used with a KOMA-Script document class}%
+ \caption@koma@tableposition{#1}}}
+\AtBeginDocument{\let\scr@caption\caption}
+\endinput
+%%
+%% End of file `caption-koma.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-light.sty b/Master/texmf-dist/tex/latex/caption/caption-light.sty
new file mode 100644
index 00000000000..bf5300291a9
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-light.sty
@@ -0,0 +1,89 @@
+%%
+%% This is file `caption-light.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-light.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{caption-light}[2020/08/24 v1.0 Customizing captions (AR)]
+\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
+\caption@ifbool{documentclass}{}{%
+ \caption@WarningNoLine{%
+ Unknown document class (or package),\MessageBreak
+ standard defaults will be used}}
+\@ifpackageloaded{caption2}{%
+ \caption@Error{%
+ You can't use both, the (obsolete) caption2 *and*\MessageBreak
+ the caption-light package}%
+ \endinput
+}{}
+\caption@SetupOptions{caption-light}{\caption@setkeys{caption}{#2}}
+\caption@ProcessOptions*{caption-light}
+\caption@ifdefined\caption@makecaption
+ {\caption@Info{\noexpand\caption@makecaption is already defined}%
+ \endinput}{}
+\long\def\caption@makecaption#1#2{%
+ \caption@iftop\caption@belowskip\caption@aboveskip
+ \caption@labelseparator % defines \caption@iflabelfont and \caption@labelsep
+ \caption@singlelinecheck
+ {\sbox\@tempboxa{\caption@@makecaption{#1}{#2}}%
+ \ifdim \wd\@tempboxa >\hsize}%
+ {\iftrue}%
+ \caption@@makecaption{#1}{#2}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \caption@iftop\caption@aboveskip\caption@belowskip}
+\newcommand\caption@@makecaption[2]{%
+ \caption@applyfont
+ {\captionlabelfont #1}%
+ {\caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep}%
+ {\captiontextfont #2}}
+\let\@makecaption\caption@makecaption
+\caption@AtBeginDocument{%
+ \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+ \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+}
+\newcommand*\setcaptiontype{%
+ \caption@teststar{\def\@captype}{}{}}
+\caption@AtBeginDocument{%
+ \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
+\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+\endinput
+%%
+%% End of file `caption-light.sty'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-memoir.sto b/Master/texmf-dist/tex/latex/caption/caption-memoir.sto
new file mode 100644
index 00000000000..3d0d9184a2f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-memoir.sto
@@ -0,0 +1,46 @@
+%%
+%% This is file `caption-memoir.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-memoir.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-memoir.sto}[2020/07/31 v2.0 Adaption of the caption package to the memoir document class (AR)]
+\g@addto@macro\caption@prepareslc{%
+ \let\pagenote\caption@gobble}
+\endinput
+%%
+%% End of file `caption-memoir.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-ntg.sto b/Master/texmf-dist/tex/latex/caption/caption-ntg.sto
new file mode 100644
index 00000000000..3ddfedc954f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-ntg.sto
@@ -0,0 +1,48 @@
+%%
+%% This is file `caption-ntg.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-ntg.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-ntg.sto}[2020/08/22 v2.0 Adaption of the caption package to the NTG document classes (AR)]
+\DeclareCaptionFont{ntg@labelfont}{\CaptionLabelFont}
+\DeclareCaptionFont{ntg@textfont}{\CaptionTextFont}
+\SetCaptionDefault{labelfont}{ntg@labelfont}
+\SetCaptionDefault{textfont}{ntg@textfont}
+\endinput
+%%
+%% End of file `caption-ntg.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption-thesis.sto b/Master/texmf-dist/tex/latex/caption/caption-thesis.sto
new file mode 100644
index 00000000000..fb367ab2172
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/caption/caption-thesis.sto
@@ -0,0 +1,49 @@
+%%
+%% This is file `caption-thesis.sto',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% caption-thesis.dtx (with options: `package')
+%%
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+%%
+%% https://gitlab.com/axelsommerfeldt/caption
+%%
+%% --------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Axel Sommerfeldt.
+%%
+%% This work consists of the files
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
+%% the derived files
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
+%% and the user manuals
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{caption-thesis.sto}[2020/08/22 v2.0 Adaption of the caption package to the thesis document class (AR)]
+\SetCaptionDefault{format}{hang}
+\DeclareCaptionFont{cph@font}{\cph@font}
+\DeclareCaptionFont{cpb@font}{\cpb@font}
+\SetCaptionDefault{labelfont}{cph@font}
+\SetCaptionDefault{textfont}{cpb@font}
+\endinput
+%%
+%% End of file `caption-thesis.sto'.
diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty
index 001e324884f..68fa82690cb 100644
--- a/Master/texmf-dist/tex/latex/caption/caption.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption.sty
@@ -25,17 +25,21 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/05/30 v3.4k Customizing captions (AR)]
-\RequirePackage{caption3}[2020/05/10] % needs v1.10 or newer
+\ProvidesPackage{caption}[2020/08/30 v3.5 Customizing captions (AR)]
+\RequirePackage{caption3}[2020/08/23] % needs v2.0 or newer
\caption@ifbool{documentclass}{}{%
\caption@WarningNoLine{%
Unknown document class (or package),\MessageBreak
@@ -170,98 +174,9 @@
\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
-\caption@ifclassloaded{ams}{%
- \caption@InfoNoLine{AMS or SMF document class}%
- \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
-}{}
-\caption@ifclassloaded{koma}{%
- \caption@InfoNoLine{KOMA-Script document class}%
- \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
- \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
- \if@tablecaptionabove
- \@tablecaptionabovetrue
- \else
- \@tablecaptionabovefalse
- \fi
- \caption@ifdefined\@figurecaptionabovetrue{%
- \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
- \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
- \if@figurecaptionabove
- \@figurecaptionabovetrue
- \else
- \@figurecaptionabovefalse
- \fi
- }{}%
- \g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
- \g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
- \ifonelinecaptions
- \onelinecaptionstrue
- \else
- \onelinecaptionsfalse
- \fi
- \g@addto@macro\@captionabovetrue{\let\caption@position\@firstoftwo}
- \g@addto@macro\@captionabovefalse{\let\caption@position\@secondoftwo}
- \DeclareCaptionOption{figureposition}{%
- \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
- when used with a KOMA script document class}%
- \captionsetup*[figure]{position=#1}}
- \DeclareCaptionOption{tableposition}{%
- \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
- when used with a KOMA script document class}%
- \captionsetup*[table]{position=#1}}
- \let\caption@KOMA@setcapindent\@setcapindent
- \renewcommand*\@setcapindent[1]{%
- \caption@KOMA@setcapindent{#1}\caption@setcapindent}
- \let\caption@KOMA@@setcapindent\@@setcapindent
- \renewcommand*\@@setcapindent[1]{%
- \caption@KOMA@@setcapindent{#1}\caption@setcapindent}
- \newcommand*\caption@setcapindent{%
- \captionsetup{indent=\ifdim\cap@indent<\z@\z@\else\cap@indent\fi}}
- \caption@ifdefined\cap@indent{\caption@setcapindent}{}
- \expandafter\let\expandafter\caption@KOMA@setcapwidth
- \csname\string\setcapwidth\endcsname
- \@namedef{\string\setcapwidth}[#1]#2{%
- \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
- \newcommand*\caption@setcapwidth[1]{%
- \ifx\\#1\\\else
- \caption@ifdefined\cap@margin{%
- \def\@tempa{captionbeside}%
- \ifx\@tempa\@currenvir\else\caption@Warning{%
- Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
- \fi}{}%
- \fi
- \captionsetup{width=\cap@width}}
- \def\caption@tempa{\hsize}%
- \ifx\caption@tempa\cap@width \else
- \caption@setcapwidth{?}
- \fi
- \expandafter\let\expandafter\caption@KOMA@setcapmargin
- \csname\string\@setcapmargin\endcsname
- \@namedef{\string\@setcapmargin}[#1]#2{%
- \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
- \expandafter\let\expandafter\caption@KOMA@@setcapmargin
- \csname\string\@@setcapmargin\endcsname
- \@namedef{\string\@@setcapmargin}[#1]#2{%
- \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
- \newcommand*\caption@setcapmargin{%
- \begingroup
- \let\onelinecaptionsfalse\relax
- \def\@twoside{0}%
- \def\if@twoside{\def\@twoside{1}\iffalse}%
- \cap@margin
- \def\@tempa{\endgroup}%
- \ifx\cap@left\hfill\else\ifx\cap@right\hfill\else
- \def\hspace##1##{\@firstofone}%
- \edef\@tempa{\endgroup
- \noexpand\captionsetup{%
- twoside=\@twoside,slc=0,%
- margin={\cap@left,\cap@right}}}%
- \fi\fi
- \@tempa}
- \ifx\cap@margin\relax \else
- \caption@setcapmargin
- \fi
-}{}
+\caption@documentclass@code
+\let\caption@documentclass@code\@undefined
+\let\AtCaptionPackage\@firstofone
\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
\caption@ProcessOptions*{caption}
\newcounter{caption@flags}
@@ -312,12 +227,12 @@
{\ignorespaces\caption@makeanchor{#3}}\par
\caption@if@minipage\@minipagetrue\@minipagefalse}%
\caption@end}
-\providecommand\M@gettitle[1]{}
\providecommand\memcaptioninfo[4]{}
\newcommand*\caption@prepareanchor[2]{%
\caption@makecurrent{#1}{#2}%
\caption@ifhypcap\caption@@start\relax
\M@gettitle{#2}}
+\providecommand\M@gettitle[1]{}
\long\def\caption@makecaption#1#2{%
\caption@make@above
\caption@@make{#1}{#2}%
@@ -330,10 +245,6 @@
\caption@iftop
{\caption@aboveskip\caption@rule}%
\caption@belowskip}
-\newcommand*\caption@aboveskip{%
- \vskip\abovecaptionskip}
-\newcommand*\caption@belowskip{%
- \vskip\belowcaptionskip}
\newcommand*\caption@redefine{}
\g@addto@macro\caption@redefine{%
\caption@ifcompatibility{%
@@ -341,7 +252,7 @@
\noexpand\caption will not be redefined since `compatibility' is set to v1}%
\renewcommand*\caption@redefine{}%
\renewcommand*\caption@continuedfloat[1]{%
- \caption@Error{Not available in compatibility mode}}%
+ \caption@Error{Not available with option `compatibility=v1'}}%
\caption@AtBeginDocument*{%
\let\caption@start\relax
\caption@ifdefined\caption@ORI@capstart{%
@@ -361,7 +272,15 @@
\let\caption@ORI@xfloat\@xfloat
\def\@xfloat#1[#2]{%
\caption@ORI@xfloat{#1}[#2]%
- \caption@settype{#1}}%
+ \caption@settype{#1}%
+ \caption@xfloat@hook}%
+ \newcommand*\caption@xfloat@hook{}%
+ \let\caption@ORI@xdblfloat\@xdblfloat
+ \def\@xdblfloat#1[#2]{%
+ \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+ \caption@setoptions{#1*}%
+ \caption@xdblfloat@hook}%
+ \newcommand*\caption@xdblfloat@hook{}%
}
\caption@AtBeginDocument{\caption@redefine}
\let\@makecaption\caption@makecaption
@@ -375,7 +294,7 @@
\DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
\DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
}
-\newcommand\setcaptiontype{%
+\def\setcaptiontype{%
\caption@boxrestore@mini
\caption@settype}
\newcommand\setcaptionsubtype{%
@@ -422,29 +341,32 @@
\caption@start}}}
\newcommand*\caption@iftype{\caption@ifdefined\@captype}
\newcommand*\caption@checktype[1]{%
- \caption@ifsubtype{#1}%
- {\caption@Error{Should not be used with subtype `#1'}%
- \@gobble}%
- \@firstofone}
+ \caption@ifsubtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
+ {\caption@Error{Should not be used with subtype `#1'}%
+ \@gobble}%
+ \@firstofone}
\newcommand*\caption@checksubtype[1]{%
\caption@ifsubtype{#1}%
- \@firstofone
- {\caption@Error{Undefined subtype `#1'}%
- \@gobble}}
-\caption@ifeTeX{%
- \newcommand*\caption@checkgrouplevel[2]{%
- \@ifundefined{#1caption@grouplevel}{%
- \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
- \ifnum\currentgrouplevel>\caption@grouplevel\relax
- \expandafter\edef\csname #1caption@grouplevel\endcsname{%
- \the\currentgrouplevel}%
- \else
- \caption@Warning{\string#2\MessageBreak outside box or environment}%
- \fi
- }{}}%
-}{%
- \let\caption@checkgrouplevel\@gobbletwo
-}
+ \@firstofone
+ {\caption@ifin@list\sf@counterlist{#1}%
+ {\caption@Warning{%
+ \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
+ This is not designed to work; you could try replacing\MessageBreak
+ the `subfig' package with `subcaption' to resolve\MessageBreak
+ this problem which occurred}%
+ \@firstofone}%
+ {\caption@Error{Undefined subtype `#1'}%
+ \@gobble}}}
+\newcommand*\caption@checkgrouplevel[2]{%
+ \@ifundefined{#1caption@grouplevel}{%
+ \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
+ \ifnum\currentgrouplevel>\caption@grouplevel\relax
+ \expandafter\edef\csname #1caption@grouplevel\endcsname{%
+ \the\currentgrouplevel}%
+ \else
+ \caption@Warning{\string#2\MessageBreak outside box or environment}%
+ \fi
+ }{}}%
\newcommand*\caption@undefinedlabel{%
\protect\caption@xref{\caption@labelname}{\on@line}}
\DeclareRobustCommand*\caption@xref[2]{%
@@ -466,7 +388,7 @@
\@esphack}
\caption@AtBeginDocument{%
\def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
-\newcommand*\caption@of[2]{\setcaptiontype*{#2}#1}
+\providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
\newcommand*\captionlistentry{%
\caption@teststar\@captionlistentry\@firstoftwo\@secondoftwo}
\newcommand*\@captionlistentry[1]{%
@@ -485,10 +407,10 @@
{\caption@iibox{#1}{#2}{#3}}%
{\caption@iibox@{#1}{#2}{#3}}}
\long\def\caption@iibox#1#2#3[#4]{%
- \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@hj@default}
+ \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
\long\def\caption@iibox@#1#2#3#4{%
\setbox\@tempboxa\hbox{#4}%
- \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@hj@default]{\unhbox\@tempboxa}}
+ \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
\long\def\caption@iiibox#1{%
\caption@iiiibox{#1}\vbox\vtop}
\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
@@ -501,24 +423,24 @@
\caption@setposition t%
#2{\caption#4{#5}}%
\captionbox@hrule
- \csname caption@hj@#7\endcsname
+ \csname caption@justification@#7\endcsname
#8}%
}{%
\endgroup
\parbox[b]{#6}{%
#1\relax
\caption@setposition b%
- \csname caption@hj@#7\endcsname
+ \csname caption@justification@#7\endcsname
#8%
\captionbox@hrule
#3{\caption#4{#5}}}%
}}
-\newcommand*\captionbox@hj@default{c}
+\newcommand*\captionbox@innerpos@default{c}
\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
-\providecommand*\caption@hj@c{\centering}
-\providecommand*\caption@hj@l{\raggedright}
-\providecommand*\caption@hj@r{\raggedleft}
-\providecommand*\caption@hj@s{}
+\providecommand*\caption@justification@c{\centering}
+\providecommand*\caption@justification@l{\raggedright}
+\providecommand*\caption@justification@r{\raggedleft}
+\providecommand*\caption@justification@s{}
\def\continuedfloat{%
\caption@iftype
{\caption@continuedfloat\@captype}%
@@ -569,7 +491,7 @@
\@ifundefined{c@#1}%
{\caption@Error{No float type '#1' defined}}%
{\caption@ref@stepcounter{#1}%
- \caption@fixposition
+ \caption@fixposition % TODO: Make this independant on the "position" setting
\caption@iftop\caption@setflag\caption@clrflag2% caption
\caption@clrflag4% subcaption
\@nameuse{donemaincaptiontrue}}}
@@ -626,9 +548,10 @@
\newcommand*\caption@end{%
\endgroup}
\newcommand*\caption@setfnum[1]{%
- \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption@lfmt\caption@lfmt@default\else}%
- \@namedef{fnum@#1}{\caption@fnum{#1}}%
- \fi}
+ \@ifundefined{caption@fnum@#1}%
+ {\expandafter\let\csname caption@fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+ \@namedef{fnum@#1}{\caption@fnum{#1}}}%
+ {}}
\newcommand*\caption@boxrestore{%
\caption@parboxrestore{\@parboxrestore}{%
\let\if@nobreak\iffalse
@@ -647,7 +570,7 @@
\parindent\z@ \parskip\z@skip
\sloppy}
\newcommand*\caption@normalsize{%
- \caption@font*{\KV@caption@fnt@normal\@unused}}
+ \caption@font@normal\@unused}
\let\caption@setfloatcapt\@firstofone
\newcommand*\caption@makecurrent[1]{\caption@gettitle}
\let\caption@makeanchor\@firstofone
@@ -659,15 +582,6 @@
\caption@ifdefined\NR@gettitle
{\NR@gettitle{#1}}%
{\def\@currentlabelname{#1}}}
-\def\caption@DeclareSubType sub#1\@nil{%
- \caption@Debug{Initializing subtype for `#1'\@gobble}%
- \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}}
-\@onlypreamble\caption@DeclareSubType
-\caption@For*{subtypelist}{\caption@DeclareSubType sub#1\@nil}
-\caption@AtBeginDocument*{%
- \caption@ifdefined\sf@counterlist{%
- \@for\sf@temp:=\sf@counterlist\do{%
- \expandafter\caption@DeclareSubType\sf@temp\@nil}}{}}
\newcommand*\caption@subtypehook{%
\ifx\caption\caption@subcaption \else
\caption@warmup
@@ -686,7 +600,7 @@
\c@continuedfloat=0\relax
\let\caption@setfloatcapt\@firstofone
\let\caption@chkfloat\@gobbletwo
- \caption@setbox{none}%
+ \caption@set{box}{none}%
\caption@clearmargin
\caption@iflist{}{\let\caption@setlist\@gobble}%
\caption@setoptions{sub}%
@@ -767,61 +681,33 @@
\caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}%
\caption@addsubcontentslines{AtEndDocument}%
}
-\caption@ifdefined\smf@makecaption{\let\smf@makecaption\@makecaption}{}
-\@ifclassloaded{beamer}{%
- \caption@InfoNoLine{beamer document class}%
- \let\caption@ORI@figure\figure
- \def\figure{\caption@settype{figure}\caption@ORI@figure}
- \let\caption@ORI@table\table
- \def\table{\caption@settype{table}\caption@ORI@table}
+\caption@IfBabelArabi{%
+ \let\@makecaption\caption@makecaption
+ \def\fnum@figure{\figurename\nobreakspace\thefigure}%
+ \def\fnum@table{\tablename\nobreakspace\thetable}%
+}{}
+\caption@IfFrenchLe{%
+ \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+ \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+ \let\@eatDP\@undefined
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \g@addto@macro\GOfrench{%
+ \let\@makecaption\caption@original@makecaption}%
+}{}
+\caption@IfBabelHungarian{%
+ \caption@AtBeginDocument{%
+ \let\caption@original@makecaption\@makecaption}%
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \let\@makecaption\caption@original@makecaption}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \let\@makecaption\caption@original@makecaption}}{}%
+}{}
+\caption@IfBabelLatvian{%
+ \let\@makecaption\caption@makecaption
}{}
-\caption@ifdefined\scr@caption{%
- \caption@AtBeginDocument{\let\scr@caption\caption}}{}
-\@nameuse{caption@frenchb}\@nameundef{caption@frenchb}
-\caption@AtBeginDocument{\caption@ifdefined\frenchTeXmods{%
- \caption@InfoNoLine{frenchle/pro package is loaded}%
- \let\captionfont@ORI\captionfont
- \let\captionlabelfont@ORI\captionlabelfont
- \let\@makecaption@ORI\@makecaption
-
- \caption@ifdefined\GOfrench
- {\def\caption@tempa{\g@addto@macro\GOfrench}}%
- {\let\caption@tempa\@firstofone}%
- \caption@tempa{%
- \let\captionfont\captionfont@ORI
- \let\captionfont@ORI\@undefined
- \let\captionlabelfont\captionlabelfont@ORI
- \let\captionlabelfont@ORI\@undefined
- \let\@makecaption\@makecaption@ORI
- \let\@makecaption@ORI\@undefined
- \let\@cnORI\caption
- \let\caption@tcORI\@tablescaption
- \def\@tablescaption{\caption@star\relax\caption@tcORI}%
- \let\@eatDP\@undefined
- \let\caption@tempa\@empty
- \ifx\f@ffrench\fnum@figure
- \l@addto@macro\caption@tempa{\let\fnum@figure\f@ffrench}%
- \fi
- \ifx\f@tfrench\fnum@table
- \l@addto@macro\caption@tempa{\let\fnum@table\f@tfrench}%
- \fi
- \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
- \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
- \caption@tempa
- }%
-}{}}
-\def\caption@tempa#1{%
- \@ifpackagewith{babel}{#1}{%
- \caption@InfoNoLine{#1 babel option is loaded}%
- \expandafter\addto\csname extras#1\endcsname{%
- % reverse changes made by magyar.ldf
- \let\@makecaption\caption@makecaption
- \babel@save\@makecaption
- \caption@redefine
- \babel@save\@caption}%
- }{}}
-\caption@tempa{hungarian}%
-\caption@tempa{magyar}%
\newcommand\caption@IfPackageLoaded[1]{%
\@testopt{\caption@@IfPackageLoaded{#1}}{}}
\@onlypreamble\caption@IfPackageLoaded
@@ -930,7 +816,7 @@
\hsize=\linewidth
\fi
\fi}%
-\AtBeginCaption{\caption@test@adjustwidth}
+ \AtBeginCaption{\caption@test@adjustwidth}%
}{}%
\caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
\caption@ifdefined\chkfloat@addcontentsline{%
@@ -970,8 +856,7 @@
}}%
\newcommand*\caption@float@setname[1]{%
\expandafter\ifx\csname #1name\endcsname\relax
- \expandafter\let\csname #1name\expandafter\endcsname
- \csname fname@#1\endcsname
+ \expandafter\let\csname #1name\expandafter\endcsname\csname fname@#1\endcsname
\fi}%
\g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
\g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
@@ -1176,21 +1061,6 @@
\let\caption@ORI@lst@MakeCaption\lst@MakeCaption
\def\lst@MakeCaption#1{% #1 is `t' or `b'
\begingroup
-%% \caption@Debug{%
-%% linewidth=\lst@linewidth,
-%% xleftmargin=\lst@xleftmargin,\MessageBreak
-%% xrightmargin=\lst@xrightmargin,
-%% resetmargins=\lst@ifresetmargins true\else false\fi}%
-%% \caption@iflst@Init{}{%
-%% \linewidth\lst@linewidth\relax
-%% \lst@ifresetmargins
-%% \advance\linewidth\@totalleftmargin
-%% \advance\linewidth\rightmargin
-%% \@totalleftmargin\z@
-%% \fi
-%% \advance\linewidth-\lst@xleftmargin
-%% \advance\linewidth-\lst@xrightmargin
-%% \advance\@totalleftmargin\lst@xleftmargin\relax}%
\caption@iflst@Init{}{%
\edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
\l@addto@macro\caption@beginhook\caption@lst@leftskip}%
@@ -1211,32 +1081,36 @@
\providecommand*\ext@lstlisting{lol}%
}{}
\providecommand*\LTcaptype{table}
+\providecommand*\caption@LT@array{}
+\newcommand\caption@AtBeginLongtable{%
+ \g@addto@macro\caption@LT@array}
\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
\RequirePackage{ltcaption}[2018/08/26]%
\let\LT@@makecaption\@undefined
\caption@AtBeginDocument{%
\let\caption@ORI@LT@array\LT@array
\renewcommand*\LT@array{%
- \global\let\caption@opt@@longtable\@undefined
- \def\captionsetup{%
- \noalign\bgroup
- \@ifstar\@captionsetup\@captionsetup}% gobble *
- \def\@captionsetup##1{\LT@captionsetup{##1}\egroup}%
- \def\LT@captionsetup##1{%
- \captionsetup@startrue\caption@setup@options[@longtable]{##1}%
- \global\let\caption@opt@@longtable\caption@opt@@longtable}%
- \def\@captionabovetrue{\LT@captionsetup{position=t}}%
- \def\@captionabovefalse{\LT@captionsetup{position=b}}%
- \def\captionlistentry{%
- \noalign\bgroup
- \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
- {\egroup\LT@listentry\LTcaptype}}%
-%% \let\Hy@LT@currentHlabel\@currentHlabel
-%% \let\@currentHlabel\Hy@LT@currentHlabel
- \def\continuedfloat{\noalign{%
- \caption@Error{\noexpand\continuedfloat outside float}}}%
- \let\bicaption\LT@bicaption
+ \caption@LT@array
\caption@ORI@LT@array}}%
+ \caption@AtBeginLongtable{%
+ \global\let\caption@opt@@longtable\@undefined
+ \def\captionsetup{%
+ \noalign\bgroup
+ \@ifstar\@captionsetup\@captionsetup}% gobble *
+ \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
+ \def\LT@captionsetup#1{%
+ \captionsetup@startrue\caption@setup@options[@longtable]{#1}%
+ \global\let\caption@opt@@longtable\caption@opt@@longtable}%
+ \def\captionlistentry{%
+ \noalign\bgroup
+ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
+ {\egroup\LT@listentry\LTcaptype}}%
+%% \let\Hy@LT@currentHlabel\@currentHlabel
+%% \let\@currentHlabel\Hy@LT@currentHlabel
+ \def\continuedfloat{\noalign{%
+ \caption@Error{\noexpand\continuedfloat outside float}}}%
+ \let\bicaption\LT@bicaption
+ }%
\def\LT@capti@n{%
\@ifstar
{\egroup\LT@c@ption\@gobble[]}%
@@ -1280,7 +1154,10 @@
\fi
\caption@flrow@setlist@{#1}}%
}{}}%
-}{}
+}{%
+ \let\caption@AtBeginLongtable\@gobble
+ \let\caption@LT@array\@undefined
+}
\providecommand*\caption@LT@setup{}
\caption@IfPackageLoaded{picinpar}{%
\long\def\figwindow[#1,#2,#3,#4] {%
@@ -1385,7 +1262,7 @@
\def\caption@setSC@justify{%
\caption@clearmargin
\ifx\SC@justify\@empty \else
- \let\caption@hj\SC@justify
+ \let\caption@justification\SC@justify
\let\SC@justify\@empty
\fi}%
\let\caption\SC@orig@caption
@@ -1428,8 +1305,7 @@
\long\def\ST@caption#1[#2]#3{\par%
\caption@settype*{#1}%
\caption@setoptions{supertabular}%
- \def\caption@fixposition{%
- \caption@setposition{\if@topcaption t\else b\fi}}%
+ \caption@setposition{\if@topcaption t\else b\fi}%
\caption@beginex{#1}{#2}{#3}%
\caption@boxrestore
\caption@normalsize
@@ -1448,8 +1324,7 @@
\long\def\ST@caption#1[#2]#3{\par%
\caption@settype*{#1}%
\caption@setoptions{xtabular}%
- \def\caption@fixposition{%
- \caption@setposition{\if@topcaption t\else b\fi}}%
+ \caption@set{position}{\if@topcaption t\else b\fi}%
\@initisotab
\caption@beginex{#1}{#2}{#3}%
\caption@boxrestore
@@ -1463,14 +1338,14 @@
\let\caption@ORI@threeparttable\threeparttable
\renewcommand*\threeparttable{%
\caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
-%%% \caption@setposition a% ?
+%%% \caption@setposition{auto}% ?
\caption@clearmargin
\caption@setoptions{threeparttable}%
\caption@ORI@threeparttable}%
\let\caption@ORI@measuredfigure\measuredfigure
\renewcommand*\measuredfigure{%
\caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
-%%% \caption@setposition a% ?
+%%% \caption@setposition{auto}% ?
\caption@clearmargin
\caption@setoptions{measuredfigure}%
\caption@ORI@measuredfigure}%
diff --git a/Master/texmf-dist/tex/latex/caption/caption2.sty b/Master/texmf-dist/tex/latex/caption/caption2.sty
index 686fff86ae4..09ff40ad551 100644
--- a/Master/texmf-dist/tex/latex/caption/caption2.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption2.sty
@@ -25,11 +25,15 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty
index c8b888672e7..7cbd1abbc32 100644
--- a/Master/texmf-dist/tex/latex/caption/caption3.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption3.sty
@@ -25,44 +25,24 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/07/20 v1.12b caption3 kernel (AR)]
-\providecommand\caption@FixArabTeX{%
- \def\caption@tempa##1{}%
- \ifx\caption@tempa\@gobble
- \PackageInfo{caption3}{Fixing ArabTeX}%
- \long\def\@gobble##1{}%
- \fi}
-\caption@FixArabTeX
-\AtBeginDocument{%
- \caption@FixArabTeX
- \let\caption@FixArabTeX\@undefined}
+\ProvidesPackage{caption3}[2020/08/30 v2.0 caption3 kernel (AR)]
\providecommand*\@nameundef[1]{%
\expandafter\let\csname #1\endcsname\@undefined}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname currentgrouplevel\endcsname\relax
- \PackageInfo{caption3}{TeX engine: TeX}
- \let\caption@ifeTeX\@secondoftwo
- \providecommand\l@addto@macro[2]{%
- \begingroup
- \toks@\expandafter{#1#2}%
- \xdef\caption@addto@temp{\the\toks@}%
- \endgroup
- \let#1\caption@addto@temp}
-\else
- \PackageInfo{caption3}{TeX engine: e-TeX}
- \let\caption@ifeTeX\@firstoftwo
- \providecommand\l@addto@macro[2]{%
- \edef#1{\unexpanded\expandafter{#1#2}}}
-\fi
+\providecommand\l@addto@macro[2]{%
+ \edef#1{\unexpanded\expandafter{#1#2}}}
\def\bothIfFirst#1#2{%
\protected@edef\caption@tempa{#1}%
\ifx\caption@tempa\@empty \else
@@ -74,21 +54,25 @@
#1#2%
\fi}
\newcommand*\caption@ifundefined[1]{%
- \ifx#1\@undefined
- \expandafter\@firstoftwo
- \else\ifx#1\relax
- \expandafter\expandafter\expandafter\@firstoftwo
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
\else
- \expandafter\expandafter\expandafter\@secondoftwo
- \fi\fi}
+ \expandafter\@firstoftwo
+ \fi}
\newcommand*\caption@ifdefined[1]{%
- \ifx#1\@undefined
- \expandafter\@secondoftwo
- \else\ifx#1\relax
- \expandafter\expandafter\expandafter\@secondoftwo
+ \ifdefined#1%
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \else
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \fi
\else
- \expandafter\expandafter\expandafter\@firstoftwo
- \fi\fi}
+ \expandafter\@secondoftwo
+ \fi}
\newcommand*\caption@ifinlist{%
\@expandtwoargs\caption@@ifinlist}
\newcommand*\caption@@ifinlist[2]{%
@@ -115,10 +99,10 @@
\newcommand*\caption@l@removefrom@list[2]{%
\caption@ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
\newcommand*\caption@for@list[2]{%
- \caption@ifempty@list#1{}{%
- \def\caption@tempb##1{#2}%
- \@for\caption@tempa:=#1\do{%
- \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
+ \caption@ifempty@list#1{}%
+ {\def\caption@tempb##1{#2}%
+ \@for\caption@tempa:=#1\do{%
+ \expandafter\caption@tempb\expandafter{\caption@tempa}}}}
\newcommand*\caption@ifempty@list[1]{%
\ifx#1\@undefined
\expandafter\@firstoftwo
@@ -134,16 +118,18 @@
\newcommand*\caption@setbool[1]{%
\expandafter\caption@set@bool\csname caption@if#1\endcsname}
\newcommand*\caption@set@bool[2]{%
- \caption@ifinlist{#2}{1,true,yes,on}{%
- \let#1\@firstoftwo
- }{\caption@ifinlist{#2}{0,false,no,off}{%
- \let#1\@secondoftwo
- }{%
- \caption@Error{Undefined boolean value `#2'}%
- }}}
+ \caption@if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
+\newcommand*\caption@if@bool[1]{%
+ \caption@ifinlist{#1}{1,true,yes,on}%
+ {\@firstoftwo}%
+ {\caption@ifinlist{#1}{0,false,no,off}%
+ {}%
+ {\caption@Error{Undefined boolean value `#1'}}%
+ \@secondoftwo}}
\newcommand*\caption@ifbool[1]{\@nameuse{caption@if#1}}
\newcommand*\caption@undefbool[1]{\@nameundef{caption@if#1}}
-\newcommand*\caption@teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+\newcommand*\caption@teststar[3]{%
+ \@ifstar{#1{#2}}{#1{#3}}}
\newcommand*\caption@teststar@[3]{%
\@ifstar{#1{#2}}{\caption@ifatletter{#1{#2}}{#1{#3}}}}
\AtBeginDocument{\let\caption@teststar@\caption@teststar}
@@ -223,7 +209,7 @@
\@onlypreamble\caption@declareoption
\newcommand*\caption@declare@option{%
\define@key{caption}}
-%% no \@onlypreamble\caption@declare@option, will be used by \captionsetup
+%% no \@onlypreamble\caption@declare@option since it will be used by \captionsetup
\newcommand*\DeclareCaptionOptionNoValue{%
\caption@teststar\caption@declareoption@novalue\AtEndOfPackage\@gobble}
\@onlypreamble\DeclareCaptionOptionNoValue
@@ -330,10 +316,10 @@
\fi}
\newcommand*\caption@xsetup[1]{\expandafter\caption@setup\expandafter{#1}}
\newcommand*\caption@addtooptlist[1]{%
- \@ifundefined{caption@opt@#1@lineno}{%
- \caption@dooptlist\caption@g@addto@list{#1}%
- \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}%
- }{}}
+ \@ifundefined{caption@opt@#1@lineno}%
+ {\caption@dooptlist\caption@g@addto@list{#1}%
+ \expandafter\xdef\csname caption@opt@#1@lineno\endcsname{\the\inputlineno}}%
+ {}}
\newcommand*\caption@removefromoptlist[1]{%
\caption@dooptlist\caption@g@removefrom@list{#1}%
\global\expandafter\let\csname caption@opt@#1@lineno\endcsname\@undefined}
@@ -343,10 +329,10 @@
\expandafter#1\expandafter\caption@optlist\expandafter{\@tempa}%
\endgroup}
\AtEndDocument{%
- \caption@for@list\caption@optlist{%
- \caption@WarningNoLine{%
- Unused \string\captionsetup[#1]
- on input line \csname caption@opt@#1@lineno\endcsname}}}
+ \caption@for@list\caption@optlist
+ {\caption@WarningNoLine{%
+ Unused \string\captionsetup[#1]
+ on input line \csname caption@opt@#1@lineno\endcsname}}}
\newcommand*\caption@setkeys{\@dblarg\caption@@setkeys}
\long\def\caption@@setkeys[#1]#2#3{%
\@bsphack
@@ -361,7 +347,7 @@
\fi
\def\KV@errx{\KV@err}%
\def\XKV@err{\let\@tempa\XKV@tkey\KV@err}%
- \caption@Debug{\protect\setkeys{#2}{#3}}%
+ \caption@Debug{\noexpand\setkeys{#2}{#3}}%
\setkeys{#2}{#3}%
\edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}%
\expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname
@@ -422,9 +408,92 @@
\caption@SetupOptions@list
\@tempa}
\@onlypreamble\caption@onefilewithoptions
-\newdimen\captionmargin
-\newdimen\captionmargin@
-\newdimen\captionwidth
+\newcommand*\caption@decl[3][\def]{%
+ \global\long\expandafter#1\csname caption@#2@#3\endcsname}
+\@onlypreamble\caption@decl
+\newcommand*\caption@ifdecl[2]{%
+ \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
+\newcommand*\caption@checkdecl[2]{%
+ \caption@ifdecl{#1}{#2}%
+ \@firstofone
+ {\caption@Error{Undefined #1 `#2'}%
+ \@gobble}}
+\newcommand*\caption@set{%
+ \caption@maparg\caption@@set}%
+\newcommand*\caption@@set[3]{%
+ \caption@checkdecl{#1}{#3}{%
+ \expandafter\def\csname caption@#2\expandafter\endcsname\expandafter{\csname caption@#1@#3\endcsname}}}
+\newcommand*\SetCaptionDefault{%
+ \caption@teststar\caption@setdefault\def\edef}
+\@onlypreamble\SetCaptionDefault
+\newcommand*\caption@setdefault[2]{%
+ \@ifundefined{caption@setdefault@#2}%
+ {\caption@maparg\caption@@setdefault}%
+ {\@nameuse{caption@setdefault@#2}{#1}}%
+ {#2}}
+\newcommand*\caption@@setdefault[3]{%
+ \caption@ifdefault{#3}%
+ {\caption@Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
+ {\caption@@set{#1}{#2@default}{#3}}}
+\newcommand*\caption@ifdefault[1]{%
+ \edef\caption@tempa{#1}%
+ \def\caption@tempb{default}%
+ \ifx\caption@tempa\caption@tempb
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+\newcommand*\caption@setmapping[2]{%
+ \@namedef{caption@map@#1}{#2}}
+\@onlypreamble\caption@setmapping
+\newcommand*\caption@maparg[2]{%
+ \@ifundefined{caption@map@#2}%
+ {#1{#2}}%
+ {#1{\csname caption@map@#2\endcsname}}%
+ {#2}}
+\def\caption@switchdefault#1#2{%
+ \def\caption@tempa##1{#2}%
+ \expandafter\caption@tempa\csname caption@#1@default\endcsname
+ \caption@setdefault\def{#1}}
+\def\caption@restoredefault#1#2{%
+ \caption@checkdecl{#1}{default}{%
+ \caption@ifdefined#2{%
+ \expandafter\let\csname caption@#1@default\endcsname#2%
+ \let#2\@undefined}{}}}
+\newcommand*\caption@decl@package[2]{%
+ \@ifnextchar[%]
+ {\caption@declare@package{#1}{#2}}%
+ {\caption@declarepackage{#1}{#2}}}
+\@onlypreamble\caption@decl@package
+\def\caption@declare@package#1#2[#3]#4{%
+ \global\@namedef{caption@#1@#4@package}{#3}%
+ #2{#4}}
+\@onlypreamble\caption@declare@package
+\newcommand*\caption@declarepackage[3]{%
+ \global\@nameundef{caption@#1@#3@package}%
+ #2{#3}}
+\@onlypreamble\caption@declarepackage
+\newcommand*\caption@load@package[2]{%
+ \expandafter\let\expandafter\caption@tempa\csname caption@#1@#2@package\endcsname
+ \caption@ifdefined\caption@tempa
+ {\caption@requirepackage\caption@tempa{#1=#2}}%
+ {}}
+\newcommand*\DeclareCaptionLength[1]{%
+ \expandafter\newdimen\csname caption#1\endcsname
+ \@namedef{caption@setdefault@#1}##1{%
+ \caption@setdefault@length{##1}}%
+ \SetCaptionDefault*{#1}}
+\@onlypreamble\DeclareCaptionLength
+\newcommand*\caption@setdefault@length[3]{%
+ \expandafter#1\csname caption#2@default\endcsname{#3}}
+\newcommand*\caption@setlength[2]{%
+ \caption@ifdefault{#2}%
+ {\expandafter\let\expandafter\caption@tempa\csname caption#1@default\endcsname}%
+ {\def\caption@tempa{#2}}%
+ \expandafter\setlength\csname caption#1\endcsname\caption@tempa}
+\DeclareCaptionLength{margin}{0pt}
+\DeclareCaptionLength{margin@}{\the\captionmargin}
+\DeclareCaptionLength{width}{0pt}
\newdimen\caption@tempdima
\DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
\DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
@@ -436,6 +505,7 @@
\DeclareCaptionOption{calcwidth*}{\caption@setcalcwidth*{#1}}
\DeclareCaptionOption{twoside}[1]{\caption@set@bool\caption@iftwoside{#1}}
\DeclareCaptionOptionNoValue{oneside}{\caption@set@bool\caption@iftwoside0}
+\caption@set@bool\caption@iftwoside{\if@twoside 1\else 0\fi}
\DeclareCaptionOption{minmargin}{\caption@setoptcmd\caption@minmargin{#1}}
\DeclareCaptionOption{maxmargin}{\caption@setoptcmd\caption@maxmargin{#1}}
\newcommand*\setcaptionmargin{%
@@ -447,8 +517,8 @@
#1{\captionwidth\z@}%
\caption@@@setmargin#2,#2,\@nil}
\def\caption@@@setmargin#1,#2,#3\@nil{%
- \setlength\captionmargin@{#2}%
- \setlength\captionmargin{#1}%
+ \caption@setlength{margin}{#1}%
+ \caption@setlength{margin@}{#2}%
\addtolength\captionmargin@{-\captionmargin}}
\newcommand*\setcaptionwidth{%
\caption@resetcalcmargin
@@ -457,9 +527,7 @@
\caption@teststar\caption@@setwidth\@gobble\@firstofone}
\newcommand*\caption@@setwidth[2]{%
#1{\captionmargin\z@\captionmargin@\z@}%
- \setlength\captionwidth{#2}}%
-\newcommand*\caption@resetcalcmargin{%
- \let\caption@calcmargin@hook\@empty}
+ \caption@setlength{width}{#2}}%
\newcommand*\caption@setcalcmargin{%
\caption@teststar{\caption@@setcalcmargin\caption@setmargin}%
\@secondoftwo\@firstoftwo}
@@ -467,6 +535,8 @@
#2{\caption@resetcalcmargin
\l@addto@macro\caption@calcmargin@hook{#1{#3}}}%
{\l@addto@macro\caption@calcmargin@hook{#1*{#3}}}}
+\newcommand*\caption@resetcalcmargin{%
+ \let\caption@calcmargin@hook\@empty}
\newcommand*\caption@setcalcwidth{%
\caption@teststar{\caption@@setcalcmargin\caption@setwidth}%
\@secondoftwo\@firstoftwo}
@@ -505,83 +575,91 @@
\caption@ifoddpage}
\newcommand*\caption@setoptcmd[2]{%
\caption@ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
-\newdimen\caption@indent
-\newdimen\caption@parindent
-\newdimen\caption@hangindent
-\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
- \setlength\caption@indent{#1}}
+\DeclareCaptionLength{@indent}{0pt}
+\DeclareCaptionLength{@parindent}{0pt}
+\DeclareCaptionLength{@hangindent}{0pt}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
+ \caption@setlength{@indent}{#1}}
\DeclareCaptionOption{indention}[\leftmargini]{%
- \setlength\caption@indent{#1}}
+ \caption@setlength{@indent}{#1}}
\DeclareCaptionOption{parindent}{%
- \setlength\caption@parindent{#1}}
+ \caption@setlength{@parindent}{#1}}
\DeclareCaptionOption{hangindent}{%
- \setlength\caption@hangindent{#1}}
+ \caption@setlength{@hangindent}{#1}}
\DeclareCaptionOption{parskip}{%
- \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
+ \l@addto@macro\caption@@par{\setlength\parskip{#1}}}
\newcommand*\DeclareCaptionStyle[1]{%
\@testopt{\caption@declarestyle{#1}}{}}
\@onlypreamble\DeclareCaptionStyle
\def\caption@declarestyle#1[#2]#3{%
- \global\@namedef{caption@sls@#1}{#2}%
- \global\@namedef{caption@sty@#1}{#3}}
+ \caption@decl{style}{#1}%
+ {\def\caption@slsty{#2}%
+ \def\caption@sty{#3}}%
+ \@namedef{caption@sty@#1}{\@unused}}
\@onlypreamble\caption@declarestyle
\DeclareCaptionOption{style}{\caption@setstyle{#1}}
\DeclareCaptionOption{style*}{\caption@setstyle*{#1}}
\newcommand*\caption@setstyle{%
- \caption@teststar\caption@@setstyle\@gobble\@firstofone}
+ \caption@teststar\caption@@setstyle\caption@ifdecl\caption@checkdecl}
\newcommand*\caption@@setstyle[2]{%
- \@ifundefined{caption@sty@#2}%
- {#1{\caption@Error{Undefined style `#2'}}}%
- {\expandafter\let\expandafter\caption@sty\csname caption@sty@#2\endcsname
+ #1{style}{#2}%
+ {\caption@set{style}{#2}%
+ \caption@style % defines \caption@sty & \caption@slsty
\ifx\caption@setstyle@flag\@undefined
- \let\caption@setstyle@flag\relax
+ \let\caption@setstyle@flag\relax % prevent \caption@resetstyle if called recursively
\caption@resetstyle
\caption@xsetup\caption@sty
\let\caption@setstyle@flag\@undefined
\else
\caption@xsetup\caption@sty
- \fi
- \expandafter\let\expandafter\caption@sls\csname caption@sls@#2\endcsname
- \expandafter\caption@l@addto@list\expandafter\caption@opt@singleline
- \expandafter{\caption@sls}}}
+ \fi}%
+ {}}
\newcommand*\caption@resetstyle{%
\caption@setup{%
box=none,boxcolor=white,parbox=parbox,%
format=plain,labelformat=default,labelsep=colon,textformat=simple,%
- justification=justified,font=,size=,labelfont=,textfont=,%
+ font=,labelfont=,textfont=,size=,%
+ justification=justified,slc,rule,strut,%
margin=0pt,minmargin=0,maxmargin=0,%
- indent=0pt,parindent=0pt,hangindent=0pt,%
- slc,rule,strut}%
- \caption@clearsetup{singleline}}
+ indent=0pt,parindent=0pt,hangindent=0pt}}
\DeclareCaptionStyle{base}[indent=0pt,justification=centering]{}
\DeclareCaptionStyle{default}[indent=0pt,justification=centering]{%
- box=default,format=default,labelsep=default,textformat=default,%
- justification=default,font=default,labelfont=default,textfont=default}
-\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}}
+ box=default,%
+ format=default,labelformat=default,labelsep=default,textformat=default,%
+ font=default,labelfont=default,textfont=default,size=default,%
+ justification=default,slc=default,margin=default,%
+ indent=default,parindent=default,hangindent=default}
+\newcommand*\DeclareCaptionSinglelinecheck[2]{%
+ \caption@decl{singlelinecheck}{#1}{#2}}
+\@onlypreamble\DeclareCaptionSinglelinecheck
+\DeclareCaptionOption{singlelinecheck}[1]{\caption@setsinglelinecheck{#1}}
\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}}
+\DeclareCaptionSinglelinecheck{on}{\@firstoftwo}
+\DeclareCaptionSinglelinecheck{off}{\@secondoftwo}
+\SetCaptionDefault{singlelinecheck}{on}
+\newcommand*\caption@setsinglelinecheck[1]{%
+ \caption@ifdecl{singlelinecheck}{#1}%
+ {\caption@set{singlelinecheck}{#1}}%
+ {\caption@set@bool\caption@singlelinecheck{#1}}}
\newcommand*\DeclareCaptionBox[2]{%
- \global\long\@namedef{caption@box@#1}##1##2{#2}}
+ \caption@decl{box}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionBox
-\DeclareCaptionOption{box}{\caption@setbox{#1}}
-\DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}}
-\newcommand*\caption@setbox{%
- \caption@set@box\caption@box}
-\newcommand*\caption@set@box[2]{%
- \@ifundefined{caption@box@#2}%
- {\caption@Error{Undefined box `#2'}}%
- {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}}
+\DeclareCaptionOption{box}{\caption@set{box}{#1}}
+\DeclareCaptionOption{parbox}{\caption@set{parbox}{#1}}
+\caption@setmapping{parbox}{box}
\DeclareCaptionBox{empty}{}
\DeclareCaptionBox{none}{#2}
\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
-\DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{%
- \setlength\caption@tempdima{#1}%
- \addtolength\caption@tempdima{-2\fboxsep}%
- \linewidth\caption@tempdima
- \hsize\caption@tempdima
- #2}}
+\DeclareCaptionBox{colorbox}{%
+ \colorbox\caption@boxcolor{%
+ \setlength\caption@tempdima{#1}%
+ \addtolength\caption@tempdima{-2\fboxsep}%
+ \linewidth\caption@tempdima
+ \hsize\caption@tempdima
+ #2}}
\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}}
\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
-\def\caption@box@default{\caption@box@none}
+\SetCaptionDefault{box}{none}
\newcommand*\DeclareCaptionFormat{%
\caption@teststar\caption@declareformat\@gobble\@firstofone}
\@onlypreamble\DeclareCaptionFormat
@@ -589,100 +667,87 @@
\@dblarg{\caption@@declareformat#1{#2}}}
\@onlypreamble\caption@declareformat
\long\def\caption@@declareformat#1#2[#3]#4{%
- \global\expandafter\let\csname caption@ifh@#2\endcsname#1%
- \global\long\@namedef{caption@slfmt@#2}##1##2##3{#3}%
- \global\long\@namedef{caption@fmt@#2}##1##2##3{#4}}
+ \caption@decl[\edef]{format}{#2}{%
+ \unexpanded{\let\caption@ifhmode#1}%
+ \unexpanded{\long\def\caption@slfmt}####1####2####3\unexpanded{{#3}}%
+ \unexpanded{\long\def\caption@fmt}####1####2####3\unexpanded{{#4}}}}
\@onlypreamble\caption@@declareformat
-\DeclareCaptionOption{format}{\caption@setformat{#1}}
-\newcommand*\caption@setformat[1]{%
- \@ifundefined{caption@fmt@#1}%
- {\caption@Error{Undefined format `#1'}}%
- {\expandafter\let\expandafter\caption@ifh\csname caption@ifh@#1\endcsname
- \expandafter\let\expandafter\caption@slfmt\csname caption@slfmt@#1\endcsname
- \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
-\newcommand*\DeclareCaptionDefaultFormat[1]{%
- \expandafter\def\expandafter\caption@fmt@default\expandafter
- {\csname caption@fmt@#1\endcsname}%
- \expandafter\def\expandafter\caption@slfmt@default\expandafter
- {\csname caption@slfmt@#1\endcsname}%
- \expandafter\def\expandafter\caption@ifh@default\expandafter
- {\csname caption@ifh@#1\endcsname}}
-\@onlypreamble\DeclareCaptionDefaultFormat
+\newcommand*\caption@useformat[1]{% used by caption-koma.sto
+ \caption@checkdecl{format}{#1}{%
+ \begingroup
+ \@nameuse{caption@format@#1}\global\let\caption@tempa\caption@fmt
+ \endgroup\caption@tempa}}
+\DeclareCaptionOption{format}{\caption@set{format}{#1}}
\DeclareCaptionFormat{plain}{#1#2#3\par}
\DeclareCaptionFormat{hang}[#1#2#3\par]{%
- \caption@ifin@list\caption@lsepcrlist\caption@lsepname
+ \caption@iflabelseparatorwithnewline
{\caption@Error{%
- The option `labelsep=\caption@lsepname' does not work\MessageBreak
+ The option `labelsep=\caption@labelsep@name' does not work\MessageBreak
with `format=hang'}}%
{\@hangfrom{#1#2}%
\advance\caption@parindent\hangindent
\advance\caption@hangindent\hangindent
\caption@@par#3\par}}
-\DeclareCaptionDefaultFormat{plain}
+\SetCaptionDefault{format}{plain}
\newcommand*\DeclareCaptionLabelFormat[2]{%
- \global\@namedef{caption@lfmt@#1}##1##2{#2}}
+ \caption@decl{labelformat}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionLabelFormat
-\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
-\newcommand*\caption@setlabelformat[1]{%
- \@ifundefined{caption@lfmt@#1}%
- {\caption@Error{Undefined label format `#1'}}%
- {\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
+\DeclareCaptionOption{labelformat}{\caption@set{labelformat}{#1}}
\DeclareCaptionLabelFormat{empty}{}
\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
\DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
\DeclareCaptionLabelFormat{unnumbered}{#1}
-\def\caption@lfmt@default{\caption@lfmt@simple}
+\DeclareCaptionLabelFormat{original}{%
+ \caption@ifdefined\caption@original@fnum
+ {\caption@original@fnum}%
+ {\caption@labelformat@simple{#1}{#2}}}
+\SetCaptionDefault{labelformat}{original}
\newcommand\DeclareCaptionLabelSeparator{%
- \caption@teststar\caption@declarelabelseparator\@gobble\@firstofone}
+ \@ifstar
+ \DeclareCaptionLabelSeparator@
+ {\caption@declarelabelseparator\@firstofone}}
\@onlypreamble\DeclareCaptionLabelSeparator
+\newcommand\DeclareCaptionLabelSeparator@{%
+ \@ifstar
+ \DeclareCaptionLabelSeparator@@
+ {\caption@declarelabelseparator\@gobble}}
+\@onlypreamble\DeclareCaptionLabelSeparator@
+\newcommand*\DeclareCaptionLabelSeparator@@[2]{%
+ \caption@declarelabelseparator
+ {#2\@gobble\@firstofone}%
+ {#1}}
+\@onlypreamble\DeclareCaptionLabelSeparator@@
\newcommand\caption@declarelabelseparator[3]{%
- \global\@namedef{caption@iflf@#2}{#1}%
- \global\long\@namedef{caption@lsep@#2}{#3}%
- \caption@@declarelabelseparator{#2}#3\\\@nil}
+ \caption@decl{labelseparator}{#2}%
+ {\def\caption@iflabelfont{#1}%
+ \def\caption@labelsep@name{#2}%
+ \def\caption@labelsep{#3}}%
+ \@namedef{caption@lsep@#2}{#3}}
+\newcommand*\caption@lsep@default{\caption@labelseparator@default\caption@labelsep}%
\@onlypreamble\caption@declarelabelseparator
-\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
- \def\@tempa{#3}\ifx\@tempa\@empty \else
- \caption@g@addto@list\caption@lsepcrlist{#1}%
- \fi}
-\@onlypreamble\caption@@declarelabelseparator
-\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
-\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
-\newcommand*\caption@setlabelseparator[1]{%
- \@ifundefined{caption@lsep@#1}%
- {\caption@Error{Undefined label separator `#1'}}%
- {\edef\caption@lsepname{#1}%
- \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname
- \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
+\newcommand*\caption@LabelSeparatorWithNewline[1]{%
+ \caption@g@addto@list\caption@labelsep@crlist{#1}}
+\@onlypreamble\caption@LabelSeparatorWithNewline
+\newcommand*\caption@iflabelseparatorwithnewline{%
+ \caption@ifin@list\caption@labelsep@crlist\caption@labelsep@name}
+\DeclareCaptionOption{labelsep}{\caption@set{labelseparator}{#1}}
+\DeclareCaptionOption{labelseparator}{\caption@set{labelseparator}{#1}}
\DeclareCaptionLabelSeparator{none}{}
\DeclareCaptionLabelSeparator{colon}{: }
\DeclareCaptionLabelSeparator{period}{. }
\DeclareCaptionLabelSeparator{space}{ }
\DeclareCaptionLabelSeparator*{quad}{\quad}
\DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+\caption@LabelSeparatorWithNewline{newline} % does not work with "format=hang"
\DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
-\newcommand*\captionnewline{\\}
-\newcommand*\caption@setdefaultlabelsep[1]{%
- \ifx\caption@lsep\caption@lsep@default
- \caption@set@default@labelsep{#1}%
- \caption@setlabelseparator{default}%
- \else
- \caption@set@default@labelsep{#1}%
- \fi}
-\newcommand*\caption@set@default@labelsep[1]{%
- \def\caption@lsep@default{\@nameuse{caption@lsep@#1}}%
- \def\caption@iflf@default{\@nameuse{caption@iflf@#1}}}
-\caption@set@default@labelsep{colon}
+\newcommand*\captionnewline{\\\relax}
+\SetCaptionDefault{labelseparator}{colon}
\newcommand*\DeclareCaptionTextFormat[2]{%
- \global\long\@namedef{caption@tfmt@#1}##1{#2}}
+ \caption@decl{textformat}{#1}##1{#2}}
\@onlypreamble\DeclareCaptionTextFormat
-\DeclareCaptionOption{textformat}{\caption@settextformat{#1}}
-\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
-\newcommand*\caption@settextformat[1]{%
- \@ifundefined{caption@tfmt@#1}%
- {\caption@Error{Undefined text format `#1'}}%
- {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}}
+\DeclareCaptionOption{textformat}{\caption@set{textformat}{#1}}
\DeclareCaptionTextFormat{empty}{%
\caption@get@label#1\caption@makeanchor{}\@nil
\caption@thelabel
@@ -690,14 +755,16 @@
\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
\def\caption@tempa{#2}%
\ifx\caption@tempa\@empty
- \caption@getlabel#1\label{}\@nil
+ \caption@getlabel{#1}%
\else
- \caption@getlabel#2\label{}\@nil
+ \caption@getlabel{#2}%
\fi}
\DeclareCaptionTextFormat{simple}{#1}
\DeclareCaptionTextFormat{period}{#1.}
-\def\caption@tfmt@default{\caption@tfmt@simple}
-\long\def\caption@getlabel#1\label#2#3\@nil{%
+\SetCaptionDefault{textformat}{simple}
+\newcommand\caption@getlabel[1]{%
+ \caption@@getlabel#1\label{}\@nil}
+\long\def\caption@@getlabel#1\label#2#3\@nil{%
\def\@tempa{#2}%
\ifx\@tempa\@empty
\let\caption@thelabel\relax
@@ -705,81 +772,55 @@
\def\@tempb{*}%
\ifx\@tempa\@tempb
\def\caption@thelabel{\label*}%
- \caption@@getlabel#3\@nil
+ \caption@@@getlabel#3\@nil
\else
\def\caption@thelabel{\label}%
- \caption@@getlabel{#2}#3\@nil
+ \caption@@@getlabel{#2}#3\@nil
\fi
\fi}
-\long\def\caption@@getlabel#1#2\@nil{%
+\long\def\caption@@@getlabel#1#2\@nil{%
\def\@tempa{#1}%
\def\@tempb{[}%
\ifx\@tempa\@tempb
- \caption@@@getlabel#1#2\@nil
+ \caption@@@@getlabel#1#2\@nil
\else
\l@addto@macro\caption@thelabel{{#1}}%
\fi}
-\long\def\caption@@@getlabel[#1]#2\@nil{%
+\long\def\caption@@@@getlabel[#1]#2\@nil{%
\l@addto@macro\caption@thelabel{[{#1}]}%
- \caption@@getlabel#2\@nil}
+ \caption@@@getlabel#2\@nil}
\let\caption@thelabel\relax
+\DeclareCaptionOption{strut}[1]{\caption@set@bool\caption@ifstrut{#1}}
\newcommand*\DeclareCaptionFont{%
- \@ifnextchar[%]
- \caption@declare@font
- \caption@declarefont}
+ \caption@decl@package{font}{\caption@declarefont}}
\@onlypreamble\DeclareCaptionFont
-\def\caption@declare@font[#1]#2{%
- \global\@namedef{caption@fnt@#2@package}{#1}%
- \caption@@declarefont{#2}}
-\@onlypreamble\caption@declare@font
-\newcommand*\caption@declarefont[1]{%
- \global\@nameundef{caption@fnt@#1@package}%
- \caption@@declarefont{#1}}
-\@onlypreamble\caption@declarefont
-\newcommand*\caption@@declarefont[2]{%
- \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#1}{#2}}%
- \caption@@@declarefont{#1}{#2}}
+\newcommand*\caption@declarefont[2]{%
+ \caption@decl{font}{#1}##1{#2}%
+ \define@key{caption@font}{#1}[]{\caption@addto@font{#1}{##1}}}
\@onlypreamble\caption@@declarefont
-\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
-\@onlypreamble\caption@@@declarefont
-\newcommand*\caption@addto@fnt[2]{%
- \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
- \caption@ifdefined\caption@package
- {\caption@requirepackage\caption@package{#1}}% load package, if necessary
- {}%
- \l@addto@macro\caption@fnt{#2}}
-\newcommand*\DeclareCaptionDefaultFont[2]{%
- \global\@namedef{caption#1@default}{#2}}
-\@onlypreamble\DeclareCaptionDefaultFont
+\newcommand*\caption@addto@font[1]{%
+ \caption@load@package{font}{#1}%
+ \caption@add@to@font{font}{#1}}
+\newcommand*\caption@add@to@font[3]{%
+ \expandafter\g@addto@macro\expandafter\caption@fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
\DeclareCaptionOption{font+}{\caption@addtofont{font}{#1}}
-\DeclareCaptionDefaultFont{font}{}
\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
\DeclareCaptionOption{labelfont+}{\caption@addtofont{labelfont}{#1}}
-\DeclareCaptionDefaultFont{labelfont}{}
+\caption@setmapping{labelfont}{font}
\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
\DeclareCaptionOption{textfont+}{\caption@addtofont{textfont}{#1}}
-\DeclareCaptionDefaultFont{textfont}{}
+\caption@setmapping{textfont}{font}
\newcommand*\caption@setfont[1]{%
\expandafter\let\csname caption#1\endcsname\@empty
\caption@addtofont{#1}}
\newcommand*\caption@addtofont[2]{%
+ \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
\begingroup
- \expandafter\let\expandafter\caption@fnt\csname caption#1\endcsname
- \define@key{caption@fnt}{default}[]{%
- \l@addto@macro\caption@fnt{\csname caption#1@default\endcsname}}%
- \caption@setkeys[caption]{caption@fnt}{#2}%
- \global\let\caption@tempa\caption@fnt
+ \define@key{caption@font}{default}[]{\caption@add@to@font{#1}{default}{##1}}%
+ \caption@setkeys[caption]{caption@font}{#2}%
\endgroup
- \expandafter\let\csname caption#1\endcsname\caption@tempa}
-\newcommand*\caption@font{%
- \caption@teststar\caption@@font\@firstofone
- {\caption@setkeys[caption]{caption@fnt}}}
-\newcommand*\caption@@font[2]{%
- \begingroup
- \def\caption@fnt{\endgroup}%
- #1{#2}%
- \caption@fnt}
+ \expandafter\let\csname caption#1\endcsname\caption@fnt}
\DeclareCaptionFont{normalcolor}{\normalcolor}
\DeclareCaptionFont{color}{\color{#1}}
\DeclareCaptionFont{normalfont}{\normalfont}
@@ -802,6 +843,17 @@
\DeclareCaptionFont{LARGE}{\LARGE}
\DeclareCaptionFont{huge}{\huge}
\DeclareCaptionFont{Huge}{\Huge}
+\DeclareCaptionFont{smaller}{\caption@smaller}
+\DeclareCaptionFont{larger}{\caption@larger}
+\DeclareCaptionFont{none}{}
+\DeclareCaptionFont{normal}{%
+ \caption@font@normalcolor\@unused
+ \caption@font@normalfont\@unused
+ \caption@font@normalsize\@unused
+ \caption@font@singlespacing\@unused}
+\SetCaptionDefault{font}{none}
+\SetCaptionDefault{labelfont}{none}
+\SetCaptionDefault{textfont}{none}
\newcommand\caption@smaller{%
\ifx\@currsize\tiny
\relax
@@ -828,7 +880,6 @@
Cannot determine current font size.\MessageBreak
Try setting it with `size=' explicitly}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-\DeclareCaptionFont{smaller}{\caption@smaller}
\newcommand\caption@larger{%
\ifx\@currsize\tiny
\scriptsize
@@ -855,35 +906,28 @@
Cannot determine current font size.\MessageBreak
Try setting it with `size=' explicitly}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-\DeclareCaptionFont{larger}{\caption@larger}
-\DeclareCaptionFont{singlespacing}{}
-\DeclareCaptionFont{normal}{%
- \caption@font*{%
- \KV@caption@fnt@normalcolor\@unused
- \KV@caption@fnt@normalfont\@unused
- \KV@caption@fnt@normalsize\@unused
- \KV@caption@fnt@singlespacing\@unused}}
+\newcommand*\caption@hypersetup{\caption@ifdefined\hypersetup\hypersetup\@gobble}
+\DeclareCaptionFont{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup{font={hypersetup=...}}
+\DeclareCaptionOption{hypersetup}{\caption@hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
-\DeclareCaptionDefaultFont{size}{}
+\caption@setmapping{size}{font}
+\SetCaptionDefault{size}{none}
\newcommand*\DeclareCaptionJustification{%
- \def\caption@@@declarefont##1##2{%
- \global\@namedef{caption@hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
- \let\caption@@@declarefont\@gobbletwo}%
- \DeclareCaptionFont}
+ \caption@withoptargs\caption@declare@justification}
+\newcommand*\caption@declare@justification[3]{%
+ \caption@decl@package{justification}{\caption@decl{justification}}#1{#2}{#3}%
+ \expandafter\let\csname caption@hj@#2\expandafter\endcsname\csname caption@justification@#2\endcsname}
\@onlypreamble\DeclareCaptionJustification
-\newcommand*\DeclareCaptionDefaultJustification[1]{%
- \global\@namedef{caption@hj@default}{#1}% for compatibility to v1.0
- \DeclareCaptionDefaultFont{@hj}{#1}}
-\@onlypreamble\DeclareCaptionDefaultJustification
-\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
-\DeclareCaptionDefaultJustification{}
-\newcommand*\caption@setjustification{\caption@setfont{@hj}}
+\DeclareCaptionOption{justification}{%
+ \caption@load@package{justification}{#1}%
+ \caption@set{justification}{#1}}
\DeclareCaptionJustification{justified}{}
\DeclareCaptionJustification{centering}{\centering}
\DeclareCaptionJustification{centerfirst}{\centerfirst}
\DeclareCaptionJustification{centerlast}{\centerlast}
\DeclareCaptionJustification{raggedleft}{\raggedleft}
\DeclareCaptionJustification{raggedright}{\raggedright}
+\SetCaptionDefault{justification}{justified}
\providecommand\centerfirst{%
\let\\\@centercr
\edef\caption@normaladjust{%
@@ -910,50 +954,41 @@
\newcommand*\caption@rule{\caption@ifrule\caption@hrule\relax}
\newcommand*\caption@hrule{\hrule\@height\z@}
\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
+\newcommand*\caption@declare@position[2]{%
+ \caption@decl{position}{#1}{#2}}
+\@onlypreamble\caption@declare@position
\DeclareCaptionOption{position}{\caption@setposition{#1}}
-\DeclareCaptionOption{figureposition}{%
- \captionsetup*[figure]{position=#1}}
+\DeclareCaptionOption{figureposition}{\captionsetup*[figure]{position=#1}}
\@onlypreamble@key{caption}{figureposition}
-\DeclareCaptionOption{tableposition}{%
- \captionsetup*[table]{position=#1}}
+\DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
\@onlypreamble@key{caption}{tableposition}
-\newcommand*\caption@setposition[1]{%
- \caption@ifinlist{#1}{d,default}{%
- \let\caption@position\caption@defaultpos
- }{\caption@ifinlist{#1}{t,top,above}{%
- \let\caption@position\@firstoftwo
- }{\caption@ifinlist{#1}{b,bottom,below}{%
- \let\caption@position\@secondoftwo
- }{\caption@ifinlist{#1}{a,auto}{%
- \let\caption@position\@undefined
- }{%
- \caption@Error{Undefined position `#1'}%
- }}}}}
-\let\caption@defaultpos\@undefined
-\newcommand*\caption@iftop{%
- \ifx\caption@position\@undefined
- \let\caption@position\@secondoftwo
- \fi
- \caption@position}
+\newcommand*\caption@setposition{\caption@set{position}}
+\caption@declare@position{t}{\@firstoftwo}
+\caption@declare@position{top}{\@firstoftwo}
+\caption@declare@position{above}{\@firstoftwo}
+\caption@declare@position{b}{\@secondoftwo}
+\caption@declare@position{bottom}{\@secondoftwo}
+\caption@declare@position{below}{\@secondoftwo}
+\caption@declare@position{a}{\caption@autoposition}% needed by floatrow package, \flrow@cappos
+\caption@declare@position{auto}{\caption@autoposition}
+\SetCaptionDefault{position}{auto}
+\let\caption@autoposition\@secondoftwo
+\newcommand*\caption@iftop{\caption@position}
\newcommand*\caption@fixposition{%
- \ifx\caption@position\@undefined
- \caption@autoposition
- \fi}
-\newcommand*\caption@autoposition{%
\ifvmode
\edef\caption@tempa{\the\prevdepth}%
\caption@Debug{\protect\prevdepth=\caption@tempa}%
\ifdim\prevdepth>-\p@
- \let\caption@position\@secondoftwo
+ \let\caption@autoposition\@secondoftwo % position=below
\else
- \let\caption@position\@firstoftwo
+ \let\caption@autoposition\@firstoftwo % position=above
\fi
\else
\caption@Debug{no \protect\prevdepth}%
- \let\caption@position\@secondoftwo
+ \let\caption@autoposition\@secondoftwo % position=below
\fi}
\newcommand*\caption@setautoposition[1]{%
- \def\caption@autoposition{\caption@setposition{#1}}}
+ \def\caption@fixposition{\caption@@set{position}{autoposition}{#1}}}
\newcommand*\caption@beginhook{}
\newcommand*\caption@endhook{}
\newcommand*\AtBeginCaption{\l@addto@macro\caption@beginhook}
@@ -961,6 +996,7 @@
\DeclareCaptionOption{list}[1]{\caption@setlist{#1}}
\DeclareCaptionOption{listof}[1]{\caption@setlist{#1}}
\newcommand*\caption@setlist{\caption@set@bool\caption@iflist}
+\caption@setlist{on}
\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}}
\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}}
\newcommand*\caption@setlisttype{%
@@ -972,29 +1008,18 @@
\newcommand*\caption@setlisttype@ext{%
\caption@@setlisttype\caption@listtype@ext}
\newcommand*\DeclareCaptionListFormat[2]{%
- \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+ \caption@decl{listformat}{#1}##1##2{#2}}
\@onlypreamble\DeclareCaptionListFormat
-\DeclareCaptionOption{listformat}{\caption@setlistformat{#1}}
-\newcommand*\caption@setlistformat[1]{%
- \@ifundefined{caption@lstfmt@#1}%
- {\caption@Error{Undefined list format `#1'}}%
- {\expandafter\let\expandafter\caption@lstfmt
- \csname caption@lstfmt@#1\endcsname}}
+\DeclareCaptionOption{listformat}{\caption@set{listformat}{#1}}
\DeclareCaptionListFormat{empty}{}
\DeclareCaptionListFormat{simple}{#1#2}
-\DeclareCaptionListFormat{parens}{#1(#2)}
\DeclareCaptionListFormat{subsimple}{#2}
+\DeclareCaptionListFormat{parens}{#1(#2)}
\DeclareCaptionListFormat{subparens}{(#2)}
-\newcommand*\caption@setdefaultlistformat[1]{%
- \ifx\caption@lstfmt\caption@lstfmt@default
- \caption@set@default@listformat{#1}%
- \caption@setlistformat{default}%
- \else
- \caption@set@default@listformat{#1}%
- \fi}
-\newcommand*\caption@set@default@listformat[1]{%
- \def\caption@lstfmt@default{\@nameuse{caption@lstfmt@#1}}}
-\caption@set@default@listformat{subsimple}
+\DeclareCaptionListFormat{period}{#1#2.}
+\DeclareCaptionListFormat{subperiod}{#2.}
+\SetCaptionDefault{listformat}{subsimple}
+\newcommand*\caption@lstfmt{\caption@listformat}
\DeclareCaptionOption{debug}[1]{%
\caption@set@bool\caption@ifdebug{#1}%
\caption@ifdebug
@@ -1002,6 +1027,45 @@
{\let\caption@Debug\@gobble}}
\DeclareOption{debug}{\setkeys{caption}{debug}}
\setkeys{caption}{debug=0}
+\newcommand\@makecaption@standard[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@standard
+\newcommand\@makecaption@arabic[2]{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+ \if@rl{
+ \ifdim \wd\@Arabitempboxa >\hsize
+ \textRL{#2} : #1\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+ \fi}\else{
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}\fi
+ \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption@arabic
+\newcommand\@makecaption@latvian[2]{%
+ \vskip10\p@
+ \sbox\@tempboxa{#1\if\empty#2\else: #2\fi}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1: #2\par
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}
+\@onlypreamble\@makecaption@latvian
\caption@setbool{documentclass}{1}
\caption@ifundefined\caption@documentclass{%
\@ifclassloaded{beamer}{%
@@ -1018,7 +1082,7 @@
\def\caption@documentclass{koma}%
}{\caption@ifdefined\@captionheadfont{%
\caption@InfoNoLine{AMS or SMF document class detected}%
- \def\caption@documentclass{ams}%
+ \def\caption@documentclass{ams-smf}%
}{\caption@ifdefined\CaptionFonts{%
\caption@InfoNoLine{NTG document class detected}%
\def\caption@documentclass{ntg}%
@@ -1030,213 +1094,147 @@
\caption@InfoNoLine{thesis document class detected}%
\def\caption@documentclass{thesis}%
}{%
- % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
- \long\def\caption@tempa#1#2{%
- \vskip\abovecaptionskip
- \sbox\@tempboxa{#1: #2}%
- \ifdim \wd\@tempboxa >\hsize
- #1: #2\par
+ \ifx\@makecaption\@undefined
+ \caption@InfoNoLine{Document class w/o caption stuff detected}%
+ \else
+ \ifx\@makecaption\@makecaption@standard
+ \caption@InfoNoLine{Standard document class detected}%
\else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \ifx\@makecaption\@makecaption@arabic
+ \caption@InfoNoLine{arabic babel option detected}%
+ \else
+ \ifx\@makecaption\@makecaption@latvian
+ \caption@InfoNoLine{latvian babel option detected}%
+ \else
+ \caption@InfoNoLine{%
+ 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
+ \fi
+ \fi
\fi
- \vskip\belowcaptionskip}}
- \ifx\caption@tempa\@makecaption
- \caption@InfoNoLine{Standard document class detected}%
- \else
- \caption@InfoNoLine{%
- Unknown document class (or package),\MessageBreak
- standard defaults will be used}%
- \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
- \caption@setbool{documentclass}{0}%
\fi
- \def\caption@documentclass{base}%
- }}}}}}%
-}{}
-\newcommand*\caption@ifclassloaded[1]{%
- \edef\caption@tempa{#1}%
- \ifx\caption@tempa\caption@documentclass
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi}
-\caption@ifclassloaded{elsarticle}{%
- \DeclareCaptionDefaultFont{font}{\footnotesize}
+ \let\caption@documentclass\@empty % don't load adaption code later on
+ }}}}}}}%
}{}
-\caption@ifclassloaded{ams}{%
- \let\captionmargin\captionindent % set to 3pc by AMS class
- \begingroup\edef\@tempa{\endgroup
- \noexpand\caption@g@addto@list\noexpand\caption@sty@default
- {margin=\the\captionmargin
- \caption@ifdefined\smf@makecaption{,maxmargin=.1\linewidth}{}}}
- \@tempa
- \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
- \DeclareCaptionLabelSeparator{default}{.\enspace}
- \DeclareCaptionDefaultFont{font}{\@captionfont}
- \DeclareCaptionDefaultFont{labelfont}{\@captionheadfont}
- \DeclareCaptionDefaultFont{textfont}{\@captionfont\upshape}
- \captionsetup[figure]{position=b}
- \captionsetup[table]{position=t}
-}{}
-\caption@ifclassloaded{beamer}{%
- \newcommand*\caption@ifbeamertemplate[1]{%
- \begingroup
- \let\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
- \@nameuse{beamer@@tmpop@caption@#1}%
- \ifx\beamer@@tmpl@caption@ORI\beamer@@tmpl@caption
- \endgroup\expandafter\@firstoftwo
- \else
- \endgroup\expandafter\@secondoftwo
- \fi}
- \DeclareCaptionLabelFormat{default}{%
- \caption@ifbeamertemplate{numbered}%
- \caption@lfmt@simple
- \caption@lfmt@unnumbered
- {#1}{#2}}
- \DeclareCaptionLabelFormat{default@magyar}{%
- \caption@ifbeamertemplate{numbered}%
- \caption@lfmt@simple@magyar
- \caption@lfmt@unnumbered
- {#1}{#2}}
- \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
- \@ifundefined{@@magyar@captionfix}{}{%
- \g@addto@macro\@@magyar@captionfix{%
- \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
- \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}}
- \caption@declarelabelseparator
- {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone}
- {default}
- {\caption@ifbeamertemplate{caption name own line}{\\}%
- {\usebeamertemplate{caption label separator}}}
- \DeclareCaptionDefaultFont{font}{%
- \usebeamerfont*{caption}%
- \usebeamercolor[fg]{caption}}
- \DeclareCaptionDefaultFont{labelfont}{%
- \setbeamercolor*{caption}{}% avoid setting "caption" color additionally
- \usebeamercolor[fg]{caption name}%
- \setbeamerfont*{caption}{}% avoid setting "caption" font additionally
- \usebeamerfont{caption name}}
- \DeclareCaptionDefaultJustification{\raggedright}
- \DeclareOption{beamerclass}{%
- \renewcommand\caption@ifslc{%
- \caption@ifbeamertemplate{caption name own line}\@secondoftwo\@firstoftwo}
- % Since the beamer class do not offer a `list of figures' we switch this support off.
- \captionsetup{list=0}}
- \PassOptionsToPackage{beamerclass}{caption3}
- \defbeamertemplate{caption}{caption3}{%
- \caption@make\insertcaptionname\insertcaptionnumber\insertcaption}
- \DeclareOption{beamer}{%
- % \usebeamertemplate**{caption} will set font
- \DeclareCaptionDefaultFont{font}{}%
- \setbeamertemplate{caption}[caption3]}
-}{}
-\caption@ifclassloaded{koma}{%
- \DeclareCaptionFormat{default}[#1#2#3\par]{%
- \ifdofullc@p
- \caption@ifin@list\caption@lsepcrlist\caption@lsepname
- {\caption@Error{%
- The option `labelsep=\caption@lsepname' does not work\MessageBreak
- with \noexpand\setcaphanging (which is set by default)}}%
- {\caption@fmt@hang{#1}{#2}{#3}}%
- \else
- #1#2%
- \ifdim\cap@indent<\z@
- \par
- \noindent\hspace*{-\cap@indent}%
- \else\if@capbreak
- \par
- \fi\fi
- #3\par
- \fi}
- \DeclareCaptionLabelSeparator{default}{\captionformat}
- \DeclareCaptionDefaultFont{font}{\scr@fnt@caption}
- \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel}
- \let\caption@KV@parindent\KV@caption@parindent
- \DeclareCaptionOption{parindent}[]{%
- \ifx,#1,%
- \caption@Debug{Option `parindent' ignored}%
- \else
- \caption@KV@parindent{#1}%
- \fi}%
- \let\caption@KV@parskip\KV@caption@parskip
- \DeclareCaptionOption{parskip}[]{%
- \ifx,#1,%
- \caption@Debug{Option `parskip' ignored}%
- \else
- \caption@KV@parskip{#1}%
- \fi}%
-}{}
-\caption@ifclassloaded{ntg}{%
- \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
- \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
-}{}
-\caption@ifclassloaded{thesis}{%
- \DeclareCaptionDefaultFormat{hang}
- \DeclareCaptionDefaultFont{labelfont}{\cph@font}
- \DeclareCaptionDefaultFont{textfont}{\cpb@font}
-}{}
-\caption@ifdefined\ArabiCoreLoaded{%
- \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}
- \def\fnum@figure{\figurename\nobreakspace\thefigure}%
- \def\fnum@table{\tablename\nobreakspace\thetable}%
- \DeclareCaptionLabelSeparator{arabi}{ : }
- \DeclareCaptionLabelSeparator{default}{%
- \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi}
+\newcommand*\AtCaptionPackage{%
+ \g@addto@macro\caption@documentclass@code}
+\@onlypreamble\AtCaptionPackage
+\providecommand*\caption@documentclass@code{}
+\@onlypreamble\caption@documentclass@code
+\newcommand*\caption@IfBabelPackageLoaded[4]{%
+ \caption@ifdefined#2\@firstofone\caption@AtBeginDocument{%
+ \caption@if@bool{\@nameuse{caption@ifbabel@#1}}%
+ {\def\caption@tempa{\caption@ifdefined#2}}%
+ {\let\caption@tempa\@secondoftwo}%
+ \caption@tempa
+ {\caption@InfoNoLine{#1 babel package is loaded}#3}%
+ {#4}}}
+\@onlypreamble\caption@IfBabelPackageLoaded
+\DeclareCaptionLabelSeparator{arabi}{\if@rl\space\fi: }
+\newcommand*\caption@IfBabelArabi{%
+ \caption@IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
+\@onlypreamble\caption@IfBabelArabi
+\providecommand*\caption@ifbabel@arabi{true}
+\caption@IfBabelArabi{%
+ \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi}%
+ \caption@ifdefined\extrasarabic{%
+ \addto\extrasarabic{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
+ \caption@ifdefined\extrasfarsi{%
+ \addto\extrasfarsi{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{arabi}}}{}%
}{%
\let\caption@rl\@firstofone
}
-\caption@ifdefined\FB@makecaption{%
- \ifx\@makecaption\STD@makecaption
- \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
- \def\caption@frenchb{% supress frenchb warning
- \let\STD@makecaption\@makecaption
- \let\FB@makecaption\@makecaption}
- \else
- \ifx\@makecaption\@undefined\else
- \caption@InfoNoLine{%
- The definition of \protect\@makecaption\space
- has been changed,\MessageBreak
- frenchb will NOT customize it}%
- \fi
+\caption@ifdecl{labelseparator}{french}
+ {\let\caption@french@labelseparator\@undefined}%
+ {\caption@@set{labelseparator}{labelseparator@french}{default}%
+ \let\caption@french@labelseparator\caption@labelseparator@french}
+\newcommand*\caption@IfBabelFrench{%
+ \caption@IfBabelPackageLoaded{french}{\FB@makecaption}}
+\@onlypreamble\caption@IfBabelFrench
+\providecommand*\caption@ifbabel@french{true}
+\caption@IfBabelFrench{%
+ \ifx\caption@french@labelseparator\caption@labelseparator@french % still set to dummy label separator?
+ \DeclareCaptionLabelSeparator{french}{%
+ \ifFBCustomiseFigTabCaptions
+ \CaptionSeparator
+ \else
+ \space : %
+ \fi}%
\fi
+ \caption@ifdefined\extrasfrench{%
+ \addto\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{french}}}{}%
+ \caption@AtBeginDocument{\@nameuse{@FBwarning@capsepfalse}}%
}{}
-\caption@ifdefined\frenchTeXmods{%
- \DeclareCaptionDefaultFont{textfont}{\itshape}%
- \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+\newcommand*\caption@IfFrenchLe{%
+ \caption@IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
+\@onlypreamble\caption@IfBabelFrenchLe
+\providecommand*\caption@ifbabel@frenchle{true}
+\caption@IfFrenchLe{%
+ \ifx\caption@french@labelseparator\caption@labelseparator@french % still set to dummy label separator?
+ \DeclareCaptionLabelSeparator{french}{\captionseparator\space}%
+ \fi
+ \g@addto@macro\extrasfrench{%
+ \caption@switchdefault{labelseparator}{\let\caption@original@labelseparator#1}{french}%
+ \caption@switchdefault{font}{\let\caption@original@font#1}{it}%
+ \caption@switchdefault{labelfont}{\let\caption@original@labelfont#1}{up}}%
+ \g@addto@macro\extrasenglish{%
+ \caption@restoredefault{labelseparator}{\caption@original@labelseparator}%
+ \caption@restoredefault{font}{\caption@original@font}%
+ \caption@restoredefault{labelfont}{\caption@original@labelfont}}%
+ \caption@AtBeginDocument{%
+ \let\captionfont@original\captionfont
+ \let\captionlabelfont@original\captionlabelfont}%
+ \g@addto@macro\GOfrench{%
+ \let\captionfont\captionfont@original
+ \let\captionlabelfont\captionlabelfont@original}%
}{}
-\DeclareCaptionListFormat{subperiod}{#2.}
-\def\caption@tempa#1{%
- \@ifpackagewith{babel}{#1}{%
- \caption@InfoNoLine{#1 babel option is loaded}%
- \expandafter\addto\csname extras#1\endcsname{%
- % change default labelsep and listformat
- \caption@setdefaultlabelsep{period}%
- \caption@setdefaultlistformat{subperiod}}%
- \expandafter\addto\csname noextras#1\endcsname{%
- % change default labelsep and listformat
- \caption@setdefaultlabelsep{colon}%
- \caption@setdefaultlistformat{subsimple}}%
- }{}}
-\caption@tempa{hungarian}
-\caption@tempa{magyar}
-\newcommand*\caption@xpackage[2]{%
- \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
- \expandafter\@firstofone
+\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
+\newcommand*\caption@IfBabelHungarian{%
+ \caption@IfBabelPackageLoaded{hungarian}{\magyar@opt@defaults}}
+\@onlypreamble\caption@IfBabelHungarian
+\providecommand*\caption@ifbabel@hungarian{true}
+\caption@IfBabelHungarian{%
+ \caption@ifdefined\extrashungarian{%
+ \addto\extrashungarian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
+ \caption@ifdefined\extrasmagyar{%
+ \addto\extrasmagyar{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{magyar}%
+ \caption@switchdefault{labelseparator}{\babel@save #1}{period}%
+ \caption@switchdefault{listformat}{\babel@save #1}{subperiod}}}{}%
+}{}
+\DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
+\newcommand*\caption@IfBabelLatvian{%
+ \caption@IfBabelPackageLoaded{latvian}{\bbl@latvianindent}}
+\@onlypreamble\caption@IfBabelLatvian
+\providecommand*\caption@ifbabel@latvian{true}
+\caption@IfBabelLatvian{%
+ \caption@ifdefined\extraslatvian{%
+ \addto\extraslatvian{%
+ \caption@switchdefault{labelformat}{\babel@save #1}{latvian}}}{}%
+}{}
+\newcommand*\caption@ifpackageloaded[1]{%
+ \expandafter\ifx\csname ver@#1.\caption@pkgextension\endcsname\relax
+ \expandafter\@secondoftwo
\else
- \expandafter\@gobbletwo
- \fi
- {#1{#2}}}
+ \expandafter\@firstoftwo
+ \fi}
\let\caption@pkgextension\@pkgextension
-\newcommand*\caption@loadpackage{%
- \caption@xpackage\caption@@loadpackage}
-\newcommand*\caption@@loadpackage[2]{%
- \caption@Info{Option `#2' requires the `#1' package}%
- \RequirePackage{#1}\relax}
-\newcommand*\caption@requirepackage{%
- \caption@xpackage\caption@@requirepackage}
-\newcommand*\caption@@requirepackage[2]{%
- \@cons\caption@packagelist{{#1}{#2}}}% load package later on
\newcommand*\caption@pkg@list{}
+\newcommand*\caption@requirepackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
+\newcommand*\caption@@requirepackage[2]{%
+ \@cons\caption@packagelist{{#1}{#2}}} % load package later on
+\caption@AtBeginDocument{%
+ \renewcommand*\caption@@requirepackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}}
\newcommand*\caption@packagelist{}
\@onlypreamble\caption@packagelist
\caption@AtBeginDocument{%
@@ -1246,21 +1244,35 @@
\g@addto@macro\caption@tempa{%
\caption@loadpackage{#1}{#2}}}%
\caption@packagelist
- \caption@tempa
- \renewcommand*\caption@@loadpackage[2]{%
- \caption@Error{Option `#2' requires the `#1' package}}%
- \let\caption@@requirepackage\caption@@loadpackage
- }
-\newcommand*\caption@usepackage[3]{%
+ \caption@tempa}
+\newcommand*\caption@loadpackage[2]{%
+ \caption@ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
+\caption@AtBeginDocument{%
+ \let\caption@@loadpackage\caption@@requirepackage}
+\caption@AtBeginDocument{%
+ \def\@tempa{2008/08/02 v0.3b floatrow: float package extension}%
+ \expandafter\ifx\csname ver@floatrow.sty\endcsname\@tempa
+ \caption@InfoNoLine{floatrow package v0.3b is loaded}%
+ \renewcommand\captionlabel[1]{{% l.559
+ \def\FR@tmp{\@captype}%
+ \ifnum\floatbox@depth>\@ne
+ \def\FR@tmp{sub\@captype}\caption@setsubtype*{\FR@tmp}\stepcounter{\FR@tmp}%
+ \fi
+ \caption@format % <= This line added
+ \caption@@@make{\caption@fnum\FR@tmp}{#1}}}
+ \fi}
+\newcommand*\caption@newfloat[2]{%
\IfCaptionOptionCheck
- {\caption@requirepackage{#1}{#2}}%
+ {\caption@requirepackage{newfloat}{#1}}%
{\let\KV@prefix@ORI\KV@prefix
\let\@tempc@ORI\@tempc
- \caption@loadpackage{#1}{#2}%
- #3%
+ \caption@loadpackage{newfloat}{#1}%
+ #2%
\let\@tempc\@tempc@ORI
\let\KV@prefix\KV@prefix@ORI}}
-\newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
\@onlypreamble@key{caption}{figurename}
\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
@@ -1281,9 +1293,9 @@
\DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
\DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
\newcommand*\caption@within[2]{%
- \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
+ \caption@newfloat{#1within=#2}{\newfloat@setwithin{#1}{#2}}}
\DeclareCaptionOption{within}{%
- \caption@newfloat{within}{\newfloatsetup{within=#1}}}
+ \caption@newfloat{within=#1}{\newfloatsetup{within=#1}}}
\DeclareCaptionOptionNoValue{without}{%
\caption@newfloat{without}{\newfloatsetup{without}}}
\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
@@ -1337,12 +1349,8 @@
\@ifnextchar [% %] match left bracket
{\sf@@subfloat}%
{\sf@@subfloat[\@empty]}}
-%%\@ifl@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
-\captionsetup{style=default,position=default,%
- list,listformat=default,twoside=\if@twoside 1\else 0\fi}
-\ProcessOptions*
\newcommand\caption@addcontentsline[2]{%
\caption@ifcontentsline{#2}{%
\begingroup
@@ -1368,7 +1376,7 @@
\caption@add@contentsline
{\csname ext@#1\endcsname}%
{#1}%
- {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\caption@listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
{\ignorespaces #2}%
\caption@chkfloat{#1}{#2}}}}
\newcommand*\caption@add@contentsline{%
@@ -1387,8 +1395,14 @@
\fi}
\newcommand*\caption@addsubcontentslines[1]{}
\newif\ifcaption@star
-\newcommand*\caption@fnum[1]{\caption@lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
-\newcommand\caption@make[2]{\caption@@make{\caption@lfmt{#1}{#2}}}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+\newcommand*\caption@fnum[1]{%
+ \expandafter\let\expandafter\caption@original@fnum\csname caption@fnum@#1\endcsname % for label format `original'
+ \caption@labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
+\newcommand\caption@make[2]{\caption@@make{\caption@labelformat{#1}{#2}}}
\newcommand\caption@@make[2]{%
\begingroup
\caption@@make@{#1}{#2}%
@@ -1398,18 +1412,18 @@
\caption@stepthecounter
\caption@beginhook
\caption@box\hsize{%
- \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}%
+ \caption@singlelinecheck{\caption@slc{#1}{#2}\caption@singleline\caption@multiline}{\caption@multiline}%
\caption@calcmargin
\caption@tempdima\captionmargin
\ifdim\captionmargin@=\z@ \else
\caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}%
\fi
- \caption@ifh{\advance\caption@tempdima\caption@indent}%
+ \caption@ifhmode{\advance\caption@tempdima\caption@indent}%
\hspace\caption@tempdima
\caption@tempdima\captionwidth
- \caption@ifh{\advance\caption@tempdima-\caption@indent}%
+ \caption@ifhmode{\advance\caption@tempdima-\caption@indent}%
\caption@parbox\caption@tempdima{%
- \caption@ifh{%
+ \caption@ifhmode{%
\ifdim\caption@indent=\z@
\leavevmode
\else
@@ -1458,7 +1472,7 @@
\singlelinecaptiontrue
\begingroup
\caption@singleline
- \let\caption@hj\@empty
+ \let\caption@justification\relax
\caption@calcmargin % calculate \captionwidth
\caption@prepareslc
\sbox\@tempboxa{\caption@@@make{#1}{#2}}%
@@ -1473,8 +1487,11 @@
\caption@Debug{End SLC}}
\newif\ifsinglelinecaption
\newcommand*\caption@singleline{%
- \caption@xsetup\caption@opt@singleline
+ \caption@xsetup\caption@slsty % Note: This could change \caption@format
+ \caption@format % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
\let\caption@fmt\caption@slfmt}
+\newcommand*\caption@multiline{%
+ \caption@format} % defines \caption@ifhmode, \caption@slfmt, and \caption@fmt
\providecommand*\caption@prepareslc{}
\g@addto@macro\caption@prepareslc{%
\let\label\caption@gobble
@@ -1491,7 +1508,6 @@
\def\endnotemark{\caption@withoptargs\caption@endnotemark}%
\let\caption@endnotetext@ORI\@endnotetext
\let\@endnotetext\caption@gobble
- \let\pagenote\caption@gobble
\let\acused\@gobble
\let\AC@placelabel\@gobble
\let\glsunset\@gobble
@@ -1512,26 +1528,18 @@
\endgroup}
\newcommand*\caption@l@stepcounter[1]{%
\advance\csname c@#1\endcsname\@ne\relax}
-\caption@ifclassloaded{beamer}{%
- \g@addto@macro\caption@prepareslc{%
- \def\footnote{%
- \begingroup
- \let\stepcounter\caption@l@stepcounter
- \renewcommand<>\beamer@framefootnotetext[1]{%
- \endgroup}%
- \let\@footnotetext\beamer@framefootnotetext
- \caption@footnote@ORI}}}{}
\newcommand*\caption@applyfont{%
- \caption@hj\captionfont\captionsize}
+ \caption@justification\captionfont\captionsize}
\newcommand\caption@@@make[2]{%
\sbox\@tempboxa{#1}%
\ifdim\wd\@tempboxa=\z@
- \let\caption@lsep\relax
+ \caption@set{labelseparator}{none}%
\fi
\caption@ifempty{#2}{%
- \let\caption@lsep\@empty
- \let\caption@tfmt\@firstofone
+ \caption@set{labelseparator}{none}%
+ \caption@set{textformat}{simple}%
}%
+ \caption@labelseparator % defines \caption@iflabelfont, \caption@labelsep and \caption@labelsep@name (the latter is needed by \caption@fmt)
\@setpar{\@@par\caption@@par}\caption@@par
\caption@applyfont
\caption@fmt
@@ -1543,23 +1551,23 @@
\fi}%
{\ifcaption@star\else
\begingroup
- \caption@iflf\captionlabelfont
- \relax\caption@lsep
+ \caption@iflabelfont\captionlabelfont
+ \relax\caption@labelsep
\endgroup
\fi}%
{{\captiontextfont
- \captiontextstart
+ \caption@textstart
\caption@ifstrut
{\vrule\@height\ht\strutbox\@width\z@}%
{}%
\nobreak\hskip\z@skip % enable hyphenation
- \caption@tfmt{#2}%
+ \caption@textformat{#2}%
\caption@ifstrut
{\ifhmode\@finalstrut\strutbox\fi}%
{}%
- \captiontextend}}}
-\newcommand*\captiontextstart{}
-\newcommand*\captiontextend{\par}
+ \caption@textend}}}
+\newcommand*\caption@textstart{}
+\newcommand*\caption@textend{\par}
\newcommand\caption@ifempty[1]{%
\caption@if@empty{#1}%
\caption@ifempty\@unused}
@@ -1601,17 +1609,21 @@
\newcommand*\caption@@par{%
\parindent\caption@parindent\hangindent\caption@hangindent}%
\newcommand*\DeclareCaptionType{%
- \caption@loadpackage{newfloat}{}%
+ \caption@loadpackage{newfloat}{declare type}%
\DeclareFloatingEnvironment}
\@onlypreamble\DeclareCaptionType
-\newcommand\caption@ForEachType[1]{%
+\newcommand*\ForEachCaptionType{%
+ \@ifstar
+ {\caption@foreach@type\@gobble}%
+ {\caption@foreach@type\@iden}}
+\newcommand\caption@foreach@type[2]{%
\caption@ifdefined\ForEachFloatingEnvironment
- {\ForEachFloatingEnvironment{#1}}%
- {\def\@elt##1{#1}%
+ {\ForEachFloatingEnvironment*{#2}}%
+ {\def\@elt##1{#2}%
\caption@ifdefined\c@figure\@elt\@gobble{figure}%
\caption@ifdefined\c@table\@elt\@gobble{table}%
- \let\@elt\relax
- \newfloat@addtohook{#1}}}
+ \let\@elt\relax}%
+ #1{\newfloat@addtohook{#2}}}
\providecommand\newfloat@addtohook[1]{%
\toks@=\expandafter{\newfloat@hook{##1}#1}%
\edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
@@ -1626,28 +1638,28 @@
\def\caption@@declaresubtype#1[#2]#3{%
\@ifundefined{c@#3}%
{\caption@Error{No float type '#3' defined}}%
- {\caption@ifsubtype{sub#3}%
- {\caption@Debug{Modify subtype `sub#3'}}%
- {\caption@Debug{New subtype `sub#3'}%
- \@ifundefined{c@sub#3}%
- {\newcounter{sub#3}\relax}%
- {\caption@Warning{Using already defined counter `sub#3'}}%
- \@addtoreset{sub#3}{#3}%
- \@namedef{ext@sub#3}{\csname ext@#3\endcsname}%
- \caption@declaresublistentry{#3}%
- \@cons\caption@subtypelist{{#3}}}%
- \caption@ifdefined\contentsuse{%
- \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}{}%
- \@namedef{sub#3name}{}%
- \@namedef{sub#3autorefname}{\csname #3autorefname\endcsname}%
- #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
- {\@namedef{p@sub#3}{}%
- \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
- {\@namedef{p@sub#3}{\csname the#3\endcsname}%
- \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
- \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
- }}
+ {\caption@@@declaresubtype{#1}{#2}{#3}{sub#3}}}
\@onlypreamble\caption@@declaresubtype
+\newcommand*\caption@@@declaresubtype[4]{%
+ \caption@ifin@list\caption@subtypelist{#4}%
+ {\caption@Debug{Modify subtype `#4'}}%
+ {\caption@Debug{New subtype `#4'}%
+ \newcounter{#4}[{#3}]%
+ \@namedef{ext@#4}{\csname ext@#3\endcsname}%
+ \caption@declaresublistentry{#3}%
+ \caption@l@addto@list\caption@subtypelist{#4}%
+ \caption@subtype@hook{#4}}%
+ \caption@ifdefined\contentsuse{%
+ \contentsuse{#4}{\csname ext@#4\endcsname}}{}%
+ \@namedef{#4name}{}%
+ \@namedef{#4autorefname}{\csname #3autorefname\endcsname}%
+ #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
+ {\@namedef{p@#4}{}%
+ \@namedef{the#4}{\csname the#3\endcsname.\@nameuse{#2}{#4}}}%
+ {\@namedef{p@#4}{\csname the#3\endcsname}%
+ \@namedef{the#4}{\@nameuse{#2}{#4}}}%
+ \@namedef{theH#4}{\csname theH#3\endcsname.\arabic{#4}}}
+\@onlypreamble\caption@@@declaresubtype
\newcommand*\caption@declaresublistentry{%
\caption@ifdefined\l@chapter
{\caption@@declaresublistentry\l@subsection}%
@@ -1691,37 +1703,43 @@
\fi}
\@onlypreamble\caption@@@@@@declaresublistentry
\newcommand*\caption@subtypelist{}
-\newcommand*\caption@ifsubtype[1]{%
- \begingroup
- \let\next\@secondoftwo
- \edef\@tempa{#1}%
- \def\@elt##1{%
- \def\@tempb{sub##1}%
- \ifx\@tempa\@tempb
- \let\next\@firstoftwo
- \fi}%
- \caption@subtypelist
- \expandafter\endgroup\next}
-\newcommand*\caption@restorecounters{%
- \caption@restore@counters
- \global\let\caption@restore@counters\@empty}
-\newcommand*\caption@restore@counters{}
+\newcommand*\caption@ifsubtype{%
+ \caption@ifin@list\caption@subtypelist}
+\newcommand*\ForEachCaptionSubType{%
+ \@ifstar
+ {\caption@foreach@subtype\@gobble}%
+ {\caption@foreach@subtype\@iden}}
+\newcommand\caption@foreach@subtype[2]{%
+ \caption@for@list\caption@subtypelist{#2}%
+ #1{\caption@addto@subtype@hook{#2}}}
+\providecommand\caption@addto@subtype@hook[1]{%
+ \toks@=\expandafter{\caption@subtype@hook{##1}#1}%
+ \edef\@tempa{\def\noexpand\caption@subtype@hook####1{\the\toks@}}%
+ \@tempa}
+\providecommand*\caption@subtype@hook[1]{}
\newcommand*\caption@savesubcounters{%
- \def\@elt##1{\caption@savecounter{sub##1}}%
- \caption@subtypelist
- \let\@elt\relax}%
+ \caption@for@list\caption@subtypelist{\caption@savecounter{##1}}}
\newcommand*\caption@savecounter[1]{%
\edef\caption@tempa{%
\noexpand\l@addto@macro\noexpand\caption@restore@counters
{\noexpand\setcounter{#1}{\number\value{#1}}}}%
\caption@tempa}
-\newcommand*\caption@For{%
- \caption@withoptargs\caption@@For}
-\newcommand\caption@@For[3]{%
- \caption@AtBeginDocument#1{%
- \def\@elt##1{#3}%
- \@nameuse{caption@#2}%
- \let\@elt\relax}}%
+\newcommand*\caption@restorecounters{%
+ \caption@restore@counters
+ \global\let\caption@restore@counters\@empty}
+\newcommand*\caption@restore@counters{}
+\ifx\caption@documentclass\@empty\else
+ \@pushfilename
+ \edef\@currname{caption-\caption@documentclass}
+ \edef\@currext{sto}
+ \InputIfFileExists
+ {\@currname.\@currext}%
+ {}%
+ {\@missingfileerror\@currname\@currext}%
+ \@popfilename
+\fi
+\captionsetup{style=default,position=default,listformat=default}
+\ProcessOptions*
\endinput
%%
%% End of file `caption3.sty'.
diff --git a/Master/texmf-dist/tex/latex/caption/ltcaption.sty b/Master/texmf-dist/tex/latex/caption/ltcaption.sty
index 2f0130a7f74..dcad4344f7a 100644
--- a/Master/texmf-dist/tex/latex/caption/ltcaption.sty
+++ b/Master/texmf-dist/tex/latex/caption/ltcaption.sty
@@ -25,11 +25,15 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
diff --git a/Master/texmf-dist/tex/latex/caption/subcaption.sty b/Master/texmf-dist/tex/latex/caption/subcaption.sty
index 2571116ecf8..1ccc6590fee 100644
--- a/Master/texmf-dist/tex/latex/caption/subcaption.sty
+++ b/Master/texmf-dist/tex/latex/caption/subcaption.sty
@@ -25,47 +25,50 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
+%% caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
+%% caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
+%% caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
+%% caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
+%% caption.sty, caption-light.sty, caption2.sty, caption3.sty,
+%% caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
+%% caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
+%% caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty,
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{subcaption}[2020/01/22 v1.3d Sub-captions (AR)]
-\RequirePackage{caption}[2020/01/03] % needs v3.4h or newer
-\newcommand\subcaption@CheckCompatibility{%
- \@ifundefined{caption@ifcompatibility}{}{%
- \caption@ifcompatibility{%
- \caption@Error{%
- The `subcaption' package does not work correctly\MessageBreak
- in compatibility mode}}{}}%
+\ProvidesPackage{subcaption}[2020/08/23 v1.3g Sub-captions (AR)]
+\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
+\newcommand*\subcaption@CheckCompatibility{%
+ \caption@ifcompatibility{%
+ \PackageError{subcaption}%
+ {This package does not work with\MessageBreak
+ caption option `compatibility=v1'}%
+ {\subcaption@eh}%
+ \endinput}{}%
\@ifpackageloaded{subfigure}{%
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfigure package}%
- {\subcaption@EH}%
+ {\subcaption@eh}%
\endinput}{}%
\@ifpackageloaded{subfig}{%
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfig package}%
- {\subcaption@EH}%
+ {\subcaption@eh}%
\endinput}{}%
}
-\newcommand*\subcaption@EH{%
+\newcommand*\subcaption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `subcaption' package, especially the\MessageBreak
section about errors.\MessageBreak\@ehc}
\subcaption@CheckCompatibility
\caption@AtBeginDocument{%
\subcaption@CheckCompatibility
- \let\subcaption@CheckCompatibility\@undefined
- \let\subcaption@EH\@undefined
-}
-\caption@ForEachType{\DeclareCaptionSubType{#1}}
+ \let\subcaption@CheckCompatibility\@undefined}
+\ForEachCaptionType{\DeclareCaptionSubType{#1}}
\caption@ifundefined\newsubfloat{}{%
\renewcommand*\newsubfloat{\DeclareCaptionSubType}}
\def\subcaption{%
@@ -81,13 +84,13 @@
{\caption@Error{\noexpand\phantomsubcaption outside float}}}%
\g@addto@macro\caption@subtypehook{%
\let\phantomsubcaption\phantomcaption}
-\caption@For{subtypelist}{%
- \newenvironment{sub#1}%
+\ForEachCaptionSubType{%
+ \newenvironment{#1}%
{\@ifnextchar[%]
\subcaption@iminipage
{\subcaption@iminipage[c]}}%
{\subcaption@endminipage
- \endminipage}}%
+ \endminipage}}
\def\subcaption@iminipage[#1]{%
\caption@withoptargs{\subcaption@iiminipage{#1}}}
\newcommand*\subcaption@iiminipage[3]{%
@@ -136,13 +139,13 @@
\newcommand*\p@subref{}
\DeclareCaptionOption{subrefformat}{\subcaption@setrefformat{#1}}
\newcommand*\subcaption@setrefformat[1]{%
- \@ifundefined{caption@lfmt@#1}%
+ \@ifundefined{caption@labelformat@#1}%
{\caption@Error{Undefined label format `#1'}}%
- {\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}
+ {\expandafter\let\expandafter\subcaption@reffmt\csname caption@labelformat@#1\endcsname}}
\subcaption@setrefformat{simple}
\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
\caption@ExecuteOptions{subcaption}{%
- size=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
+ font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
\caption@ProcessOptions*{subcaption}
\def\subfloat{%
\@ifnextchar[\@subfloat\subfloat@}
@@ -151,7 +154,7 @@
\long\def\@@subfloat#1[#2]{%
\@@@subfloat{\subcaptionbox[{#1}]}{#2}}
\long\def\@@@subfloat#1#2#3{%
- \caption@getlabel#3\label{}\@nil
+ \caption@getlabel{#3}%
#1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
\global\let\caption@thelabel\relax
\ignorespaces}
@@ -162,7 +165,7 @@
{\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
{}% no optional arguments for \caption
{}% no sub-caption
- [\wd\@tempboxa][\caption@hj@default]%
+ [\wd\@tempboxa][\captionbox@innerpos@default]%
{\unhbox\@tempboxa}%
\ignorespaces}
\endinput
diff --git a/Master/texmf-dist/tex/latex/caption/totalcount.sty b/Master/texmf-dist/tex/latex/caption/totalcount.sty
deleted file mode 100644
index a4bbd5786a5..00000000000
--- a/Master/texmf-dist/tex/latex/caption/totalcount.sty
+++ /dev/null
@@ -1,98 +0,0 @@
-%%
-%% This is file `totalcount.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% totalcount.dtx (with options: `package')
-%%
-%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
-%%
-%% https://gitlab.com/axelsommerfeldt/caption
-%%
-%% --------------------------------------------------------------------------
-%%
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% This Current Maintainer of this work is Axel Sommerfeldt.
-%%
-%% This work consists of the files
-%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
-%% the derived files
-%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
-%% and the user manuals
-%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
-%%
-\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{totalcount}[2018/01/21 v1.0a Total values of counters (AR)]
-\newcommand*\DeclareTotalCounter[1]{%
- \newcounter{totalcount@#1}%
- \@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}%
- \@namedef{total#1es}{\@nameuse{total#1s}}%
- \expandafter\newif\csname iftotal#1s\endcsname
- \@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}%
- \AtBeginDocument{\@ifundefined{c@#1}%
- {\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
- {\@cons\totalcount@counters{{#1}}}}}
-\@onlypreamble\DeclareTotalCounter
-\let\totalcount@counters\@empty
-\newcommand*\totalcount@xspace{}
-\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}}
-\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
-\ProcessOptions\relax
-\ifx\totalcount@xspace\@empty\else
- \RequirePackage{xspace}
-\fi
-\newcommand*\totalcount@addtocounter[1]{%
- \@ifundefined{c@totalcount@#1}{}{%
- \addtocounter{totalcount@#1}{\value{#1}}}}
-\let\totalcount@stpelt@ORI\@stpelt
-\renewcommand*\@stpelt[1]{%
- \totalcount@addtocounter{#1}%
- \totalcount@stpelt@ORI{#1}}
-\newcommand*\totalcount@set[2]{%
- \@ifundefined{c@totalcount@#1}%
- {}%
- {\global\@namedef{total#1s}{#2\totalcount@xspace}%
- \ifnum#2<1\relax \else
- \global\@nameuse{total#1strue}%
- \fi}}
-\AtBeginDocument{\AtEndDocument{%
- \begingroup
- \@tempswafalse
- \if@filesw
- \immediate\write\@mainaux{%
- \string\providecommand\string\totalcount@set[2]{}}%
- \fi
- \def\@elt#1{%
- \totalcount@addtocounter{#1}%
- \edef\totalcount@tempa{\the\value{totalcount@#1}}%
- \expandafter\let\expandafter\totalcount@tempb\csname total#1s\endcsname
- \@expandtwoargs\totalcount@set{#1}{\totalcount@tempa}%
- \expandafter\ifx\csname total#1s\endcsname\totalcount@tempb \else
- \@tempswatrue
- \fi
- \if@filesw
- \immediate\write\@mainaux{%
- \string\totalcount@set{#1}{\totalcount@tempa}}%
- \fi}%
- \totalcount@counters
- \if@tempswa
- \PackageWarningNoLine{totalcount}{%
- Total counter(s) have changed.\MessageBreak
- Rerun to get them right}%
- \fi
- \endgroup}}%
-\endinput
-%%
-%% End of file `totalcount.sty'.