texlive[56213] Master/texmf-dist: caption (30aug20)

commits+karl at tug.org commits+karl at tug.org
Sun Aug 30 23:10:25 CEST 2020


Revision: 56213
          http://tug.org/svn/texlive?view=revision&revision=56213
Author:   karl
Date:     2020-08-30 23:10:24 +0200 (Sun, 30 Aug 2020)
Log Message:
-----------
caption (30aug20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/caption/CHANGELOG
    trunk/Master/texmf-dist/doc/latex/caption/README
    trunk/Master/texmf-dist/doc/latex/caption/caption-deu.pdf
    trunk/Master/texmf-dist/doc/latex/caption/caption-eng.pdf
    trunk/Master/texmf-dist/doc/latex/caption/subcaption.pdf
    trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex
    trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex
    trunk/Master/texmf-dist/source/latex/caption/caption.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption.ins
    trunk/Master/texmf-dist/source/latex/caption/caption2.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
    trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx
    trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx
    trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty
    trunk/Master/texmf-dist/tex/latex/caption/caption.sty
    trunk/Master/texmf-dist/tex/latex/caption/caption2.sty
    trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
    trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty
    trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf
    trunk/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-koma.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-light.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
    trunk/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-beamer.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-koma.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-light.sty
    trunk/Master/texmf-dist/tex/latex/caption/caption-memoir.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-ntg.sto
    trunk/Master/texmf-dist/tex/latex/caption/caption-thesis.sto

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/caption/totalcount.pdf
    trunk/Master/texmf-dist/source/latex/caption/totalcount.dtx
    trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty

Modified: trunk/Master/texmf-dist/doc/latex/caption/CHANGELOG
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/CHANGELOG	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/doc/latex/caption/CHANGELOG	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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,7 +118,19 @@
 - \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 at 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 at switchdefault and \caption at 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.3 (2019/08/31)
 - New command \subfloat for easy transition from the `subfig' package
-
-
-totalcount package
-------------------
-
-v1.0 (2008/03/09)
-- 1st published version
-

Modified: trunk/Master/texmf-dist/doc/latex/caption/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/README	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/doc/latex/caption/README	2020-08-30 21:10:24 UTC (rev 56213)
@@ -1,7 +1,7 @@
 ==========================================================================
 
 The `caption' package bundle
-Release 2020-07-20
+Release 2020-08-30
 Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 
 License: LPPL = LaTeX Project Public Licence
@@ -23,13 +23,13 @@
 
 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 at 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 @@
 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.)

Modified: trunk/Master/texmf-dist/doc/latex/caption/caption-deu.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/caption/caption-eng.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf	2020-08-30 21:10:24 UTC (rev 56213)

Property changes on: trunk/Master/texmf-dist/doc/latex/caption/caption-light.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/caption/subcaption.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/caption/totalcount.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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,18 +831,11 @@
 %
 %    \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
+\RequirePackage{caption}[2020/08/23] % needs v3.5 or newer
 %    \end{macrocode}
-% \changes{v1.0}{2011/09/01}{Compatibility error added}
-%    \begin{macrocode}
-\caption at AtBeginDocument{\caption at ifcompatibility{%
-  \caption at Error{%
-    The `bicaption' package does not work correctly\MessageBreak
-    in compatibility mode}}{}}
-%    \end{macrocode}
 %
 % \bigskip
 %
@@ -897,6 +894,30 @@
 % \end{macro}
 %
 % \pagebreak[3]
+% \subsection{Compatibility check}
+%
+% \begin{macro}{\bicaption at 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 at CheckCompatibility{%
+%    \end{macrocode}
+%    \begin{macrocode}
+  \caption at ifcompatibility{%
+    \bicaption at Error
+      {This package does not work with\MessageBreak
+       caption option `compatibility=v1'}%
+    \endinput}{}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\bicaption at CheckCompatibility
+\caption at AtBeginDocument{%
+  \bicaption at CheckCompatibility
+  \let\bicaption at 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 at getlabel#2\label{}\@nil
+  \caption at getlabel{#2}%
   \bicaption at ifswap
     {\bicaption at setup{#1}{#2}%
      \bicaption at cmd[{#3}]{#4}}%
@@ -1293,7 +1314,7 @@
 %    \begin{macrocode}
 \long\def\LT@@@@bicaption#1#2[#3]#4{%
   \gdef\bicaption at LTsetup{%
-    \caption at getlabel#2\label{}\@nil
+    \caption at getlabel{#2}%
     \bicaption at LT@setup}%
   \gdef\bicaption at LT@setup{%
     \bicaption at ifswap

Added: trunk/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,254 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-ams-smf.dtx'.
+% 
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at font}{\@captionfont}
+\DeclareCaptionFont{ams at labelfont}{\@captionheadfont}
+\DeclareCaptionFont{ams at textfont}{\@captionfont\upshape}
+\SetCaptionDefault{font}{ams at font}
+\SetCaptionDefault{labelfont}{ams at labelfont}
+\SetCaptionDefault{textfont}{ams at 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
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-ams-smf.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-beamer.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-beamer.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,382 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-beamer.dtx'.
+% 
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at ifbeamertemplate}
+% |\caption at 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 at ifbeamertemplate[1]{%
+  \begingroup
+    \let\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
+    \@nameuse{beamer@@tmpop at caption@#1}%
+    \ifx\beamer@@tmpl at caption@ORI\beamer@@tmpl at 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 at ifbeamertemplate{caption name own line}%
+    \@secondoftwo % \@secondoftwo -> singlelinecheck=off
+    \@firstoftwo} % \@firstoftwo  -> singlelinecheck=on
+%    \end{macrocode}
+%
+% \begin{macro}{\caption at 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 at footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
+% in \class{beamer} to offer a less dirty patch.)
+%    \begin{macrocode}
+\g at addto@macro\caption at prepareslc{%
+  \def\footnote{%
+    \begingroup
+    \let\stepcounter\caption at l@stepcounter
+    \renewcommand<>\beamer at framefootnotetext[1]{%
+      \endgroup}%
+    \let\@footnotetext\beamer at framefootnotetext
+    \caption at 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 at ifbeamertemplate{numbered}%
+    \caption at labelformat@simple
+    \caption at 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 at 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 at ifbeamertemplate{numbered}%
+    {#2.\bothIfSecond{\nobreakspace}{#1}}%
+    {\caption at labelformat@unnumbered{#1}{#2}}}
+%    \end{macrocode}
+% \begin{macro}{\@@magyar at captionfix}
+% Prevent \package{magyar} from defining this caption label format on its own.
+%    \begin{macrocode}
+\let\@@magyar at captionfix\relax
+\AtBeginDocument{\let\@@magyar at 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 at ifbeamertemplate{caption name own line}}%
+  {\caption at 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 at font}{%
+  \usebeamerfont*{caption}%
+  \usebeamercolor[fg]{caption}}
+\SetCaptionDefault{font}{beamer at font}
+%    \end{macrocode}
+%    \begin{macrocode}
+\DeclareCaptionFont{beamer at 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 at labelfont}
+%    \end{macrocode}
+%    \begin{macrocode}
+\DeclareCaptionFont{beamer at textfont}{}
+\SetCaptionDefault{textfont}{beamer at 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 at beamer@figure
+    \csname\string\figure\endcsname
+  \@namedef{\string\figure}[#1]{%
+    \caption at beamer@figure[#1]% use original beamer code first
+    \caption at 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 at beamer@table
+    \csname\string\table\endcsname
+  \@namedef{\string\table}[#1]{%
+    \caption at beamer@table[#1]% use original beamer code first
+    \caption at settype{table}} % set "type=table" afterwards
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+}
+%    \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-beamer.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex	2020-08-30 21:10:24 UTC (rev 56213)
@@ -1,7 +1,7 @@
 % 
 % This is file `caption-deu.tex'.
 % 
-% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 @@
 
 \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

Added: trunk/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,208 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-elsarticle.dtx'.
+% 
+% Copyright (C) 2013-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-elsarticle.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex	2020-08-30 21:10:24 UTC (rev 56213)
@@ -1,7 +1,7 @@
 % 
 % This is file `caption-eng.tex'.
 % 
-% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 @@
 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 @@
 
 % --------------------------------------------------------------------------- %
 
+\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 @@
 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 @@
 
 \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 @@
 % --------------------------------------------------------------------------- %
 
 \clearpage
-\section{Document classes \& Babel support}
+\section{Supported document classes}
 \label{classes}
 
 %\NEWdescription{v3.1}
@@ -2369,51 +2413,31 @@
 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 @@
 |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 @@
 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 @@
 % --------------------------------------------------------------------------- %
 
 \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 at 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 at switchdefault}
+If the \package{caption3} kernel package is loaded, the command
+\begin{quote}|\caption at 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 at restoredefault}
+The command
+\begin{quote}|\caption at 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 at switchdefault{labelseparator}{\babel at save #1}{french}}|\\
+  |% Note: \caption at restoredefault isn't needed here|
+\end{quote}
+
+Another example:
+\begin{quote}
+  |\caption at switchdefault{font}{\let\original at captionfont#1}{it}%|\\
+  \ldots\\
+  |\caption at restoredefault{font}{\original at 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 at switchdefault[3]{}|\\
+  |\providecommand\caption at 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 at 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 at makecaption}{%|\\
+  |    \babel at save\@makecaption|\\
+  |    \let\@makecaption\my at makecaption|\\
+  |  }{%|\\
+  |    \caption at switchdefault{|\ldots|}{\babel at 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 at 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 @@
 % --------------------------------------------------------------------------- %
 
 \end{document}
+

Added: trunk/Master/texmf-dist/source/latex/caption/caption-koma.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-koma.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-koma.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,518 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-koma.dtx'.
+% 
+% Copyright (C) 2004-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at koma@setcapwidth
+                \csname\string\setcapwidth\endcsname
+\@namedef{\string\setcapwidth}[#1]#2{%
+  \caption at koma@setcapwidth[{#1}]{#2}%
+  \caption at setcapwidth@opt{#1}%
+  \caption at 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 at setcapwidth@opt[1]{}
+\AtCaptionPackage{\renewcommand*\caption at setcapwidth@opt[1]{%
+  \ifx\\#1\\\else
+    \caption at ifdefined\cap at margin{%
+      \def\@tempa{captionbeside}%
+      \ifx\@tempa\@currenvir\else\caption at Warning{%
+        Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+      \fi}{}%
+  \fi}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at setcapwidth{%
+  \captionsetup{width=\cap at width}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\def\caption at tempa{\hsize}%
+\ifx\caption at tempa\cap at width \else
+  \caption at 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 at koma@setcapmargin
+                \csname\string\@setcapmargin\endcsname
+\@namedef{\string\@setcapmargin}[#1]#2{%
+  \caption at koma@setcapmargin[{#1}]{#2}%
+  \caption at setcapmargin}
+%    \end{macrocode}
+%    \begin{macrocode}
+\expandafter\let\expandafter\caption at koma@@setcapmargin
+                \csname\string\@@setcapmargin\endcsname
+\@namedef{\string\@@setcapmargin}[#1]#2{%
+  \caption at koma@@setcapmargin[{#1}]{#2}%
+  \caption at setcapmargin}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at setcapmargin{%
+  \begingroup
+    \let\onelinecaptionsfalse\relax
+    \def\@twoside{0}%
+    \def\if at twoside{\def\@twoside{1}\iffalse}%
+    \cap at margin
+    \def\@tempa{\endgroup}%
+    \ifx\cap at left\hfill\else\ifx\cap at right\hfill\else
+      \def\hspace##1##{\@firstofone}%
+      \edef\@tempa{\endgroup
+        \noexpand\captionsetup{%
+          twoside=\@twoside,slc=0,%
+          margin={\cap at left,\cap at right}}}%
+    \fi\fi
+    \@tempa}
+%    \end{macrocode}
+%    \begin{macrocode}
+\ifx\cap at margin\relax \else
+  \caption at 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 at koma@setcapindent\@setcapindent
+\renewcommand*\@setcapindent[1]{%
+  \caption at koma@setcapindent{#1}%
+  \caption at setcapindent}
+%    \end{macrocode}
+%    \begin{macrocode}
+\let\caption at koma@@setcapindent\@@setcapindent
+\renewcommand*\@@setcapindent[1]{%
+  \caption at koma@@setcapindent{#1}%
+  \caption at setcapindent}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at setcapindent{%
+  \captionsetup{indent=\ifdim\cap at indent<\z@\z@\else\cap at indent\fi}}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\caption at ifdefined\cap at indent{\caption at 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 at 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 at koma@parindent\KV at caption@parindent
+\DeclareCaptionOption{parindent}[]{%
+  \ifx,#1,%
+    \caption at Debug{Option `parindent' ignored}%
+  \else
+    \caption at koma@parindent{#1}%
+  \fi}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\let\caption at koma@parskip\KV at caption@parskip
+\DeclareCaptionOption{parskip}[]{%
+  \ifx,#1,%
+    \caption at Debug{Option `parskip' ignored}%
+  \else
+    \caption at 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 at addto@macro}}
+% Patch |\onelinecaptionstrue| and |onelinecaptionsfalse| so they will set the corresponding \package{caption3} setting, too.
+%    \begin{macrocode}
+\g at addto@macro\onelinecaptionstrue{\caption at setsinglelinecheck{true}}%
+\g at addto@macro\onelinecaptionsfalse{\caption at 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 at p
+    \caption at useformat{hang}{#1}{#2}{#3}%
+  \else
+    #1#2%
+    \ifdim\cap at indent<\z@
+      \par
+      \noindent\hspace*{-\cap at indent}%
+    \else\if at 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 at fnt@caption} resp. \cs{scr at fnt@captonlabel}.
+%    \begin{macrocode}
+\DeclareCaptionFont{scr at font}{\scr at fnt@caption}
+\DeclareCaptionFont{scr at labelfont}{\scr at fnt@captionlabel}
+\SetCaptionDefault{font}{scr at font}
+\SetCaptionDefault{labelfont}{scr at 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 at captionabove}
+% \changes{v1.0j}{2006/03/21}{Bugfix 06-03-21: \cs{let}\cs{caption at 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 at 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 at addto@macro\@captionabovetrue{\caption at setposition{t}}%
+\g at addto@macro\@captionabovefalse{\caption at setposition{b}}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\if at captionabove
+  \@captionabovetrue
+\else
+  \@captionabovefalse
+\fi
+%    \end{macrocode}
+% |\captionabove| \& |\captionbelow| for longtable:
+%    \begin{macrocode}
+\AtBeginCaption{\caption at AtBeginLongtable{%
+  \def\@captionabovetrue{\LT at captionsetup{position=t}}%
+  \def\@captionabovefalse{\LT at captionsetup{position=b}}}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if at tablecaptionabove}
+% \changes{v1.1g}{2008/03/01}{\cs{def} changed to \cs{g at addto@macro}}
+% Patch |\@tablecaptionabovetrue| and |\@tablecaptionabovefalse| so they will set the \package{caption3} position setting, too.
+%    \begin{macrocode}
+\g at addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}%
+\g at addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\if at tablecaptionabove
+  \@tablecaptionabovetrue
+\else
+  \@tablecaptionabovefalse
+\fi
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if at figurecaptionabove}
+% \changes{v1.5}{2013/02/15}{Support of \cs{if at figurecaptionabove} added}
+% Patch |\@figurecaptionabovetrue| and |\@figurecaptionabovefalse| so they will set the \package{caption3} position setting, too.
+%    \begin{macrocode}
+\caption at ifdefined\@figurecaptionabovetrue{%
+  \g at addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}%
+  \g at addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}%
+%    \end{macrocode}
+%    \begin{macrocode}
+  \if at 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 at koma@figureposition\KV at caption@figureposition
+  \DeclareCaptionOption{figureposition}{%
+    \caption at WarningNoLine{%
+      Option `figureposition=#1' has no effect\MessageBreak
+      when used with a KOMA-Script document class}%
+    \caption at koma@figureposition{#1}}
+%    \end{macrocode}
+%    \begin{macrocode}
+  \let\caption at koma@tableposition\KV at caption@tableposition
+  \DeclareCaptionOption{tableposition}{%
+    \caption at WarningNoLine{%
+      Option `tableposition=#1' has no effect\MessageBreak
+      when used with a KOMA-Script document class}%
+    \caption at koma@tableposition{#1}}}
+%    \end{macrocode}
+%
+% \section{Adaption of \cs{caption} command}
+%
+% \begin{macro}{\scr at caption}
+% \KOMAScript\ contains the code
+% |\AtBeginDocument{\let\scr at caption\caption}|
+% so we need to update |\scr at caption| after the \package{caption} package has re-defined |\caption|.
+%    \begin{macrocode}
+\AtBeginDocument{\let\scr at caption\caption}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-koma.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/caption/caption-light.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-light.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-light.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,394 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-light.dtx'.
+% 
+% Copyright (C) 2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at 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 at 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 at edef,\protected at 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 at 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 at ifbool{documentclass}{}{%
+  \caption at WarningNoLine{%
+    Unknown document class (or package),\MessageBreak
+    standard defaults will be used}}
+%    \end{macrocode}
+%
+% \section{Check against incompatible packages}
+%
+%    \begin{macrocode}
+\@ifpackageloaded{caption2}{%
+  \caption at 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 at SetupOptions{caption-light}{\caption at setkeys{caption}{#2}}
+\caption at ProcessOptions*{caption-light}
+%    \end{macrocode}
+%
+% \section{\cs{@makecaption}}
+%
+% If the \package{caption} package is loaded, we abort processing this file.
+%    \begin{macrocode}
+\caption at ifdefined\caption at makecaption
+  {\caption at Info{\noexpand\caption at makecaption is already defined}%
+   \endinput}{}
+%    \end{macrocode}
+%
+% \begin{macro}{\caption at 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 at makecaption#1#2{%
+  \caption at iftop\caption at belowskip\caption at aboveskip
+  \caption at labelseparator % defines \caption at iflabelfont and \caption at labelsep
+  \caption at singlelinecheck
+    {\sbox\@tempboxa{\caption@@makecaption{#1}{#2}}%
+     \ifdim \wd\@tempboxa >\hsize}%
+    {\iftrue}%
+    \caption@@makecaption{#1}{#2}\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi
+  \caption at iftop\caption at aboveskip\caption at belowskip}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand\caption@@makecaption[2]{%
+  \caption at applyfont
+  {\captionlabelfont #1}%
+  {\caption at iflabelfont\captionlabelfont
+   \relax\caption at labelsep}%
+  {\captiontextfont #2}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+%   Patch |\@makecaption|, so our definition will be used.
+%    \begin{macrocode}
+\let\@makecaption\caption at makecaption
+%    \end{macrocode}
+% \end{macro}
+%
+% \section{\cs{setcaptiontype}}
+%
+% We offer the options |type=| and |type*=|, too:
+%    \begin{macrocode}
+\caption at 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 at 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 at AtBeginDocument{%
+  \def\captionof{\caption at teststar\caption at of{\caption*}\caption}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at of[2]{\setcaptiontype*{#2}#1}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \Finale
+%
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-light.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-memoir.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-memoir.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,226 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-memoir.dtx'.
+% 
+% Copyright (C) 2011-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at prepareanchor} expands \cs{M at gettitle}
+%   \item \cs{caption at 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 at 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 at addto@macro\caption at prepareslc{%
+  \let\pagenote\caption at gobble}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-memoir.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-ntg.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-ntg.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,213 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-ntg.dtx'.
+% 
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at labelfont}{\CaptionLabelFont}
+\DeclareCaptionFont{ntg at textfont}{\CaptionTextFont}
+\SetCaptionDefault{labelfont}{ntg at labelfont}
+\SetCaptionDefault{textfont}{ntg at textfont}
+%    \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-ntg.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-thesis.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-thesis.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -0,0 +1,219 @@
+% \iffalse meta-comment
+% 
+% This is file `caption-thesis.dtx'.
+% 
+% Copyright (C) 2008-2020 Axel Sommerfeldt (axel.sommerfeldt at 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 at subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\renewcommand*\l at 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 at minipage\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex at 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 at 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 at edef,\protected at 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 at 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 at font} resp. \cs{cpb at font}.
+%    \begin{macrocode}
+\DeclareCaptionFont{cph at font}{\cph at font}
+\DeclareCaptionFont{cpb at font}{\cpb at font}
+\SetCaptionDefault{labelfont}{cph at font}
+\SetCaptionDefault{textfont}{cpb at font}
+%    \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \Finale
+%
+\endinput
+


Property changes on: trunk/Master/texmf-dist/source/latex/caption/caption-thesis.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/caption/caption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at ifclassloaded{ams}{%
-  \caption at InfoNoLine{AMS or SMF document class}%
+\caption at documentclass@code
+\let\caption at documentclass@code\@undefined
+\let\AtCaptionPackage\@firstofone
 %    \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 at ifclassloaded{koma}{%
-  \caption at 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 at addto@macro}}
-%    \begin{macrocode}
-  \g at addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
-  \g at addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \if at 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 at ifdefined\@figurecaptionabovetrue{%
-%    \end{macrocode}
-%    \begin{macrocode}
-    \g at addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
-    \g at addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
-%    \end{macrocode}
-%    \begin{macrocode}
-    \if at 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 at addto@macro}}
-%    \begin{macrocode}
-  \g at addto@macro\onelinecaptionstrue{\let\caption at ifslc\@firstoftwo}
-  \g at addto@macro\onelinecaptionsfalse{\let\caption at 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 at 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 at 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 at addto@macro\@captionabovetrue{\let\caption at position\@firstoftwo}
-  \g at addto@macro\@captionabovefalse{\let\caption at position\@secondoftwo}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \DeclareCaptionOption{figureposition}{%
-    \caption at WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
-    when used with a KOMA script document class}%
-    \captionsetup*[figure]{position=#1}}
-  \DeclareCaptionOption{tableposition}{%
-    \caption at 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 at KOMA@setcapindent\@setcapindent
-  \renewcommand*\@setcapindent[1]{%
-    \caption at KOMA@setcapindent{#1}\caption at setcapindent}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \let\caption at KOMA@@setcapindent\@@setcapindent
-  \renewcommand*\@@setcapindent[1]{%
-    \caption at KOMA@@setcapindent{#1}\caption at setcapindent}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\caption at setcapindent{%
-    \captionsetup{indent=\ifdim\cap at indent<\z@\z@\else\cap at indent\fi}}
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-  \caption at ifdefined\cap at indent{\caption at 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 at KOMA@setcapwidth
-                  \csname\string\setcapwidth\endcsname
-  \@namedef{\string\setcapwidth}[#1]#2{%
-    \caption at KOMA@setcapwidth[{#1}]{#2}\caption at setcapwidth{#1}}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\caption at setcapwidth[1]{%
-    \ifx\\#1\\\else
-      \caption at ifdefined\cap at margin{%
-        \def\@tempa{captionbeside}%
-        \ifx\@tempa\@currenvir\else\caption at Warning{%
-          Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
-        \fi}{}%
-    \fi
-    \captionsetup{width=\cap at width}}
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-  \def\caption at tempa{\hsize}%
-  \ifx\caption at tempa\cap at width \else
-    \caption at setcapwidth{?}
-  \fi
-%    \end{macrocode}
-%
-% \begin{macro}{\setcapmargin}
-%    \begin{macrocode}
-  \expandafter\let\expandafter\caption at KOMA@setcapmargin
-                  \csname\string\@setcapmargin\endcsname
-  \@namedef{\string\@setcapmargin}[#1]#2{%
-    \caption at KOMA@setcapmargin[{#1}]{#2}\caption at setcapmargin}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \expandafter\let\expandafter\caption at KOMA@@setcapmargin
-                  \csname\string\@@setcapmargin\endcsname
-  \@namedef{\string\@@setcapmargin}[#1]#2{%
-    \caption at KOMA@@setcapmargin[{#1}]{#2}\caption at setcapmargin}
-%    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\caption at setcapmargin{%
-    \begingroup
-      \let\onelinecaptionsfalse\relax
-      \def\@twoside{0}%
-      \def\if at twoside{\def\@twoside{1}\iffalse}%
-      \cap at margin
-      \def\@tempa{\endgroup}%
-      \ifx\cap at left\hfill\else\ifx\cap at right\hfill\else
-        \def\hspace##1##{\@firstofone}%
-        \edef\@tempa{\endgroup
-          \noexpand\captionsetup{%
-            twoside=\@twoside,slc=0,%
-            margin={\cap at left,\cap at right}}}%
-      \fi\fi
-      \@tempa}
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-  \ifx\cap at margin\relax \else
-    \caption at setcapmargin
-  \fi
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-}{}
-%    \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}
 %
-% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
 %    \begin{macrocode}
 \caption at SetupOptions{caption}{\caption at setkeys{#1}{#2}}
 \caption at ProcessOptions*{caption}
@@ -884,9 +683,8 @@
       \caption at if@minipage\@minipagetrue\@minipagefalse}%
   \caption at end}
 %    \end{macrocode}
-% \textsf{memoir} document class stuff:
+% \class{memoir} document class stuff:
 %    \begin{macrocode}
-\providecommand\M at gettitle[1]{}
 \providecommand\memcaptioninfo[4]{}
 %    \end{macrocode}
 % \end{macro}
@@ -900,6 +698,10 @@
   \caption at ifhypcap\caption@@start\relax
   \M at gettitle{#2}}
 %    \end{macrocode}
+% \class{memoir} document class stuff:
+%    \begin{macrocode}
+\providecommand\M at gettitle[1]{}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at makecaption}
@@ -938,25 +740,13 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\caption at aboveskip}
-% \begin{macro}{\caption at belowskip}
-% \changes{v3.3a}{2019/04/02}{This macro added}
-% |\caption at aboveskip|\\
-% |\caption at belowskip|\par
-% Typesets the skip above resp.~below the caption.
+% \begin{macro}{\caption at redefine}
+% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
 %    \begin{macrocode}
-\newcommand*\caption at aboveskip{%
-  \vskip\abovecaptionskip}
+\newcommand*\caption at redefine{}
 %    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at belowskip{%
-  \vskip\belowcaptionskip}
-%    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
-% \begin{macro}{\caption at 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 at redefine{}
 \g at addto@macro\caption at redefine{%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -979,13 +769,13 @@
     \renewcommand*\caption at redefine{}%
 %    \end{macrocode}
 %
-%  |\continuedfloat| is not supported in compatibility mode.
+%  |\continuedfloat| is not supported in compatibility mode `v1'.
 %    \begin{macrocode}
     \renewcommand*\caption at continuedfloat[1]{%
-      \caption at Error{Not available in compatibility mode}}%
+      \caption at Error{Not available with option `compatibility=v1'}}%
 %    \end{macrocode}
 %
-%  |\caption at start| is not supported in compatibility mode.
+%  |\caption at start| is not supported in compatibility mode `v1'.
 %    \begin{macrocode}
     \caption at AtBeginDocument*{%
       \let\caption at 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 at ORI@xfloat\@xfloat
+%    \end{macrocode}
+%    \begin{macrocode}
   \def\@xfloat#1[#2]{%
     \caption at ORI@xfloat{#1}[#2]%
-    \caption at settype{#1}}%
+    \caption at settype{#1}%
+    \caption at xfloat@hook}%
 %    \end{macrocode}
+%   Hook, could be extended with |\g at addto@macro\caption at x|\-|float at hook{|\ldots|}|.
+%   (The caption type could be found in |\@cap|\-|type|.)
+%    \begin{macrocode}
+  \newcommand*\caption at 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 at ORI@xdblfloat\@xdblfloat
 %    \end{macrocode}
+%    \begin{macrocode}
+  \def\@xdblfloat#1[#2]{%
+    \caption at ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+    \caption at setoptions{#1*}%
+    \caption at xdblfloat@hook}%
+%    \end{macrocode}
+%   Hook, could be extended with |\g at addto@macro\caption at xdbl|\-|float at hook{|\ldots|}|.
+%   (The caption type could be found in |\@cap|\-|type|.)
+%    \begin{macrocode}
+  \newcommand*\caption at 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 at boxrestore@mini
   \caption at settype}
 %    \end{macrocode}
@@ -1213,21 +1032,43 @@
 %
 % \begin{macro}{\caption at 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 at counterlist} from \package{subfig} package added}
+% |\caption at checktype|\marg{type}\marg{code}\par
+% is used by |\caption at 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 at checktype[1]{%
-  \caption at ifsubtype{#1}%
-     {\caption at Error{Should not be used with subtype `#1'}%
-      \@gobble}%
-     \@firstofone}
+  \caption at ifsubtype{#1}\@firstoftwo{\caption at ifin@list\sf at counterlist{#1}}%
+    {\caption at Error{Should not be used with subtype `#1'}%
+     \@gobble}%
+    \@firstofone}
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at checksubtype}
+% \changes{v3.4g}{2020/01/02}{This macro and its usage added}
+% \changes{v3.4m}{2020/07/29}{Check of \cs{sf at counterlist} from \package{subfig} package added}
+% |\caption at checksubtype|\marg{type}\marg{code}\par
+% is used by |\caption at 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 at checksubtype[1]{%
   \caption at ifsubtype{#1}%
-     \@firstofone
-     {\caption at Error{Undefined subtype `#1'}%
-      \@gobble}}
+    \@firstofone
+    {\caption at ifin@list\sf at counterlist{#1}%
+       {\caption at 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 at 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 at 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)
+%  be issued.
 %    \begin{macrocode}
-\caption at ifeTeX{%
-  \newcommand*\caption at checkgrouplevel[2]{%
-    \@ifundefined{#1caption at grouplevel}{%
-       \caption at ifundefined\caption at grouplevel{\let\caption at grouplevel\z@}{}%
-       \ifnum\currentgrouplevel>\caption at grouplevel\relax
-         \expandafter\edef\csname #1caption at grouplevel\endcsname{%
-           \the\currentgrouplevel}%
-       \else
-         \caption at Warning{\string#2\MessageBreak outside box or environment}%
-       \fi
-    }{}}%
-}{%
-  \let\caption at checkgrouplevel\@gobbletwo
-}
+\newcommand*\caption at checkgrouplevel[2]{%
+  \@ifundefined{#1caption at grouplevel}{%
+     \caption at ifundefined\caption at grouplevel{\let\caption at grouplevel\z@}{}%
+     \ifnum\currentgrouplevel>\caption at grouplevel\relax
+       \expandafter\edef\csname #1caption at grouplevel\endcsname{%
+         \the\currentgrouplevel}%
+     \else
+       \caption at 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 at 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 at 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 at teststar\caption at of{\caption*}\caption}}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\caption at of[2]{\setcaptiontype*{#2}#1}
+\providecommand*\caption at 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 at 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 at iibox#1#2#3[#4]{%
-  \@testopt{\caption at iiibox{#1}{#2}{#3}[{#4}]}\captionbox at hj@default}
+  \@testopt{\caption at iiibox{#1}{#2}{#3}[{#4}]}\captionbox at innerpos@default}
 %    \end{macrocode}
 %    \begin{macrocode}
 \long\def\caption at iibox@#1#2#3#4{%
   \setbox\@tempboxa\hbox{#4}%
-  \caption at iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox at hj@default]{\unhbox\@tempboxa}}
+  \caption at iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox at innerpos@default]{\unhbox\@tempboxa}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \long\def\caption at iiibox#1{%
@@ -1399,7 +1239,7 @@
       \caption at setposition t%
       #2{\caption#4{#5}}%
       \captionbox at hrule
-      \csname caption at hj@#7\endcsname
+      \csname caption at justification@#7\endcsname
       #8}%
   }{%
     \endgroup
@@ -1406,7 +1246,7 @@
     \parbox[b]{#6}{%
       #1\relax
       \caption at setposition b%
-      \csname caption at hj@#7\endcsname
+      \csname caption at justification@#7\endcsname
       #8%
       \captionbox at hrule
       #3{\caption#4{#5}}}%
@@ -1413,14 +1253,14 @@
   }}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\captionbox at hj@default{c}
+\newcommand*\captionbox at innerpos@default{c}
 \newcommand*\captionbox at hrule{\hrule\@height\z@\relax}
 %    \end{macrocode}
 %    \begin{macrocode}
-\providecommand*\caption at hj@c{\centering}
-\providecommand*\caption at hj@l{\raggedright}
-\providecommand*\caption at hj@r{\raggedleft}
-\providecommand*\caption at hj@s{}
+\providecommand*\caption at justification@c{\centering}
+\providecommand*\caption at justification@l{\raggedright}
+\providecommand*\caption at justification@r{\raggedleft}
+\providecommand*\caption at justification@s{}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1576,7 +1416,7 @@
 % (If |\caption at 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 at fixposition
+     \caption at fixposition % TODO: Make this independant on the "position" setting
      \caption at iftop\caption at setflag\caption at 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 at setfnum}
 % \changes{v3.1}{2007/03/10}{This macro added}
+% \changes{v3.5}{2020/08/03}{Adapted to \package{caption3} v2.0}
 %  |\caption at 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 at fnum@|\meta{type}
+% and re-defines it according the caption label format set with |label|\-|format=|.
 %    \begin{macrocode}
 \newcommand*\caption at setfnum[1]{%
-  \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption at lfmt\caption at lfmt@default\else}%
-    \@namedef{fnum@#1}{\caption at fnum{#1}}%
-  \fi}
+  \@ifundefined{caption at fnum@#1}%
+    {\expandafter\let\csname caption at fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+     \@namedef{fnum@#1}{\caption at fnum{#1}}}%
+    {}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1795,16 +1634,11 @@
 %
 % \begin{macro}{\caption at 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 at font{normal}%|
-%  \end{quote}
-%  but executes faster (since the starred form of |\caption at 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 at normalsize{%
-  \caption at font*{\KV at caption@fnt at normal\@unused}}
+  \caption at 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 at DeclareSubType}
-% |\caption at DeclareSub| initializes the usage of \cs{caption}
-% in sub-floats.
-%    \begin{macrocode}
-\def\caption at DeclareSubType sub#1\@nil{%
-  \caption at Debug{Initializing subtype for `#1'\@gobble}%
-  \@namedef{caption at beginsub#1}{\caption at beginsubfloat{#1}}}
-\@onlypreamble\caption at DeclareSubType
-%    \end{macrocode}
-% \end{macro}
-%
-% Initialize the sub-captions defined with \cs{DeclareCaptionSubType}\ldots
-%    \begin{macrocode}
-\caption at For*{subtypelist}{\caption at DeclareSubType sub#1\@nil}
-%    \end{macrocode}
-%
-% Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots
-%    \begin{macrocode}
-\caption at AtBeginDocument*{%
-  \caption at ifdefined\sf at counterlist{%
-    \@for\sf at temp:=\sf at counterlist\do{%
-      \expandafter\caption at DeclareSubType\sf at temp\@nil}}{}}
-%    \end{macrocode}
-%
 % \begin{macro}{\caption at subtypehook}
 % \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption at 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 at 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 at chkfloat\@gobbletwo
 %    \end{macrocode}
 %    \begin{macrocode}
-    \caption at setbox{none}%
+    \caption at set{box}{none}%
     \caption at clearmargin
     \caption at iflist{}{\let\caption at setlist\@gobble}%
     \caption at setoptions{sub}%
@@ -2094,181 +1905,117 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \section{Babel package support}
 %
-% \section{Document class \& Babel package support}
+% \subsection{The arabic \& farsi babel option}
+% \changes{v3.5}{2020/08/02}{\package{arabic} babel support addded}
 %
-% \subsection{The \AmS{} \& \SmF{} classes}
-% \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added}
-%
 %    \begin{macrocode}
-\caption at ifdefined\smf at makecaption{\let\smf at makecaption\@makecaption}{}
+\caption at 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 at figure|, and |\fnum at table|
+% incompatible to the \package{caption} package, therefore we have to restore our resp.~the original definitions here.
 %
 %    \begin{macrocode}
-\@ifclassloaded{beamer}{%
-  \caption at InfoNoLine{beamer document class}%
+  \let\@makecaption\caption at makecaption
+  \def\fnum at figure{\figurename\nobreakspace\thefigure}%
+  \def\fnum at 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 at ORI@figure\figure
-  \def\figure{\caption at settype{figure}\caption at 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.
+% \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}
-  \let\caption at ORI@table\table
-  \def\table{\caption at settype{table}\caption at ORI@table}
+\caption at IfFrenchLe{%
 %    \end{macrocode}
-% \end{macro}
 %
+% \begin{macro}{\f at ffrench}
+% \begin{macro}{\f at tfrench}
+%  |\f at ffrench| and |\f at tfrench| reflect |\fnum at figure| and |\fnum at 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}
-}{}
+  \def\f at ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+  \def\f at tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+  \let\@eatDP\@undefined
 %    \end{macrocode}
+% \end{macro}
+% \end{macro}
 %
-% \subsection{The \KOMAScript{} classes}
-%
-% \KOMAScript\ contains the code
-% |\AtBeginDocument{\let\scr at caption\caption}|
-% so we need to update |\scr at caption| here, too.
-%
+% Since the \package{frenchle} package overwrites |\@make|\-|caption| (within |\GO|\-|french|),
+% we need to save it beforehand and restore it afterwards.
 %    \begin{macrocode}
-\caption at ifdefined\scr at caption{%
-  \caption at AtBeginDocument{\let\scr at caption\caption}}{}
+  \caption at AtBeginDocument{%
+    \let\caption at original@makecaption\@makecaption}%
+  \g at addto@macro\GOfrench{%
+    \let\@makecaption\caption at original@makecaption}%
 %    \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{macrocode}
-\@nameuse{caption at frenchb}\@nameundef{caption at frenchb}
+}{}
 %    \end{macrocode}
 %
-% \subsection{The frenchle/pro package}
-% \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added}
+% \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{macrocode}
-\caption at AtBeginDocument{\caption at ifdefined\frenchTeXmods{%
-  \caption at InfoNoLine{frenchle/pro package is loaded}%
+\caption at IfBabelHungarian{%
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-  \let\captionfont at ORI\captionfont
-  \let\captionlabelfont at ORI\captionlabelfont
-  \let\@makecaption at 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 at ifdefined\GOfrench
-    {\def\caption at tempa{\g at addto@macro\GOfrench}}%
-    {\let\caption at tempa\@firstofone}%
-  \caption at tempa{%
-%    \end{macrocode}
+% 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\captionfont\captionfont at ORI
-    \let\captionfont at ORI\@undefined
-    \let\captionlabelfont\captionlabelfont at ORI
-    \let\captionlabelfont at ORI\@undefined
-    \let\@makecaption\@makecaption at ORI
-    \let\@makecaption at ORI\@undefined
+  \caption at AtBeginDocument{%
+    \let\caption at original@makecaption\@makecaption}%
+  \caption at ifdefined\extrashungarian{%
+    \addto\extrashungarian{%
+      \let\@makecaption\caption at original@makecaption}}{}%
+  \caption at ifdefined\extrasmagyar{%
+    \addto\extrasmagyar{%
+      \let\@makecaption\caption at original@makecaption}}{}%
 %    \end{macrocode}
 %
-% \begin{macro}{\@cnORI}
-%  We update the definition of |\@cnORI| so it actually reflects
-%  our definition of |\caption|.
 %    \begin{macrocode}
-    \let\@cnORI\caption
+}{}
 %    \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.
-%    \begin{macrocode}
-    \let\caption at tcORI\@tablescaption
-    \def\@tablescaption{\caption at star\relax\caption at tcORI}%
-%    \end{macrocode}
-% \end{macro}
+% \subsection{The latvian babel option}
+% \changes{v3.5}{2020/08/02}{\package{latvian} babel support updated}
 %
-% \begin{macro}{\f at ffrench}
-% \begin{macro}{\f at tfrench}
-%  |\f at ffrench| and |\f at tfrench| reflect |\fnum at figure| and |\fnum at 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 at tempa\@empty
-    \ifx\f at ffrench\fnum at figure
-      \l at addto@macro\caption at tempa{\let\fnum at figure\f at ffrench}%
-    \fi
-    \ifx\f at tfrench\fnum at table
-      \l at addto@macro\caption at tempa{\let\fnum at table\f at tfrench}%
-    \fi
-    \def\f at ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
-    \def\f at tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
-    \caption at tempa
+\caption at IfBabelLatvian{%
 %    \end{macrocode}
-% \end{macro}
-% \end{macro}
 %
+% The \package{latvian} package re-defines |\@make|\-|caption| incompatible to the \package{caption} package,
+% therefore we have to restore our definitions here.
+%
 %    \begin{macrocode}
-  }%
-}{}}
+  \let\@makecaption\caption at makecaption
 %    \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}
-%
 %    \begin{macrocode}
-\def\caption at tempa#1{%
-  \@ifpackagewith{babel}{#1}{%
-    \caption at InfoNoLine{#1 babel option is loaded}%
-    \expandafter\addto\csname extras#1\endcsname{%
-       % reverse changes made by magyar.ldf
-       \let\@makecaption\caption at makecaption
-       \babel at save\@makecaption
-       \caption at redefine
-       \babel at save\@caption}%
-  }{}}
+}{}
 %    \end{macrocode}
-%    \begin{macrocode}
-\caption at tempa{hungarian}%
-\caption at 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 at 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 at ifpackage}
-%        to \cs{caption at 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 at ifpackage} to \cs{caption at IfPackageLoaded}}
 % \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
 %  |\caption at 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 at test@adjustwidth}
+  \AtBeginCaption{\caption at test@adjustwidth}%
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2633,7 +2380,7 @@
 % \begin{macro}{\float at 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 at makebox| (only if we are not operating in compatibility mode).
+% Redefine |\float at makebox| (only if we are not operating in compatibility mode `v1').
 %    \begin{macrocode}
   \caption at AtBeginDocument{\caption at ifcompatibility{}{%
 %    \end{macrocode}
@@ -2673,8 +2420,7 @@
 %    \begin{macrocode}
   \newcommand*\caption at 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 at MakeCaption| so the original stuff is nested with
+%  |\lst at Make|\-|Caption| so the original stuff is nested with
 %  |\caption at begin| and |\caption at end| etc.\par
-%  Unfortunately |\lst at 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 at MakeCaption| inside a parbox of correct width.)
-%
-% The \package{listings} package calls |\lst at 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 at setbool{lst at Init}{0}%
   \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
@@ -3332,28 +3069,8 @@
 %    \begin{macrocode}
     \begingroup
 %    \end{macrocode}
-%    \begin{macrocode}
-%%    \caption at Debug{%
-%%      linewidth=\lst at linewidth,
-%%      xleftmargin=\lst at xleftmargin,\MessageBreak
-%%      xrightmargin=\lst at xrightmargin,
-%%      resetmargins=\lst at 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 at iflst@Init{}{%
-%%      \linewidth\lst at linewidth\relax
-%%      \lst at ifresetmargins
-%%        \advance\linewidth\@totalleftmargin
-%%        \advance\linewidth\rightmargin
-%%        \@totalleftmargin\z@
-%%      \fi
-%%      \advance\linewidth-\lst at xleftmargin
-%%      \advance\linewidth-\lst at xrightmargin
-%%      \advance\@totalleftmargin\lst at 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 at 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 at 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 at iflst@Init{}{%
@@ -3432,7 +3149,16 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at AtBeginLongtable}
+% \changes{v3.5}{2018/04/15}{This macro added}
 %    \begin{macrocode}
+\providecommand*\caption at LT@array{}
+\newcommand\caption at AtBeginLongtable{%
+  \g at addto@macro\caption at LT@array}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 \caption at IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -3442,85 +3168,81 @@
 %
 % \begin{macro}{\LT at 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 at array| here to get |\captionsetup|\marg{options}
-% working inside |longtable|s.
+% \changes{v3.5}{2018/04/15}{Usage of \cs{caption at AtBeginLongtable} added}
+% We redefine |\LT at array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
 % \Note{Since the \package{hyperref} package patches \cs{LT at array} as well
 %  and since this only works with the original definition of \cs{LT at 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 at AtBeginDocument{%
     \let\caption at ORI@LT at array\LT at array
     \renewcommand*\LT at array{%
+      \caption at LT@array
+      \caption at ORI@LT at array}}%
 %    \end{macrocode}
+%    \begin{macrocode}
+  \caption at AtBeginLongtable{%
 % |\captionsetup| for longtable:
 %    \begin{macrocode}
-      \global\let\caption at opt@@longtable\@undefined
-      \def\captionsetup{%
-        \noalign\bgroup
-        \@ifstar\@captionsetup\@captionsetup}% gobble *
-      \def\@captionsetup##1{\LT at captionsetup{##1}\egroup}%
-      \def\LT at captionsetup##1{%
-        \captionsetup at startrue\caption at setup@options[@longtable]{##1}%
-        \global\let\caption at opt@@longtable\caption at opt@@longtable}%
+    \global\let\caption at opt@@longtable\@undefined
+    \def\captionsetup{%
+      \noalign\bgroup
+      \@ifstar\@captionsetup\@captionsetup}% gobble *
+    \def\@captionsetup#1{\LT at captionsetup{#1}\egroup}%
+    \def\LT at captionsetup#1{%
+      \captionsetup at startrue\caption at setup@options[@longtable]{#1}%
+      \global\let\caption at opt@@longtable\caption at opt@@longtable}%
 %    \end{macrocode}
-% |\captionabove| \& |\captionbelow| for longtable: (\KOMAScript\ document class)
-%    \begin{macrocode}
-      \def\@captionabovetrue{\LT at captionsetup{position=t}}%
-      \def\@captionabovefalse{\LT at captionsetup{position=b}}%
-%    \end{macrocode}
 % |\captionlistentry| for longtable:
 %    \begin{macrocode}
-      \def\captionlistentry{%
-        \noalign\bgroup
-        \@ifstar{\egroup\LT at listentry\LTcaptype}% gobble *
-                {\egroup\LT at listentry\LTcaptype}}%
+    \def\captionlistentry{%
+      \noalign\bgroup
+      \@ifstar{\egroup\LT at listentry\LTcaptype}% gobble *
+              {\egroup\LT at 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 at makecurrent}}
 %    \begin{macrocode}
-%     \caption at ifhypcap{%
-%       \let\caption at ORI@hyper at makecurrent\hyper at makecurrent
-%       \def\hyper at makecurrent##1{%
-%         \let\hyper at makecurrent\caption at ORI@hyper at makecurrent
-%         \caption at makestart{##1}%
-%%        \let\Hy at LT@currentHlabel\@currentHlabel
-%         \let\Hy at LT@currentHref\@currentHref
-%         \def\hyper at makecurrent####1{%
-%%          \let\@currentHlabel\Hy at LT@currentHlabel
-%           \let\@currentHref\Hy at LT@currentHref}}%
-%       \let\caption at ORI@continuedfloat\continuedfloat
-%       \def\continuedfloat{\noalign{%
-%         \gdef\caption at setContinuedFloat{%
-%           \let\caption at reset@continuedfloat\@gobble}%
-%         \def\caption at setoptions####1{%
-%           \g at addto@macro\caption at setContinuedFloat{%
-%             \caption at setoptions{####1}}}%
-%         \let\@captype\LTcaptype
-%         \caption at ORI@ContinuedFloat}}%
-%     }{%
-%       \def\continuedfloat{\noalign{%
-%         \caption at Error{%
-%           \noexpand\continuedfloat inside longtables\MessageBreak
-%           is only available with `hypcap=true'}}}%
-%     }%
-%     \global\let\caption at setContinuedFloat\@empty
-      \def\continuedfloat{\noalign{%
-        \caption at Error{\noexpand\continuedfloat outside float}}}%
+%   \caption at ifhypcap{%
+%     \let\caption at ORI@hyper at makecurrent\hyper at makecurrent
+%     \def\hyper at makecurrent##1{%
+%       \let\hyper at makecurrent\caption at ORI@hyper at makecurrent
+%       \caption at makestart{##1}%
+%%      \let\Hy at LT@currentHlabel\@currentHlabel
+%       \let\Hy at LT@currentHref\@currentHref
+%       \def\hyper at makecurrent####1{%
+%%        \let\@currentHlabel\Hy at LT@currentHlabel
+%         \let\@currentHref\Hy at LT@currentHref}}%
+%     \let\caption at ORI@continuedfloat\continuedfloat
+%     \def\continuedfloat{\noalign{%
+%       \gdef\caption at setContinuedFloat{%
+%         \let\caption at reset@continuedfloat\@gobble}%
+%       \def\caption at setoptions##1{%
+%         \g at addto@macro\caption at setContinuedFloat{%
+%           \caption at setoptions{##1}}}%
+%       \let\@captype\LTcaptype
+%       \caption at ORI@ContinuedFloat}}%
+%   }{%
+%     \def\continuedfloat{\noalign{%
+%       \caption at Error{%
+%         \noexpand\continuedfloat inside longtables\MessageBreak
+%         is only available with `hypcap=true'}}}%
+%   }%
+%   \global\let\caption at setContinuedFloat\@empty
+    \def\continuedfloat{\noalign{%
+      \caption at Error{\noexpand\continuedfloat outside float}}}%
 %    \end{macrocode}
 % |\bicaption| for longtable:
 %    \begin{macrocode}
-      \let\bicaption\LT at bicaption
+    \let\bicaption\LT at bicaption
 %    \end{macrocode}
-%
 %    \begin{macrocode}
-      \caption at ORI@LT at array}}%
+  }%
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3543,10 +3265,8 @@
 % \end{macro}
 %
 % \begin{macro}{\LT at 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 at LT@make} introduced}
 % \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption at LT@setup} added}
 % \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
@@ -3573,19 +3293,16 @@
     \caption at LT@make{%
       \caption at LT@settype\LTcaptype
 %    \end{macrocode}
-%
 % |\caption at LT@setup| is re-defined inside the \package{bicaption} package
 % and contains the preparation of typesetting of the bilingual caption.
 %    \begin{macrocode}
       \caption at 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 at setautoposition{\ifcase\LT at rows t\else b\fi}%
 %    \end{macrocode}
-%
 %  We set |\ifcaption at star| according the 1st argument.
 %    \begin{macrocode}
       \caption at startrue#1\caption at starfalse
 %    \end{macrocode}
-%
 %    \begin{macrocode}
       \caption at prepare@stepcounter\LTcaptype{LT}%
 %    \end{macrocode}
-%
-% \changes{v3.1}{2007/05/05}{\cs{caption at normalsize} added}
+% \changes{v3.1}{2007/05/05}{\cs{caption at font@normal} added}
 %    \begin{macrocode}
       \caption at begin\LTcaptype
         \caption at 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 at ifdefined\FBifcaptop{%
           \let\caption at 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 at AtBeginLongtable\@gobble
+  \let\caption at LT@array\@undefined
+}
 %    \end{macrocode}
 %
 % \begin{macro}{\caption at LT@setup}
@@ -4068,7 +3782,7 @@
     \def\caption at setSC@justify{%
       \caption at clearmargin
         \ifx\SC at justify\@empty \else
-          \let\caption at hj\SC at justify
+          \let\caption at justification\SC at justify
           \let\SC at 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 at fixposition{%
-      \caption at setposition{\if at topcaption t\else b\fi}}%
+    \caption at setposition{\if at topcaption t\else b\fi}%
 %    \end{macrocode}
 %    \begin{macrocode}
     \caption at beginex{#1}{#2}{#3}%
@@ -4258,8 +3971,7 @@
     \caption at setoptions{xtabular}%
 %    \end{macrocode}
 %    \begin{macrocode}
-    \def\caption at fixposition{%
-      \caption at setposition{\if at topcaption t\else b\fi}}%
+    \caption at set{position}{\if at topcaption t\else b\fi}%
 %    \end{macrocode}
 %    \begin{macrocode}
     \@initisotab
@@ -4292,7 +4004,7 @@
   \let\caption at ORI@threeparttable\threeparttable
   \renewcommand*\threeparttable{%
     \caption at settype{\@ifundefined{@captype}{table}{\@captype}}%
-%%% \caption at setposition a% ?
+%%% \caption at setposition{auto}% ?
     \caption at clearmargin
     \caption at setoptions{threeparttable}%
     \caption at ORI@threeparttable}%
@@ -4305,7 +4017,7 @@
   \let\caption at ORI@measuredfigure\measuredfigure
   \renewcommand*\measuredfigure{%
     \caption at settype{\@ifundefined{@captype}{figure}{\@captype}}%
-%%% \caption at setposition a% ?
+%%% \caption at setposition{auto}% ?
     \caption at clearmargin
     \caption at setoptions{measuredfigure}%
     \caption at 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}%

Modified: trunk/Master/texmf-dist/source/latex/caption/caption.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.ins	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.ins	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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.
 
@@ -36,19 +40,26 @@
 \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'}

Modified: trunk/Master/texmf-dist/source/latex/caption/caption2.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption2.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption2.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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.
 % 

Modified: trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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,6 +73,9 @@
 %</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}}
@@ -80,22 +82,22 @@
 % \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)]
+\ProvidesPackage{caption3}[2020/08/30 v2.0 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 at FixArabTeX{%
-  \def\caption at tempa##1{}%
-  \ifx\caption at 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 at FixArabTeX
-\AtBeginDocument{%
-  \caption at FixArabTeX
-  \let\caption at FixArabTeX\@undefined}
-%    \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 at addto@macro}
 % \changes{v1.5}{2013/04/26}{Revised}
-%  The \LaTeXe\ kernel offers the internal helper macro |\g at addto@macro| which
-%  globally adds tokens to existing macros, like in |\AtBeginDocument|.
-%  This is the same but it works local, not global.
+% \changes{v2.0}{2019/09/11}{Relies on \eTeX{} now}
+%   |\l at addto@macro|\marg{command}\marg{code}\\
+%   The \LaTeXe\ kernel offers the internal helper macro |\g at 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}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname currentgrouplevel\endcsname\relax
-  \PackageInfo{caption3}{TeX engine: TeX}
-  \let\caption at ifeTeX\@secondoftwo
-  \providecommand\l at addto@macro[2]{%
-    \begingroup
-      \toks@\expandafter{#1#2}%
-      \xdef\caption at addto@temp{\the\toks@}%
-    \endgroup
-    \let#1\caption at addto@temp}
-\else
-  \PackageInfo{caption3}{TeX engine: e-TeX}
-  \let\caption at ifeTeX\@firstoftwo
-  \providecommand\l at addto@macro[2]{%
-    \edef#1{\unexpanded\expandafter{#1#2}}}
-\fi
+\providecommand\l at 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 at edef\caption at tempa{#1}%
@@ -279,44 +249,53 @@
 % \begin{macro}{\caption at 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 at 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 at ifundefined[1]{%
-  \ifx#1\@undefined
+  \ifdefined#1%
+    \ifx#1\relax
+      \expandafter\expandafter\expandafter\@firstoftwo
+    \else
+      \expandafter\expandafter\expandafter\@secondoftwo
+    \fi
+  \else
     \expandafter\@firstoftwo
-  \else\ifx#1\relax
-    \expandafter\expandafter\expandafter\@firstoftwo
-  \else
-    \expandafter\expandafter\expandafter\@secondoftwo
-  \fi\fi}
+  \fi}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at 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 at 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 at ifdefined[1]{%
-  \ifx#1\@undefined
+  \ifdefined#1%
+    \ifx#1\relax
+      \expandafter\expandafter\expandafter\@secondoftwo
+    \else
+      \expandafter\expandafter\expandafter\@firstoftwo
+    \fi
+  \else
     \expandafter\@secondoftwo
-  \else\ifx#1\relax
-    \expandafter\expandafter\expandafter\@secondoftwo
-  \else
-    \expandafter\expandafter\expandafter\@firstoftwo
-  \fi\fi}
+  \fi}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at 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 at ifinlist{frank}{axel,frank,olga,steven}{yes}{no}|
-%  \end{quote}
-%  would expand to |yes|.
+%   |\caption at 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 at 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 at ifinlist{%
   \@expandtwoargs\caption@@ifinlist}
@@ -337,7 +316,9 @@
 %
 % \begin{macro}{\caption at ifin@list}
 % \changes{v1.1}{2007/08/12}{This macro added}
-% |\caption at ifin@list|\marg{cmd}\marg{list entry}\marg{yes}\marg{no}
+%   |\caption at ifin@list|\marg{cmd}\marg{element}\marg{yes-code}\marg{no-code}\\
+%   is the same as |\caption at ifinlist| but with a command (containing a list)
+%   instead of the list itself.
 %    \begin{macrocode}
 \newcommand*\caption at ifin@list[2]{%
   \caption at ifempty@list#1%
@@ -348,7 +329,9 @@
 %
 % \begin{macro}{\caption at g@addto at list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at g@addto at list|\marg{cmd}\marg{list entry}
+%   |\caption at g@addto at 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 at g@addto at list[2]{%
   \caption at ifempty@list#1{\gdef#1{#2}}{\g at addto@macro#1{,#2}}}
@@ -356,7 +339,8 @@
 % \end{macro}
 % \begin{macro}{\caption at l@addto at list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at l@addto at list|\marg{cmd}\marg{list entry}
+%   |\caption at l@addto at list|\marg{cmd}\marg{element}\\
+%   is the same as |\caption at g@addto at list| but works locally.
 %    \begin{macrocode}
 \newcommand*\caption at l@addto at list[2]{%
   \caption at ifempty@list#1{\def#1{#2}}{\l at addto@macro#1{,#2}}}
@@ -365,7 +349,10 @@
 %
 % \begin{macro}{\caption at g@removefrom at list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at g@removefrom at list|\marg{cmd}\marg{list entry}
+%   |\caption at g@removefrom at 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 at g@removefrom at list[2]{%
   \caption at l@removefrom at list#1{#2}%
@@ -374,9 +361,10 @@
 % \end{macro}
 % \begin{macro}{\caption at l@removefrom at list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at l@removefrom at 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 at l@removefrom at list|\marg{cmd}\marg{element}\\
+%   is the same as |\caption at g@removefrom at 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 at l@removefrom at list[2]{%
   \caption at ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
@@ -385,19 +373,22 @@
 %
 % \begin{macro}{\caption at for@list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at for@list|\marg{cmd}\marg{code with \#1}
+%   |\caption at 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 at for@list[2]{%
-  \caption at ifempty@list#1{}{%
-    \def\caption at tempb##1{#2}%
-    \@for\caption at tempa:=#1\do{%
-      \expandafter\caption at tempb\expandafter{\caption at tempa}}}}
+  \caption at ifempty@list#1{}%
+    {\def\caption at tempb##1{#2}%
+     \@for\caption at tempa:=#1\do{%
+       \expandafter\caption at tempb\expandafter{\caption at tempa}}}}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at ifempty@list}
 % \changes{v1.1}{2007/07/29}{This macro added}
-% |\caption at ifempty@list|\marg{cmd}\marg{true}\marg{false}
+%   |\caption at 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 at ifempty@list[1]{%
   \ifx#1\@undefined
@@ -416,17 +407,17 @@
 %
 % \pagebreak[3]
 % \begin{macro}{\caption at setbool}
-% \begin{macro}{\caption at set@bool}
 % \changes{v1.1}{2007/04/05}{\cs{caption at set@bool}\marg{cmd}\marg{value} added}
 % \begin{macro}{\caption at ifbool}
+% \changes{v1.1}{2020/08/02}{\cs{caption at if@bool}\marg{value} added}
 % \begin{macro}{\caption at undefbool}
-%  For setting and testing boolean options we offer these three helper macros:
-%  \begin{quote}
-%  |\caption at setbool|\marg{name}\marg{value}\\
-%  |                |(with |value = false/true/no/yes/off/on/0/1|)\\
-%  |\caption at ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
-%  |\caption at undefbool|\marg{name}
-%  \end{quote}
+%   For setting and testing boolean options we offer these three helper macros:
+%   \begin{quote}
+%   |\caption at setbool|\marg{name}\marg{value}\\
+%   |                |(with |value = false/true/no/yes/off/on/0/1|)\\
+%   |\caption at ifbool|\marg{name}\marg{if-clause}\marg{else-clause}\\
+%   |\caption at undefbool|\marg{name}
+%   \end{quote}
 %    \begin{macrocode}
 \newcommand*\caption at setbool[1]{%
   \expandafter\caption at set@bool\csname caption at if#1\endcsname}
@@ -433,15 +424,18 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption at set@bool[2]{%
-  \caption at ifinlist{#2}{1,true,yes,on}{%
-    \let#1\@firstoftwo
-  }{\caption at ifinlist{#2}{0,false,no,off}{%
-    \let#1\@secondoftwo
-  }{%
-    \caption at Error{Undefined boolean value `#2'}%
-  }}}
+  \caption at if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
 %    \end{macrocode}
 %    \begin{macrocode}
+\newcommand*\caption at if@bool[1]{%
+  \caption at ifinlist{#1}{1,true,yes,on}%
+    {\@firstoftwo}%
+    {\caption at ifinlist{#1}{0,false,no,off}%
+       {}%
+       {\caption at Error{Undefined boolean value `#1'}}%
+     \@secondoftwo}}
+%    \end{macrocode}
+%    \begin{macrocode}
 \newcommand*\caption at ifbool[1]{\@nameuse{caption at if#1}}
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -450,15 +444,18 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\caption at teststar}
 % \changes{v1.1}{2007/05/08}{This macro and its usage added}
 % \changes{v1.1e}{2007/10/28}{\cs{caption at teststar@} added}
-%  |\caption at teststar|\marg{cmd}\marg{star arg}\marg{non-star arg}\\
-%  |\caption at teststar@|\marg{cmd}\marg{star arg}\marg{non-star arg}
+%   |\caption at 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 at teststar@|\marg{cmd}\marg{star-arg}\marg{non-star-arg}\\
+%   will test the catcode of the character \@ additionally.
 %    \begin{macrocode}
-\newcommand*\caption at teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+\newcommand*\caption at teststar[3]{%
+  \@ifstar{#1{#2}}{#1{#3}}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption at teststar@[3]{%
@@ -465,6 +462,13 @@
   \@ifstar{#1{#2}}{\caption at ifatletter{#1{#2}}{#1{#3}}}}
 \AtBeginDocument{\let\caption at teststar@\caption at teststar}
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at ifatletter}
+% \changes{v1.1e}{2007/10/28}{This macro added}
+%   |\caption at 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 at ifatletter{%
   \ifnum\the\catcode`\@=11
@@ -472,6 +476,8 @@
   \else
     \expandafter\@secondoftwo
   \fi}
+%    \end{macrocode}
+%    \begin{macrocode}
 \AtBeginDocument{\let\caption at ifatletter\@secondoftwo}
 %    \end{macrocode}
 % \end{macro}
@@ -479,7 +485,9 @@
 % \begin{macro}{\caption at withoptargs}
 % \changes{v1.1}{2007/08/12}{This macro added}
 % \changes{v1.5}{2012/04/09}{This macro revised}
-%  |\caption at withoptargs|\marg{cmd}
+%   |\caption at 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 at withoptargs[1]{%
   \@ifstar
@@ -506,8 +514,8 @@
 %
 % \begin{macro}{\caption at gobble}
 % \changes{v1.4}{2011/08/19}{This macro added}
-%  |\caption at gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par
-% Same as |\@gobble|, but gobbles optional arguments as well.
+%   |\caption at gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\\
+%   is similar to |\@gobble| but gobbles a star and optional arguments as well.
 %    \begin{macrocode}
 \DeclareRobustCommand*\caption at gobble{%
   \caption at withoptargs\@gobbletwo}
@@ -517,11 +525,11 @@
 % \begin{macro}{\caption at 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 at 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 at 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 at begindocumenthook\@empty
 \let\caption@@begindocumenthook\@empty
@@ -557,7 +565,8 @@
 %
 % \begin{macro}{\caption at Info}
 % \changes{v1.3}{2010/10/25}{Moved from package to kernel}
-%  |\caption at Info|\marg{message}
+%   |\caption at Info|\marg{message}\\
+%   issues an info message (with code line indication).
 %    \begin{macrocode}
 \newcommand*\caption at Info[1]{%
   \PackageInfo{caption}{#1}}
@@ -565,10 +574,11 @@
 % \end{macro}
 % \begin{macro}{\caption at InfoNoLine}
 % \changes{v1.3}{2010/10/25}{Moved from package to kernel}
-%  |\caption at 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 at 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 at InfoNoLine[1]{%
   \caption at Info{#1\@gobble}}
@@ -577,7 +587,8 @@
 %
 % \begin{macro}{\caption at Warning}
 % \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
-%  |\caption at Warning|\marg{message}
+%   |\caption at Warning|\marg{message}\\
+%   issues a warning message (with code line indication).
 %    \begin{macrocode}
 \newcommand*\caption at Warning[1]{%
   \caption at WarningNoLine{#1\on at line}}
@@ -585,7 +596,8 @@
 % \end{macro}
 % \begin{macro}{\caption at WarningNoLine}
 % \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings}
-%  |\caption at WarningNoLine|\marg{message}
+%   |\caption at WarningNoLine|\marg{message}\\
+%   issues a warning message without code line indication.
 %    \begin{macrocode}
 \newcommand*\caption at WarningNoLine[1]{%
   \PackageWarning{caption}{#1.^^J\caption at 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 at error} to \cs{caption at Error}}
 % \changes{v1.1b}{2007/09/18}{Usage of \cs{caption at Package} removed}
-%  |\caption at Error|\marg{message}
+%   |\caption at Error|\marg{message}\\
+%   issues an error message (with code line indication).
 %    \begin{macrocode}
 \newcommand*\caption at Error[1]{%
   \PackageError{caption}{#1}\caption at eh}
@@ -615,6 +628,9 @@
 %
 % \begin{macro}{\caption at KV@err}
 % \changes{v1.1b}{2007/09/18}{This macro added}
+%   |\caption at KV@err|\marg{message}\\
+%   will be used to issue an error while parsing the key-value (package)
+%   options.
 %    \begin{macrocode}
 \let\caption at KV@err\caption at 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 at key}
-% |\undefine at key|\marg{family}\marg{key}\par
-% This helper macro is the opposite of |\define at key|, it removes a keyval
-% definition.
+%   |\undefine at key|\marg{family}\marg{key}\\
+%   is the opposite of |\define at key|, it removes a keyval definition.
 %    \begin{macrocode}
 \providecommand*\undefine at key[2]{%
   \@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2 at default}}
@@ -640,8 +656,9 @@
 % \begin{macro}{\@onlypreamble at key}
 % \changes{v1.1}{2007/07/22}{This macro added}
 % \changes{v1.1e}{2007/11/01}{\cs{KV at err} will be used now instead of \cs{@notprerr}}
-%  |\onlypreamble at key|\marg{family}\marg{key}\par
-%  Analogous to |\@onlypreamble| from \LaTeXe.
+%   |\onlypreamble at 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 at keys{}
 \providecommand*\@onlypreamble at key[2]{\@cons\@preamble at 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 at teststar\caption at declareoption\AtEndOfPackage\@gobble}
@@ -680,15 +696,15 @@
 %    \begin{macrocode}
 \newcommand*\caption at declare@option{%
   \define at key{caption}}
-%% no \@onlypreamble\caption at declare@option, will be used by \captionsetup
+%% no \@onlypreamble\caption at 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 at teststar\caption at declareoption@novalue\AtEndOfPackage\@gobble}
@@ -713,8 +729,8 @@
 %
 % \begin{macro}{\ifcaptionsetup at 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 at 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 at set|\-|keys|.)
 %    \begin{macrocode}
 \newif\ifcaptionsetup at star
 %    \end{macrocode}
@@ -728,13 +744,13 @@
 % \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup at 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 at teststar@\@captionsetup\@gobble\@firstofone}
@@ -773,7 +789,8 @@
 %
 % \begin{macro}{\caption at checkoptions}
 % \changes{v1.8h}{2020/01/03}{This macro added}
-% Check the syntax of the given options by executing them inside a group.
+%   |\caption at checkoptions|\marg{keyval-list of options}\\
+%   checks the syntax of the given options by executing them inside a group.
 %    \begin{macrocode}
 \newcommand*\caption at 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 at 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 at iftypewarning} removed}
 % \changes{v1.3}{2010/09/05}{Starred variant added}
 % \changes{v1.4b}{2012/01/12}{Starred variant removed}
-%  |\caption at 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 at 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 at setoptions[1]{%
   \caption at Debug{options=#1}%
@@ -928,19 +940,19 @@
 % \begin{macro}{\caption at removefromoptlist}
 % \changes{v1.1}{2007/07/22}{This macro added}
 % \changes{v1.2c}{2008/08/24}{Fatal typo corrected}
-% |\caption at addtooptlist|\marg{type}\\
-% |\caption at 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 at getstyle| gives a result which tokens have catcode
-%  12 $=$ ``other'').
+%   |\caption at addtooptlist|\marg{type}\\
+%   |\caption at 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 at getstyle| gives a result which tokens have catcode
+%   12 $=$ ``other'').
 %    \begin{macrocode}
 \newcommand*\caption at addtooptlist[1]{%
-  \@ifundefined{caption at opt@#1 at lineno}{%
-    \caption at dooptlist\caption at g@addto at list{#1}%
-    \expandafter\xdef\csname caption at opt@#1 at lineno\endcsname{\the\inputlineno}%
-  }{}}
+  \@ifundefined{caption at opt@#1 at lineno}%
+    {\caption at dooptlist\caption at g@addto at list{#1}%
+     \expandafter\xdef\csname caption at opt@#1 at lineno\endcsname{\the\inputlineno}}%
+    {}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption at removefromoptlist[1]{%
@@ -956,10 +968,10 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \AtEndDocument{%
-  \caption at for@list\caption at optlist{%
-    \caption at WarningNoLine{%
-      Unused \string\captionsetup[#1]
-      on input line \csname caption at opt@#1 at lineno\endcsname}}}
+  \caption at for@list\caption at optlist
+    {\caption at WarningNoLine{%
+       Unused \string\captionsetup[#1]
+       on input line \csname caption at opt@#1 at lineno\endcsname}}}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -974,10 +986,10 @@
 % \changes{v1.2a}{2008/01/12}{\cs{captionsetup at 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 at err} added}
-%  |\caption at 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 at 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 at setkeys{\@dblarg\caption@@setkeys}
 %    \end{macrocode}
@@ -1001,7 +1013,7 @@
   \def\XKV at err{\let\@tempa\XKV at tkey\KV at err}%
 %    \end{macrocode}
 %    \begin{macrocode}
-  \caption at Debug{\protect\setkeys{#2}{#3}}%
+  \caption at Debug{\noexpand\setkeys{#2}{#3}}%
   \setkeys{#2}{#3}%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -1024,9 +1036,9 @@
 % \begin{macro}{\caption at ExecuteOptions}
 % \changes{v1.1}{2007/07/15}{This macro added}
 % \changes{v1.3}{2010/09/04}{Depends on package now}
-%  |\caption at 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 at 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 at ExecuteOptions[2]{%
   \expandafter\@expandtwoargs\csname caption at setkeys@#1\endcsname{#1}{#2}}%
@@ -1035,21 +1047,17 @@
 % \end{macro}
 %
 % \begin{macro}{\caption at ProcessOptions}
-% \changes{v1.0a}{2004/01/23}{Bugfix, see
-%        \purett{news:400D360C.9678329F at gmx.net} for details}
-% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption at 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 at ProcessOptions} and moved from the package to the kernel}
-% \changes{v1.1}{2007/04/17}{Star variant added}
-%  |\caption at 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 at gmx.net} for details}
+% \changes{v1.0g}{2006/01/03}{Improvement, uses \cs{caption at 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 at ProcessOptions} and moved from the package to the kernel}
+% \changes{v1.1}{2007/04/17}{Starred variant added}
+%   |\caption at 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 at ProcessOptions{%
   \caption at teststar\caption@@ProcessOptions\@gobble\@firstofone}
@@ -1082,11 +1090,11 @@
 %
 % \begin{macro}{\caption at SetupOptions}
 % \changes{v1.3}{2010/09/04}{This macro added}
-%  |\caption at SetupOptions|\marg{package}\marg{code}\par
-%  After calling this macro |\caption at 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 at SetupOptions|\marg{package}\marg{code}\\
+%   After application of this command |\caption at 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 at SetupOptions[2]{%
   \@namedef{caption at setkeys@#1}##1##2{#2}%
@@ -1120,6 +1128,263 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \section{Declaring and setting key values}
+%
+% \begin{macro}{\caption at decl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+%   |\caption at 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 at decl[3][\def]{%
+  \global\long\expandafter#1\csname caption@#2@#3\endcsname}
+\@onlypreamble\caption at decl
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at ifdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+%   |\caption at 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 at ifdecl[2]{%
+  \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at checkdecl}
+% \changes{v2.0}{2019/09/10}{This macro added}
+%   |\caption at checkdecl|\marg{option}\marg{name}\marg{yes-code}\\
+%   behaves similar to |\caption at if|\-|decl| but issues an error message if the
+%   given \meta{option} plus \meta{name} is not defined.
+%    \begin{macrocode}
+\newcommand*\caption at checkdecl[2]{%
+  \caption at ifdecl{#1}{#2}%
+    \@firstofone
+    {\caption at Error{Undefined #1 `#2'}%
+     \@gobble}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at 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 at 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 at decl|) will effect the outcome,
+%   for example |\caption at 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 at set|).
+%    \begin{macrocode}
+\newcommand*\caption at set{%
+  \caption at maparg\caption@@set}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption@@set[3]{%
+  \caption at 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 at set|\-|default at length| for
+%   details.)
+%    \begin{macrocode}
+\newcommand*\SetCaptionDefault{%
+  \caption at teststar\caption at setdefault\def\edef}
+\@onlypreamble\SetCaptionDefault
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at setdefault[2]{%
+  \@ifundefined{caption at setdefault@#2}%
+    {\caption at maparg\caption@@setdefault}%
+    {\@nameuse{caption at setdefault@#2}{#1}}%
+  {#2}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption@@setdefault[3]{%
+  \caption at ifdefault{#3}%
+    {\caption at Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
+    {\caption@@set{#1}{#2 at default}{#3}}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at ifdefault}
+% \changes{v2.0}{2020/08/23}{This macro added}
+%   |\caption at 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 at ifdefault[1]{%
+  \edef\caption at tempa{#1}%
+  \def\caption at tempb{default}%
+  \ifx\caption at tempa\caption at tempb
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at setmapping}
+% \changes{v2.0}{2020/08/23}{This macro added}
+%   |\caption at 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 at setmapping[2]{%
+  \@namedef{caption at map@#1}{#2}}
+\@onlypreamble\caption at setmapping
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at maparg}
+% \changes{v2.0}{2020/08/23}{This macro added}
+%   |\caption at 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 at set|\-|mapping|).
+%    \begin{macrocode}
+\newcommand*\caption at maparg[2]{%
+  \@ifundefined{caption at map@#2}%
+    {#1{#2}}%
+    {#1{\csname caption at map@#2\endcsname}}%
+  {#2}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at switchdefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+%   |\caption at 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 at switchdefault{labelfont}{\babel at save #1}{sc}|\end{quote}
+%    \begin{macrocode}
+\def\caption at switchdefault#1#2{%
+  \def\caption at tempa##1{#2}%
+  \expandafter\caption at tempa\csname caption@#1 at default\endcsname
+  \caption at setdefault\def{#1}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at restoredefault}
+% \changes{v2.0}{2020/08/01}{This macro added}
+%   |\caption at restoredefault\marg{option}|\marg{command}\\
+%   restores a default setting which was stored to \meta{command} before
+%   (via |\caption at switch|\-|default|).
+%    \begin{macrocode}
+\def\caption at restoredefault#1#2{%
+  \caption at checkdecl{#1}{default}{%
+    \caption at ifdefined#2{%
+      \expandafter\let\csname caption@#1 at default\endcsname#2%
+      \let#2\@undefined}{}}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at decl@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+%   |\caption at 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 at decl@package[2]{%
+  \@ifnextchar[%]
+    {\caption at declare@package{#1}{#2}}%
+    {\caption at declarepackage{#1}{#2}}}
+\@onlypreamble\caption at decl@package
+%    \end{macrocode}
+%    \begin{macrocode}
+\def\caption at declare@package#1#2[#3]#4{%
+  \global\@namedef{caption@#1@#4 at package}{#3}%
+  #2{#4}}
+\@onlypreamble\caption at declare@package
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at declarepackage[3]{%
+  \global\@nameundef{caption@#1@#3 at package}%
+  #2{#3}}
+\@onlypreamble\caption at declarepackage
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at load@package}
+% \changes{v2.0}{2020/07/26}{This macro added}
+%   |\caption at load@package|\marg{option}\marg{value}\\
+%   If the given option value needs a package, it will be loaded automatically.
+%    \begin{macrocode}
+\newcommand*\caption at load@package[2]{%
+  \expandafter\let\expandafter\caption at tempa\csname caption@#1@#2 at package\endcsname
+  \caption at ifdefined\caption at tempa
+    {\caption at requirepackage\caption at 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 at set|\-|default| so
+%           |\caption at set|\-|default at 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 at setdefault@#1}##1{%
+    \caption at setdefault@length{##1}}%
+  \SetCaptionDefault*{#1}}
+\@onlypreamble\DeclareCaptionLength
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at setdefault@length}
+% \changes{v2.0}{2020/08/09}{This macro added}
+%   |\caption at 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 at setdefault@length[3]{%
+  \expandafter#1\csname caption#2 at default\endcsname{#3}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at setlength}
+% \changes{v2.0}{2020/08/09}{This macro added}
+%   |\caption at 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 at setlength[2]{%
+  \caption at ifdefault{#2}%
+    {\expandafter\let\expandafter\caption at tempa\csname caption#1 at default\endcsname}%
+    {\def\caption at tempa{#2}}%
+  \expandafter\setlength\csname caption#1\endcsname\caption at 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@|.
+%   |\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}
-\newdimen\captionmargin
-\newdimen\captionmargin@
-\newdimen\captionwidth
+\DeclareCaptionLength{margin}{0pt}
+\DeclareCaptionLength{margin@}{\the\captionmargin}
+\DeclareCaptionLength{width}{0pt}
 \newdimen\caption at tempdima
 %    \end{macrocode}
 % \end{macro}
@@ -1159,6 +1424,7 @@
 %    \begin{macrocode}
 \DeclareCaptionOption{twoside}[1]{\caption at set@bool\caption at iftwoside{#1}}
 \DeclareCaptionOptionNoValue{oneside}{\caption at set@bool\caption at iftwoside0}
+\caption at set@bool\caption at iftwoside{\if at twoside 1\else 0\fi}
 %    \end{macrocode}
 %    \begin{macrocode}
 \DeclareCaptionOption{minmargin}{\caption at setoptcmd\caption at minmargin{#1}}
@@ -1167,17 +1433,14 @@
 %
 % \begin{macro}{\setcaptionmargin}
 % \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption at 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 at resetcalcmargin
@@ -1194,8 +1457,8 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \def\caption@@@setmargin#1,#2,#3\@nil{%
-  \setlength\captionmargin@{#2}%
-  \setlength\captionmargin{#1}%
+  \caption at setlength{margin}{#1}%
+  \caption at setlength{margin@}{#2}%
   \addtolength\captionmargin@{-\captionmargin}}
 %    \end{macrocode}
 % \end{macro}
@@ -1204,10 +1467,10 @@
 % \changes{v1.0f}{2005/10/24}{Renamed from \cs{caption at 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 at resetcalcmargin
@@ -1220,20 +1483,16 @@
 %    \begin{macrocode}
 \newcommand*\caption@@setwidth[2]{%
   #1{\captionmargin\z@\captionmargin@\z@}%
-  \setlength\captionwidth{#2}}%
+  \caption at setlength{width}{#2}}%
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at resetcalcmargin}
-% \changes{v1.3}{2010/11/07}{This macro added}
-%    \begin{macrocode}
-\newcommand*\caption at resetcalcmargin{%
-  \let\caption at calcmargin@hook\@empty}
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}{\caption at setcalcmargin}
 % \changes{v1.3}{2010/11/07}{This macro added}
+%   |\caption at 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 at setcalcmargin{%
   \caption at teststar{\caption@@setcalcmargin\caption at setmargin}%
@@ -1247,8 +1506,22 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at resetcalcmargin}
+% \changes{v1.3}{2010/11/07}{This macro added}
+%   |\caption at resetcalcmargin|\\
+%   clears the value which was stored in |\caption at set|\-|calc|\-|margin|.
+%    \begin{macrocode}
+\newcommand*\caption at resetcalcmargin{%
+  \let\caption at calcmargin@hook\@empty}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\caption at setcalcwidth}
 % \changes{v1.3}{2010/11/07}{This macro added}
+%   |\caption at 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 at setcalcwidth{%
   \caption at teststar{\caption@@setcalcmargin\caption at setwidth}%
@@ -1260,8 +1533,8 @@
 % \changes{v1.0n}{2007/04/03}{This counter added}
 % \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption at thecounter}; \cs{caption at stepcounter} added}
 % \changes{v1.5}{2012/04/09}{\cs{caption at stepcounter} renamed to \cs{caption at stepthecounter}}
-% Internal counter. At the moment it will be used inside
-% |\caption at ifoddpage| only.
+%   Internal counter.
+%   At the moment it will be used inside |\caption at if|\-|odd|\-|page| only.
 %    \begin{macrocode}
 \newcommand*\caption at thecounter{0}
 %    \end{macrocode}
@@ -1275,10 +1548,11 @@
 %
 % \begin{macro}{\caption at 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 at ifoddpage| and |\caption at ragged|.)
+%   |\caption at 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 at if|\-|odd|\-|page|.)
 %    \begin{macrocode}
 \newcommand*\caption at newlabel{\@newl at bel{caption at r}}
 %    \end{macrocode}
@@ -1286,8 +1560,8 @@
 %
 % \begin{macro}{\caption at 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 at ifoddpage| only.
+%   This command is a modified version of |\the|\-|page| from \LaTeX2e.
+%   It will be used inside |\caption at if|\-|odd|\-|page| only.
 %    \begin{macrocode}
 \newcommand*\caption at thepage{\the\c at page}
 %    \end{macrocode}
@@ -1295,9 +1569,10 @@
 %
 % \begin{macro}{\caption at label}
 % \changes{v1.1}{2007/09/01}{This macro added}
-% \changes{v1.2}{2007/12/03}{Definition of \cs{caption at newlabel} in AUX file added}
-%  This command is a modified version of |\label| from \LaTeX2e.
-%  It will be used inside |\caption at ifoddpage| and |\FP at helpNote|.
+% \changes{v1.2}{2007/12/03}{Definition of \cs{caption at newlabel} in aux file added}
+%   |\caption at label|\marg{name}\\
+%   This command is a modified version of |\label| from \LaTeX2e.
+%   It will be used inside |\caption at if|\-|odd|\-|page| and |\FP at help|\-|Note|.
 %    \begin{macrocode}
 \newcommand*\caption at label[1]{%
   \caption@@label
@@ -1315,8 +1590,9 @@
 % \begin{macro}{\caption at pageref}
 % \changes{v1.1}{2007/09/01}{This macro added}
 % \changes{v1.2d}{2009/10/09}{Uses \cs{@latex at warning} instead of \cs{caption at Warning} now}
-%  This command is a modified version of |\pageref| from \LaTeX2e.
-%  It will be used inside |\caption at ifoddpage| and |\FP at helpNote|.
+%   |\caption at pageref|\marg{name}\\
+%   This command is a modified version of |\page|\-|ref| from \LaTeX2e.
+%   It will be used inside |\caption at if|\-|odd|\-|page| and |\FP at help|\-|Note|.
 %    \begin{macrocode}
 \newcommand*\caption at pageref[1]{%
   \expandafter\ifx\csname caption at r@#1\endcsname\relax
@@ -1331,11 +1607,13 @@
 % \begin{macro}{\caption at 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 at ifoddpage{%
   \caption at iftwoside{%
@@ -1355,7 +1633,9 @@
 %
 % \begin{macro}{\caption at setoptcmd}
 % \changes{v1.1}{2007/08/11}{This macro added}
-% |\caption at setoptcmd|\marg{cmd}\marg{off -or- value}
+%   |\caption at 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 at setoptcmd[2]{%
   \caption at 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 at indent}}
 % \begin{macro}{\caption at parindent}
 % \begin{macro}{\caption at hangindent}
-%  These are the indentions we support.
+%   These are the indentions we support.
 %    \begin{macrocode}
-\newdimen\caption at indent
-\newdimen\caption at parindent
-\newdimen\caption at 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 at indent{#1}}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
+  \caption at setlength{@indent}{#1}}
 \DeclareCaptionOption{indention}[\leftmargini]{%
-       \setlength\caption at indent{#1}}
+  \caption at setlength{@indent}{#1}}
 \DeclareCaptionOption{parindent}{%
-       \setlength\caption at parindent{#1}}
+  \caption at setlength{@parindent}{#1}}
 \DeclareCaptionOption{hangindent}{%
-       \setlength\caption at hangindent{#1}}
+  \caption at setlength{@hangindent}{#1}}
 \DeclareCaptionOption{parskip}{%
-       \l at addto@macro\caption@@par{\setlength\parskip{#1}}}
+  \l at 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 at decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption at sls} renamed to \cs{caption at slsty}}
+%   |\DeclareCaptionStyle|\marg{name}\oarg{single-line-list-of-KV}\marg{list-of-KV}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionStyle[1]{%
   \@testopt{\caption at declarestyle{#1}}{}}
@@ -1410,8 +1688,16 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \def\caption at declarestyle#1[#2]#3{%
-  \global\@namedef{caption at sls@#1}{#2}%
-  \global\@namedef{caption at sty@#1}{#3}}
+  \caption at decl{style}{#1}%
+    {\def\caption at slsty{#2}%
+     \def\caption at sty{#3}}%
+%    \end{macrocode}
+%   The \package{floatrow} package uses |\@if|\-|undefined{caption at sty@#1}| to
+%   determine in |\flrow at 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 at sty@#1}{\@unused}}
 \@onlypreamble\caption at 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 at iftypewarning} removed}
-%  |\caption at setstyle|\marg{name}\\
-%  |\caption at setstyle*|\marg{name}\par
-%  Selecting a caption style means saving the additional
-%  \meta{single-line-list-of-KV} (this will be done by |\caption at sls|),
-%  resetting the caption options to the base ones (this will be done using
-%  |\caption at resetstyle|) and executing the \meta{list-of-KV} options
-%  (this will be done using |\caption at 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 at ifdecl} and \cs{caption at checkdecl} now}
+%   |\caption at setstyle*|\marg{name}\\
+%   Selecting a caption style means saving the additional
+%   \meta{single-line-list-of-KV} (this will be done by |\caption at sl|\-|sty|),
+%   resetting the caption options to the base ones (this will be done using
+%   |\caption at reset|\-|style|) and executing the \meta{list-of-KV} options
+%   (this will be done using |\caption at setup|).\par
+%   The starred version will give no error message if the given style is not
+%   defined.
 %    \begin{macrocode}
 \newcommand*\caption at setstyle{%
-  \caption at teststar\caption@@setstyle\@gobble\@firstofone}
+  \caption at teststar\caption@@setstyle\caption at ifdecl\caption at checkdecl}
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption@@setstyle[2]{%
-  \@ifundefined{caption at sty@#2}%
-    {#1{\caption at Error{Undefined style `#2'}}}%
-    {\expandafter\let\expandafter\caption at sty\csname caption at sty@#2\endcsname
+  #1{style}{#2}%
+    {\caption at set{style}{#2}%
+     \caption at style % defines \caption at sty & \caption at slsty
      \ifx\caption at setstyle@flag\@undefined
-       \let\caption at setstyle@flag\relax
+       \let\caption at setstyle@flag\relax % prevent \caption at resetstyle if called recursively
        \caption at resetstyle
        \caption at xsetup\caption at sty
        \let\caption at setstyle@flag\@undefined
      \else
        \caption at xsetup\caption at sty
-     \fi
-     \expandafter\let\expandafter\caption at sls\csname caption at sls@#2\endcsname
-     \expandafter\caption at l@addto at list\expandafter\caption at opt@singleline
-       \expandafter{\caption at sls}}}
+     \fi}%
+    {}}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at resetstyle}
-% \changes{v1.1}{2007/02/04}{%
-%       This macro renamed from \cs{caption at setdefault} to \cs{caption at resetstyle}}
+% \changes{v1.1}{2007/02/04}{This macro renamed from \cs{caption at setdefault} to \cs{caption at 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 at 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 at resetstyle{%
   \caption at 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 at 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 at 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 at set@bool\caption at ifslc{#1}}
+\DeclareCaptionOption{singlelinecheck}[1]{\caption at setsinglelinecheck{#1}}
 \DeclareCaptionOption{slc}[1]{\KV at 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 at setsinglelinecheck}
+% \changes{v2.0}{2018/03/13}{This macro added}
+%   |\caption at 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 at setsinglelinecheck[1]{%
+  \caption at ifdecl{singlelinecheck}{#1}%
+    {\caption at set{singlelinecheck}{#1}}%
+    {\caption at set@bool\caption at 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 at decl} now}
+%   |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionBox[2]{%
-  \global\long\@namedef{caption at box@#1}##1##2{#2}}
+  \caption at 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 at setbox{#1}}
-\DeclareCaptionOption{parbox}{\caption at set@box\caption at parbox{#1}}
+\DeclareCaptionOption{box}{\caption at set{box}{#1}}
+\DeclareCaptionOption{parbox}{\caption at set{parbox}{#1}}
+\caption at setmapping{parbox}{box}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at setbox}
-%  |\caption at setbox|\marg{name}\par
-%  Selecting a caption box simply means saving the code (in |\caption at box|).
-%    \begin{macrocode}
-\newcommand*\caption at setbox{%
-  \caption at set@box\caption at box}
-%    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at set@box[2]{%
-  \@ifundefined{caption at box@#2}%
-    {\caption at Error{Undefined box `#2'}}%
-    {\expandafter\let\expandafter#1\csname caption at 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 at 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 at 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 at parbox}}
 % \changes{v1.5}{2012/03/15}{\cs{caption at 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 at boxcolor}{\caption at box@parbox{\dimexpr #1-2\fboxsep}{#2}}}
-\DeclareCaptionBox{colorbox}{\colorbox{\caption at boxcolor}{%
-  \setlength\caption at tempdima{#1}%
-  \addtolength\caption at tempdima{-2\fboxsep}%
-  \linewidth\caption at tempdima
-  \hsize\caption at tempdima
-  #2}}
+\DeclareCaptionBox{colorbox}{%
+  \colorbox\caption at boxcolor{%
+    \setlength\caption at tempdima{#1}%
+    \addtolength\caption at tempdima{-2\fboxsep}%
+    \linewidth\caption at tempdima
+    \hsize\caption at tempdima
+    #2}}
 \DeclareCaptionOption{boxcolor}{\def\caption at 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 at box@default{\caption at 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 at decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption at ifh} renamed to \cs{caption at 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 at teststar\caption at declareformat\@gobble\@firstofone}
@@ -1592,53 +1897,35 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \long\def\caption@@declareformat#1#2[#3]#4{%
-  \global\expandafter\let\csname caption at ifh@#2\endcsname#1%
-  \global\long\@namedef{caption at slfmt@#2}##1##2##3{#3}%
-  \global\long\@namedef{caption at fmt@#2}##1##2##3{#4}}
+  \caption at decl[\edef]{format}{#2}{%
+    \unexpanded{\let\caption at ifhmode#1}%
+    \unexpanded{\long\def\caption at slfmt}####1####2####3\unexpanded{{#3}}%
+    \unexpanded{\long\def\caption at fmt}####1####2####3\unexpanded{{#4}}}}
 \@onlypreamble\caption@@declareformat
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at useformat}
+% \changes{v2.0}{2020/07/31}{This macro added}
+%   |\caption at useformat|\marg{name}\\
+%   expands |\caption at fmt| based on the given format \meta{name}.
 %    \begin{macrocode}
-\DeclareCaptionOption{format}{\caption at setformat{#1}}
+\newcommand*\caption at useformat[1]{% used by caption-koma.sto
+  \caption at checkdecl{format}{#1}{%
+    \begingroup
+      \@nameuse{caption at format@#1}\global\let\caption at tempa\caption at fmt
+    \endgroup\caption at tempa}}
 %    \end{macrocode}
-%
-% \begin{macro}{\caption at setformat}
-%  |\caption at setformat|\marg{name}\par
-%  Selecting a caption format simply means saving the code (in |\caption at fmt|)
-%  and if the code should be used in horizontal or vertical mode (|\caption at ifh|).
-%    \begin{macrocode}
-\newcommand*\caption at setformat[1]{%
-  \@ifundefined{caption at fmt@#1}%
-    {\caption at Error{Undefined format `#1'}}%
-    {\expandafter\let\expandafter\caption at ifh\csname caption at ifh@#1\endcsname
-     \expandafter\let\expandafter\caption at slfmt\csname caption at slfmt@#1\endcsname
-     \expandafter\let\expandafter\caption at fmt\csname caption at fmt@#1\endcsname}}
-%    \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 at fmt@default\expandafter
-    {\csname caption at fmt@#1\endcsname}%
-  \expandafter\def\expandafter\caption at slfmt@default\expandafter
-    {\csname caption at slfmt@#1\endcsname}%
-  \expandafter\def\expandafter\caption at ifh@default\expandafter
-    {\csname caption at ifh@#1\endcsname}}
-\@onlypreamble\DeclareCaptionDefaultFormat
+\DeclareCaptionOption{format}{\caption at 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}
@@ -1645,9 +1932,9 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \DeclareCaptionFormat{hang}[#1#2#3\par]{%
-  \caption at ifin@list\caption at lsepcrlist\caption at lsepname
+  \caption at iflabelseparatorwithnewline
     {\caption at Error{%
-       The option `labelsep=\caption at lsepname' does not work\MessageBreak
+       The option `labelsep=\caption at labelsep@name' does not work\MessageBreak
        with `format=hang'}}%
     {\@hangfrom{#1#2}%
      \advance\caption at parindent\hangindent
@@ -1655,41 +1942,28 @@
      \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 at 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 at decl} now}
+%   |\DeclareCaptionLabelFormat|\marg{name}\marg{code with \#1 and \#2}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionLabelFormat[2]{%
-  \global\@namedef{caption at lfmt@#1}##1##2{#2}}
+  \caption at decl{labelformat}{#1}##1##2{#2}}
 \@onlypreamble\DeclareCaptionLabelFormat
 %    \end{macrocode}
 % \end{macro}
 %
 %    \begin{macrocode}
-\DeclareCaptionOption{labelformat}{\caption at setlabelformat{#1}}
+\DeclareCaptionOption{labelformat}{\caption at set{labelformat}{#1}}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at setlabelformat}
-%  |\caption at setlabelformat|\marg{name}\par
-%  Selecting a caption label format simply means saving the code (in |\caption at lfmt|).
-%    \begin{macrocode}
-\newcommand*\caption at setlabelformat[1]{%
-  \@ifundefined{caption at lfmt@#1}%
-    {\caption at Error{Undefined label format `#1'}}%
-    {\expandafter\let\expandafter\caption at lfmt\csname caption at 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}
@@ -1696,6 +1970,7 @@
 % \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}
-\def\caption at lfmt@default{\caption at lfmt@simple}
+\DeclareCaptionLabelFormat{original}{%
+  \caption at ifdefined\caption at original@fnum
+    {\caption at original@fnum}%
+    {\caption at labelformat@simple{#1}{#2}}}
 %    \end{macrocode}
 %
+% `default' usually maps to `original'.
+%    \begin{macrocode}
+\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 at decl} now}
+% \changes{v2.0}{2020/07/27}{\cs{caption at iflf} renamed to \cs{caption at iflabelfont}}
+% \changes{v2.0}{2020/07/27}{\cs{caption at lsep} renamed to \cs{caption at labelsep}}
+% \changes{v2.0}{2020/07/27}{Definition of \cs{caption at 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 at teststar\caption at declarelabelseparator\@gobble\@firstofone}
+  \@ifstar
+    \DeclareCaptionLabelSeparator@
+    {\caption at declarelabelseparator\@firstofone}}
 \@onlypreamble\DeclareCaptionLabelSeparator
 %    \end{macrocode}
 %    \begin{macrocode}
+\newcommand\DeclareCaptionLabelSeparator@{%
+  \@ifstar
+    \DeclareCaptionLabelSeparator@@
+    {\caption at declarelabelseparator\@gobble}}
+\@onlypreamble\DeclareCaptionLabelSeparator@
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\DeclareCaptionLabelSeparator@@[2]{%
+  \caption at declarelabelseparator
+    {#2\@gobble\@firstofone}%
+    {#1}}
+\@onlypreamble\DeclareCaptionLabelSeparator@@
+%    \end{macrocode}
+%    \begin{macrocode}
 \newcommand\caption at declarelabelseparator[3]{%
-  \global\@namedef{caption at iflf@#2}{#1}%
-  \global\long\@namedef{caption at lsep@#2}{#3}%
-  \caption@@declarelabelseparator{#2}#3\\\@nil}
-\@onlypreamble\caption at declarelabelseparator
+  \caption at decl{labelseparator}{#2}%
+    {\def\caption at iflabelfont{#1}%
+     \def\caption at labelsep@name{#2}%
+     \def\caption at 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 at 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 at g@addto at list\caption at lsepcrlist{#1}%
-  \fi}
-\@onlypreamble\caption@@declarelabelseparator
+  \@namedef{caption at 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 at lsep@default| manually.
+%   \Note{This definition is used by \package{magyar.ldf} but only needs to be different
+%     than \cs{caption at lsep} (which is usually undefined).}
+%    \begin{macrocode}
+\newcommand*\caption at lsep@default{\caption at labelseparator@default\caption at labelsep}%
+%    \end{macrocode}
+%    \begin{macrocode}
+\@onlypreamble\caption at declarelabelseparator
+%    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at LabelSeparatorWithNewline}
+% \changes{v2.0}{2020/07/27}{This macro added}
+%   |\caption at 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 at setlabelseparator{#1}}
-\DeclareCaptionOption{labelseparator}{\caption at setlabelseparator{#1}}
+\newcommand*\caption at LabelSeparatorWithNewline[1]{%
+  \caption at g@addto at list\caption at labelsep@crlist{#1}}
+\@onlypreamble\caption at LabelSeparatorWithNewline
 %    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\caption at setlabelseparator}
-%  |\caption at setlabelseparator|\marg{name}\par
-%  Selecting a caption label separator simply means saving the code (in |\caption at lsep|).
+% \begin{macro}{\caption at iflabelseparatorwithnewline}
+% \changes{v2.0}{2020/07/31}{This macro added}
+%   |\caption at iflabelseparatorwithnewline|\marg{yes-code}\marg{no-code}\\
+%   tests if the current label separator uses |\\| internally.
 %    \begin{macrocode}
-\newcommand*\caption at setlabelseparator[1]{%
-  \@ifundefined{caption at lsep@#1}%
-    {\caption at Error{Undefined label separator `#1'}}%
-    {\edef\caption at lsepname{#1}%
-     \expandafter\let\expandafter\caption at iflf\csname caption at iflf@#1\endcsname
-     \expandafter\let\expandafter\caption at lsep\csname caption at lsep@#1\endcsname}}
+\newcommand*\caption at iflabelseparatorwithnewline{%
+  \caption at ifin@list\caption at labelsep@crlist\caption at 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 at set{labelseparator}{#1}}
+\DeclareCaptionOption{labelseparator}{\caption at 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,39 +2104,25 @@
 \DeclareCaptionLabelSeparator{space}{ }
 \DeclareCaptionLabelSeparator*{quad}{\quad}
 \DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+\caption at 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{\\}
+\newcommand*\captionnewline{\\\relax}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at setdefaultlabelsep}
-% \changes{v1.2d}{2009/03/29}{This macro added}
-%    \begin{macrocode}
-\newcommand*\caption at setdefaultlabelsep[1]{%
-  \ifx\caption at lsep\caption at lsep@default
-    \caption at set@default at labelsep{#1}%
-    \caption at setlabelseparator{default}%
-  \else
-    \caption at set@default at labelsep{#1}%
-  \fi}
-%    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at set@default at labelsep[1]{%
-  \def\caption at lsep@default{\@nameuse{caption at lsep@#1}}%
-  \def\caption at iflf@default{\@nameuse{caption at iflf@#1}}}
-%    \end{macrocode}
-% \end{macro}
-%
 % `default' usually maps to `colon'.
 %    \begin{macrocode}
-\caption at set@default at labelsep{colon}
+\SetCaptionDefault{labelseparator}{colon}
 %    \end{macrocode}
 %
 % \section{Text formats}
@@ -1811,32 +2129,19 @@
 %
 % \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 at decl} now}
+%   |\DeclareCaptionTextFormat|\marg{name}\marg{code with \#1}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionTextFormat[2]{%
-  \global\long\@namedef{caption at tfmt@#1}##1{#2}}
+  \caption at 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 at settextformat{#1}}
-\DeclareCaptionOption{strut}[1]{\caption at set@bool\caption at ifstrut{#1}}
+\DeclareCaptionOption{textformat}{\caption at set{textformat}{#1}}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at settextformat}
-% \changes{v1.0j}{2007/02/18}{This macro added}
-%  |\caption at settextformat|\marg{name}\par
-%  Selecting a caption text format simply means saving the code (in |\caption at tfmt|).
-%    \begin{macrocode}
-\newcommand*\caption at settextformat[1]{%
-  \@ifundefined{caption at tfmt@#1}%
-    {\caption at Error{Undefined text format `#1'}}%
-    {\expandafter\let\expandafter\caption at tfmt\csname caption at 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 at get@label#1\caption at makeanchor#2#3\@nil{%
   \def\caption at tempa{#2}%
   \ifx\caption at tempa\@empty
-    \caption at getlabel#1\label{}\@nil
+    \caption at getlabel{#1}%
   \else
-    \caption at getlabel#2\label{}\@nil
+    \caption at getlabel{#2}%
   \fi}
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -1860,7 +2165,7 @@
 %
 % `default' usually maps to `simple'.
 %    \begin{macrocode}
-\def\caption at tfmt@default{\caption at tfmt@simple}
+\SetCaptionDefault{textformat}{simple}
 %    \end{macrocode}
 %
 % \begin{macro}{\caption at getlabel}
@@ -1867,9 +2172,14 @@
 % \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 at thelabel} added}
-% Gets the label command out of the (first) caption text and stores it to |\caption at thelabel|.
+% \changes{v2.0}{2020/08/23}{Syntax changed}
+%   |\caption at getlabel|\marg{text}\\
+%   gets the label command out of the given caption text and stores it to
+%   |\caption at the|\-|label|.
 %    \begin{macrocode}
-\long\def\caption at getlabel#1\label#2#3\@nil{%
+\newcommand\caption at getlabel[1]{%
+  \caption@@getlabel#1\label{}\@nil}
+\long\def\caption@@getlabel#1\label#2#3\@nil{%
   \def\@tempa{#2}%
   \ifx\@tempa\@empty
     \let\caption at thelabel\relax
@@ -1877,27 +2187,27 @@
     \def\@tempb{*}%
     \ifx\@tempa\@tempb
       \def\caption at thelabel{\label*}%
-      \caption@@getlabel#3\@nil
+      \caption@@@getlabel#3\@nil
     \else
       \def\caption at 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 at addto@macro\caption at thelabel{{#1}}%
   \fi}
 %    \end{macrocode}
 %    \begin{macrocode}
-\long\def\caption@@@getlabel[#1]#2\@nil{%
+\long\def\caption@@@@getlabel[#1]#2\@nil{%
   \l at addto@macro\caption at thelabel{[{#1}]}%
-  \caption@@getlabel#2\@nil}
+  \caption@@@getlabel#2\@nil}
 %    \end{macrocode}
 %    \begin{macrocode}
 \let\caption at thelabel\relax
@@ -1904,6 +2214,11 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \changes{v1.0c}{2005/02/12}{Option \opt{strut=} added}
+%    \begin{macrocode}
+\DeclareCaptionOption{strut}[1]{\caption at set@bool\caption at ifstrut{#1}}
+%    \end{macrocode}
+%
 % \section{Fonts}
 %
 % \begin{macro}{\DeclareCaptionFont}
@@ -1911,79 +2226,56 @@
 % \changes{v1.1}{2007/05/07}{Internal: Uses \cs{caption at fnt} instead of \cs{caption at 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 at declare@font
-    \caption at declarefont}
+  \caption at decl@package{font}{\caption at declarefont}}
 \@onlypreamble\DeclareCaptionFont
 %    \end{macrocode}
 %    \begin{macrocode}
-\def\caption at declare@font[#1]#2{%
-  \global\@namedef{caption at fnt@#2 at package}{#1}%
-  \caption@@declarefont{#2}}
-\@onlypreamble\caption at declare@font
+\newcommand*\caption at declarefont[2]{%
+  \caption at decl{font}{#1}##1{#2}%
+  \define at key{caption at font}{#1}[]{\caption at addto@font{#1}{##1}}}
+\@onlypreamble\caption@@declarefont
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\caption at declarefont[1]{%
-  \global\@nameundef{caption at fnt@#1 at package}%
-  \caption@@declarefont{#1}}
-\@onlypreamble\caption at declarefont
+\newcommand*\caption at addto@font[1]{%
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\caption@@declarefont[2]{%
-  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#1}{#2}}%
-  \caption@@@declarefont{#1}{#2}}
-\@onlypreamble\caption@@declarefont
+% Load package first, if necessary
+  \caption at load@package{font}{#1}%
 %    \end{macrocode}
+% Add the content to \cs{caption at fnt}
 %    \begin{macrocode}
-\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
-\@onlypreamble\caption@@@declarefont
+  \caption at add@to at font{font}{#1}}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\caption at addto@fnt[2]{%
-  \expandafter\let\expandafter\caption at package\csname caption at fnt@#1 at package\endcsname
-  \caption at ifdefined\caption at package
-    {\caption at requirepackage\caption at package{#1}}% load package, if necessary
-    {}%
-  \l at addto@macro\caption at fnt{#2}}
+\newcommand*\caption at add@to at font[3]{%
+  \expandafter\g at addto@macro\expandafter\caption at fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
 %    \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 at default}{#2}}
-\@onlypreamble\DeclareCaptionDefaultFont
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
 \DeclareCaptionOption{font}{\caption at setfont{font}{#1}}
 \DeclareCaptionOption{font+}{\caption at addtofont{font}{#1}}
-\DeclareCaptionDefaultFont{font}{}
 %    \end{macrocode}
 %    \begin{macrocode}
 \DeclareCaptionOption{labelfont}{\caption at setfont{labelfont}{#1}}
 \DeclareCaptionOption{labelfont+}{\caption at addtofont{labelfont}{#1}}
-\DeclareCaptionDefaultFont{labelfont}{}
+\caption at setmapping{labelfont}{font}
 %    \end{macrocode}
 %    \begin{macrocode}
 \DeclareCaptionOption{textfont}{\caption at setfont{textfont}{#1}}
 \DeclareCaptionOption{textfont+}{\caption at addtofont{textfont}{#1}}
-\DeclareCaptionDefaultFont{textfont}{}
+\caption at setmapping{textfont}{font}
 %    \end{macrocode}
 %
 % \begin{macro}{\caption at setfont}
 % \changes{v1.0j}{2007/01/30}{Usage of \cs{caption at setkeys} with optional argument}
 % \changes{v1.1}{2006/05/14}{Support of \cs{DeclareDefaultCaptionFont} added}
-%  |\caption at setfont|\marg{name}\marg{keyval-list of names}\par
-%  Selecting a caption font means saving all the code snippets
-%  in |\caption|\meta{name}.
+%   |\caption at 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 at setfont[1]{%
   \expandafter\let\csname caption#1\endcsname\@empty
@@ -1993,41 +2285,21 @@
 %
 % \begin{macro}{\caption at addtofont}
 % \changes{v1.2}{2007/11/17}{This macro added}
-%  |\caption at addtofont|\marg{name}\marg{keyval-list of names}\par
-%  Like |\caption at 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 at addtofont|\marg{name}\marg{keyval-list of names}\\
+%   Like |\caption at 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 at addtofont[2]{%
+  \expandafter\let\expandafter\caption at fnt\csname caption#1\endcsname
   \begingroup
-    \expandafter\let\expandafter\caption at fnt\csname caption#1\endcsname
-    \define at key{caption at fnt}{default}[]{%
-      \l at addto@macro\caption at fnt{\csname caption#1 at default\endcsname}}%
-    \caption at setkeys[caption]{caption at fnt}{#2}%
-    \global\let\caption at tempa\caption at fnt
+    \define at key{caption at font}{default}[]{\caption at add@to at font{#1}{default}{##1}}%
+    \caption at setkeys[caption]{caption at font}{#2}%
   \endgroup
-  \expandafter\let\csname caption#1\endcsname\caption at tempa}
+  \expandafter\let\csname caption#1\endcsname\caption at fnt}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at font}
-% \changes{v1.1}{2007/05/07}{This macro added}
-%  |\caption at font|\marg{keyval-list of names}\\
-%  |\caption at font*|\marg{keyval-code}\par
-%  Sets the given font, e.g.~|\caption at font{small,it}|
-%  is equivalent to |\small\itshape|.
-%    \begin{macrocode}
-\newcommand*\caption at font{%
-  \caption at teststar\caption@@font\@firstofone
-          {\caption at setkeys[caption]{caption at fnt}}}
-\newcommand*\caption@@font[2]{%
-  \begingroup
-  \def\caption at fnt{\endgroup}%
-  #1{#2}%
-  \caption at fnt}
-%    \end{macrocode}
-% \end{macro}
-%
 % These are the pre-defined font code snippets.
 %
 % \changes{v1.1}{2007/05/07}{Color font support added}
@@ -2063,8 +2335,32 @@
 \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 at smaller}
+\DeclareCaptionFont{larger}{\caption at larger}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\DeclareCaptionFont{none}{}
+\DeclareCaptionFont{normal}{%
+  \caption at font@normalcolor\@unused
+  \caption at font@normalfont\@unused
+  \caption at font@normalsize\@unused
+  \caption at 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 at smaller}
+%   |\caption at smaller|\\
+%   selects a font size which is smaller than the current one.
+%    \begin{macrocode}
 \newcommand\caption at smaller{%
   \ifx\@currsize\tiny
     \relax
@@ -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 at smaller}
 %    \end{macrocode}
+% \end{macro}
 %
-% \changes{v1.8}{2018/05/02}{Font size \texttt{larger} added}
+% \begin{macro}{\caption at larger}
+%   |\caption at larger|\\
+%   selects a font size which is larger than the current one.
 %    \begin{macrocode}
 \newcommand\caption at 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 at larger}
 %    \end{macrocode}
+% \end{macro}
 %
+% \begin{macro}{\caption at hypersetup}
+%   |\caption at hypersetup|\marg{options}\\
+%   expands to |\hypersetup|\marg{options} if defined, to nothing otherwise.
 %    \begin{macrocode}
-\DeclareCaptionFont{singlespacing}{}
+\newcommand*\caption at hypersetup{\caption at ifdefined\hypersetup\hypersetup\@gobble}
+\DeclareCaptionFont{hypersetup}{\caption at hypersetup{#1}}   % for usage in \captionsetup{font={hypersetup=...}}
+\DeclareCaptionOption{hypersetup}{\caption at hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
 %    \end{macrocode}
+% \end{macro}
 %
-%    \begin{macrocode}
-%\DeclareCaptionFont{normal}{%
-%  \caption at font{normalcolor,normalfont,normalsize,singlespacing}
-\DeclareCaptionFont{normal}{%
-  \caption at font*{%
-    \KV at caption@fnt at normalcolor\@unused
-    \KV at caption@fnt at normalfont\@unused
-    \KV at caption@fnt at normalsize\@unused
-    \KV at caption@fnt at 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 at setfont{size}{#1}}
-\DeclareCaptionDefaultFont{size}{}
+\caption at 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 at decl} now}
+%   |\DeclareCaptionJustification|\oarg{package}\marg{name}\marg{code}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionJustification{%
-  \def\caption@@@declarefont##1##2{%
-    \global\@namedef{caption at hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
-    \let\caption@@@declarefont\@gobbletwo}%
-  \DeclareCaptionFont}
-\@onlypreamble\DeclareCaptionJustification
+% \caption at decl@package{justification}{\caption at 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 at hj@|\meta{name} instead of |\caption at justification@|\meta{name}.
+%   For this reason we have to store the code for the \package{floatrow} package
+%   additionally, so |\flrow at FBo|\-|Align| will still work fine.
 %    \begin{macrocode}
-\newcommand*\DeclareCaptionDefaultJustification[1]{%
-  \global\@namedef{caption at hj@default}{#1}% for compatibility to v1.0
-  \DeclareCaptionDefaultFont{@hj}{#1}}
-\@onlypreamble\DeclareCaptionDefaultJustification
+  \caption at withoptargs\caption at declare@justification}
 %    \end{macrocode}
-% \end{macro}
-%
 %    \begin{macrocode}
-\DeclareCaptionOption{justification}{\caption at setjustification{#1}}
-\DeclareCaptionDefaultJustification{}
+\newcommand*\caption at declare@justification[3]{%
+  \caption at decl@package{justification}{\caption at decl{justification}}#1{#2}{#3}%
+  \expandafter\let\csname caption at hj@#2\expandafter\endcsname\csname caption at justification@#2\endcsname}
+\@onlypreamble\DeclareCaptionJustification
 %    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\caption at setjustification}
-% \changes{v1.1}{2007/07/03}{Mapped to \cs{caption at setfont}}
-%  |\caption at setjustification|\marg{name}\par
-%  Selecting a caption justification simply means saving the code (in |\caption at hj|).
 %    \begin{macrocode}
-\newcommand*\caption at setjustification{\caption at setfont{@hj}}
+\DeclareCaptionOption{justification}{%
+  \caption at load@package{justification}{#1}%
+  \caption at 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 at 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 at 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 at ifundefined\abovecaptionskip{%
   \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
@@ -2258,8 +2553,8 @@
 %
 % \begin{macro}{\caption at rule}
 % \changes{v1.2b}{2008/05/06}{This macro added}
-%  |\caption at rule|\par
-%  Draws an invisible rule to adjust the ``skip'' setting.
+%   |\caption at rule|\\
+%   Draws an invisible rule to adjust the ``skip'' setting.
 %    \begin{macrocode}
 \newcommand*\caption at rule{\caption at ifrule\caption at hrule\relax}
 %    \end{macrocode}
@@ -2284,58 +2579,72 @@
 % usually has to take care for himself that this hint actually matches the
 % right position.
 %
+% \begin{macro}{\caption at declare@position}
+% \changes{v2.0}{2020/07/26}{This macro added}
+%   |\caption at 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 at declare@position[2]{%
+  \caption at decl{position}{#1}{#2}}
+\@onlypreamble\caption at declare@position
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 \DeclareCaptionOption{position}{\caption at 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 at key{caption}{figureposition}
 %    \end{macrocode}
 %    \begin{macrocode}
-\DeclareCaptionOption{tableposition}{%
-  \captionsetup*[table]{position=#1}}
+\DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
 \@onlypreamble at key{caption}{tableposition}
 %    \end{macrocode}
 %
 % \begin{macro}{\caption at 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 at defaultpos} added}
-%  |\caption at setposition|\marg{position}\par
-%  Selecting the caption position means that we put |\caption at position| to
-%  the right value. \emph{Please do \textbf{not} use the internal macro
-%  \cs{caption at position} in your own package or document, but use the wrapper
-%  macro \cs{caption at iftop} instead.}
+% \changes{v2.0}{2020/07/27}{Uses \cs{caption at set} now}
+%   |\caption at setposition|\marg{position}\\
+%   puts |\caption at position| to the right value.
+%   \emph{Please do \textbf{not} use the internal macro
+%     \cs{caption at position} in your own package or document, but use the
+%     wrapper command \cs{caption at 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 at setposition[1]{%
-  \caption at ifinlist{#1}{d,default}{%
-    \let\caption at position\caption at defaultpos
-  }{\caption at ifinlist{#1}{t,top,above}{%
-    \let\caption at position\@firstoftwo
-  }{\caption at ifinlist{#1}{b,bottom,below}{%
-    \let\caption at position\@secondoftwo
-  }{\caption at ifinlist{#1}{a,auto}{%
-    \let\caption at position\@undefined
-  }{%
-    \caption at Error{Undefined position `#1'}%
-  }}}}}
+\newcommand*\caption at setposition{\caption at set{position}}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at defaultpos}
+% These are the pre-defined position code snippets.
+%    \begin{macrocode}
+\caption at declare@position{t}{\@firstoftwo}
+\caption at declare@position{top}{\@firstoftwo}
+\caption at declare@position{above}{\@firstoftwo}
+\caption at declare@position{b}{\@secondoftwo}
+\caption at declare@position{bottom}{\@secondoftwo}
+\caption at declare@position{below}{\@secondoftwo}
+\caption at declare@position{a}{\caption at autoposition}% needed by floatrow package, \flrow at cappos
+\caption at declare@position{auto}{\caption at 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 at setdefaultpos{a}% default = auto
-\let\caption at defaultpos\@undefined
+\SetCaptionDefault{position}{auto}
 %    \end{macrocode}
+%
+% \begin{macro}{\caption at autoposition}
+% \changes{v2.0}{2020/07/27}{This macro added}
+% If in doubt, `position=auto' maps to `position=below'.
+%    \begin{macrocode}
+\let\caption at autoposition\@secondoftwo
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at iftop}
@@ -2342,70 +2651,51 @@
 % \changes{v1.0a}{2004/01/23}{Split into \cs{caption at iftop} \& \cs{caption at fixposition}}
 % \changes{v1.0c}{2005/02/12}{Adapted to \cs{caption at defaultpos}}
 % \changes{v1.1}{2007/05/08}{Position will be fixed to `bottom' if `auto'}
-%  |\caption at 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 at iftop|\marg{true-code}\marg{false-code}\\
+%   Since version \version{2.0} this command is identical to |\caption at position|.
 %    \begin{macrocode}
-\newcommand*\caption at iftop{%
-  \ifx\caption at position\@undefined
-    \let\caption at position\@secondoftwo
-%   = \caption at setposition b%
-  \fi
-  \caption at position}
+\newcommand*\caption at iftop{\caption at position}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at fixposition}
-% \changes{v1.0b}{2004/05/16}{%
-%        Split into \cs{caption at fixposition} & \cs{caption at autoposition}}
-%  |\caption at fixposition|\par
-%  This macro checks if the `position' is set to `auto'.
-%  If yes, |\caption at autoposition| will be called to
-%  set |\caption at 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 at fixposition} & \cs{caption at autoposition}}
+% \changes{v2.0}{2020/07/27}{Adapted to current implementation of `auto'}
+%   |\caption at 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 at 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 at fixposition{%
-  \ifx\caption at position\@undefined
-    \caption at autoposition
-  \fi}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at autoposition}
-% \changes{v1.0a}{2004/01/23}{\cs{ifvmode} added}
-%  |\caption at 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 at 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 at autoposition{%
   \ifvmode
     \edef\caption at tempa{\the\prevdepth}%
     \caption at Debug{\protect\prevdepth=\caption at tempa}%
     \ifdim\prevdepth>-\p@
-      \let\caption at position\@secondoftwo
+      \let\caption at autoposition\@secondoftwo % position=below
     \else
-      \let\caption at position\@firstoftwo
+      \let\caption at autoposition\@firstoftwo  % position=above
     \fi
-%   = \caption at setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
   \else
     \caption at Debug{no \protect\prevdepth}%
-    \let\caption at position\@secondoftwo
-%   = \caption at setposition b%
+    \let\caption at autoposition\@secondoftwo   % position=below
   \fi}
 %    \end{macrocode}
 % \end{macro}
+%
 % \begin{macro}{\caption at setautoposition}
 % \changes{v1.1}{2007/06/10}{This macro added}
-%  |\caption at 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 at setautoposition|\marg{position}\\
+%   replaces the above algorithm by a different one (or a fixed position setting).
 %    \begin{macrocode}
 \newcommand*\caption at setautoposition[1]{%
-  \def\caption at autoposition{\caption at setposition{#1}}}
+  \def\caption at 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 at beginhook{}
 \newcommand*\caption at endhook{}
@@ -2436,10 +2727,14 @@
 %
 % \begin{macro}{\caption at setlist}
 % \changes{v1.2a}{2008/03/20}{This macro added}
-%  |\caption at setlist|\marg{boolean}
+%   |\caption at setlist|\marg{boolean value}\\
+%   sets the `list' option to either `off' or `on'.
 %    \begin{macrocode}
 \newcommand*\caption at setlist{\caption at set@bool\caption at iflist}
 %    \end{macrocode}
+%    \begin{macrocode}
+\caption at setlist{on}
+%    \end{macrocode}
 % \end{macro}
 %
 % \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added}
@@ -2451,7 +2746,8 @@
 %
 % \begin{macro}{\caption at setlisttype}
 % \changes{v1.4}{2011/08/30}{This macro added}
-%  |\caption at setlisttype|\marg{type}
+%   |\caption at setlisttype|\marg{type}\\
+%   sets the `listtype' option to the given \meta{type}.
 %    \begin{macrocode}
 \newcommand*\caption at setlisttype{%
   \caption at setlisttype@ext{}%
@@ -2463,9 +2759,11 @@
   \ifx#1\@empty \let#1\@undefined \fi}
 %    \end{macrocode}
 % \end{macro}
+%
 % \begin{macro}{\caption at setlisttype@ext}
 % \changes{v1.4}{2011/08/30}{This macro added}
-%  |\caption at setlisttype@ext|\marg{type extension}
+%   |\caption at setlisttype@ext|\marg{type extension}\\
+%   sets the `listtype' option to the given \meta{type extension}.
 %    \begin{macrocode}
 \newcommand*\caption at setlisttype@ext{%
   \caption@@setlisttype\caption at 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 at decl} now}
+%   |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionListFormat[2]{%
-  \global\@namedef{caption at lstfmt@#1}##1##2{#2}}
+  \caption at decl{listformat}{#1}##1##2{#2}}
 \@onlypreamble\DeclareCaptionListFormat
 %    \end{macrocode}
 % \end{macro}
@@ -2486,54 +2785,34 @@
 % \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 at setlistformat{#1}}
+\DeclareCaptionOption{listformat}{\caption at set{listformat}{#1}}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at setlistformat}
-% \changes{v1.1}{2004/07/15}{This macro added}
-% \changes{v1.2}{2007/11/17}{Renamed from \cs{caption at setlistofformat} to \cs{caption at setlistformat}}
-%  |\caption at setlistformat|\marg{name}\par
-%  Selecting a caption list format simply means saving the code (in |\caption at lstfmt|).
+% There are seven pre-defined list formats. (The first five were taken from the \package{subfig} package.)
 %    \begin{macrocode}
-\newcommand*\caption at setlistformat[1]{%
-  \@ifundefined{caption at lstfmt@#1}%
-    {\caption at Error{Undefined list format `#1'}}%
-    {\expandafter\let\expandafter\caption at lstfmt
-       \csname caption at lstfmt@#1\endcsname}}
-%    \end{macrocode}
-% \end{macro}
-%
-% There are five pre-defined list formats, taken from the \package{subfig} package.
-%    \begin{macrocode}
 \DeclareCaptionListFormat{empty}{}
 \DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{subsimple}{#2}
 \DeclareCaptionListFormat{parens}{#1(#2)}
-\DeclareCaptionListFormat{subsimple}{#2}
 \DeclareCaptionListFormat{subparens}{(#2)}
+\DeclareCaptionListFormat{period}{#1#2.}
+\DeclareCaptionListFormat{subperiod}{#2.}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at setdefaultlistformat}
-% \changes{v1.2d}{2009/03/29}{This macro added}
+% `default' usually maps to `subsimple'.
 %    \begin{macrocode}
-\newcommand*\caption at setdefaultlistformat[1]{%
-  \ifx\caption at lstfmt\caption at lstfmt@default
-    \caption at set@default at listformat{#1}%
-    \caption at setlistformat{default}%
-  \else
-    \caption at set@default at listformat{#1}%
-  \fi}
+\SetCaptionDefault{listformat}{subsimple}
 %    \end{macrocode}
+%
+% \begin{macro}{\caption at lstfmt}
+% \changes{v2.0}{This macro added}
+%   To provide backward compatibility we still offer \cs{caption at lstfmt}.
+%   (\cs{caption at lstfmt} is used in the \package{dgruyter} package.)
 %    \begin{macrocode}
-\newcommand*\caption at set@default at listformat[1]{%
-  \def\caption at lstfmt@default{\@nameuse{caption at lstfmt@#1}}}
+\newcommand*\caption at lstfmt{\caption at listformat}
 %    \end{macrocode}
 % \end{macro}
 %
-% `default' usually maps to `subsimple'.
-%    \begin{macrocode}
-\caption at set@default at listformat{subsimple}
-%    \end{macrocode}
-%
 % \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 at standard}
+%    \begin{macrocode}
+% article|report|book.sty [2005/09/16 v1.4f Standard LaTeX document class]
+\newcommand\@makecaption at standard[2]{%
+  \vskip\abovecaptionskip
+  \sbox\@tempboxa{#1: #2}%
+  \ifdim \wd\@tempboxa >\hsize
+    #1: #2\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi
+  \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption at standard
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption at arabic}
+%    \begin{macrocode}
+% arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)]
+\newcommand\@makecaption at arabic[2]{%
+  \vskip\abovecaptionskip
+  \sbox\@tempboxa{#1: #2}%
+  \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+  \if at rl{
+    \ifdim \wd\@Arabitempboxa >\hsize
+    \textRL{#2} : #1\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+  \fi}\else{
+  \ifdim \wd\@tempboxa >\hsize
+    #1: #2\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi}\fi
+  \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption at arabic
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption at latvian}
+%    \begin{macrocode}
+% latvian.ldf [2018/02/19 v2.0b Latvian support from the babel system]
+\newcommand\@makecaption at 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 at latvian
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\caption at ifdocumentclass}
-% Boolean switch which is set if the document class could be detected successfully,
-% i.e. |\caption at document|\-|class| is set to a proper value.
-% (If |\caption at 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 at document|\-|class| is set to a proper value.
+%   (If |\caption at document|\-|class| is already set, this flag will also be set.)
 %    \begin{macrocode}
 \caption at setbool{documentclass}{1}
 %    \end{macrocode}
@@ -2564,8 +2901,8 @@
 %
 % \begin{macro}{\caption at documentclass}
 % \changes{v1.8e}{2018/05/11}{This macro added}
-% Determine document class used.
-% Set |\caption at document|\-|class| by good-guessing, if not already set.
+%   Determine document class used.
+%   Set |\caption at document|\-|class| by good-guessing, if not already set.
 %    \begin{macrocode}
 \caption at ifundefined\caption at documentclass{%
 %    \end{macrocode}
@@ -2589,19 +2926,19 @@
     \caption at InfoNoLine{KOMA-Script document class detected}%
     \def\caption at 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 at ifdefined\@captionheadfont{%
     \caption at InfoNoLine{AMS or SMF document class detected}%
-    \def\caption at documentclass{ams}%
+    \def\caption at 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 at ifdefined\CaptionFonts{%
     \caption at InfoNoLine{NTG document class detected}%
     \def\caption at documentclass{ntg}%
 %    \end{macrocode}
-% If |\cph at font| and |\cpb at font| are defined, we assume it's a NTG Dutch document class.
+%   If |\cph at font| and |\cpb at font| are defined, we assume it's the thesis document class.
 %    \begin{macrocode}
   }{\caption at ifdefined\cph at font{%
       \caption at ifdefined\cpb at font\@firstoftwo\@secondoftwo
@@ -2612,405 +2949,335 @@
     \def\caption at 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 at tempa#1#2{%
-      \vskip\abovecaptionskip
-      \sbox\@tempboxa{#1: #2}%
-      \ifdim \wd\@tempboxa >\hsize
-        #1: #2\par
+    \ifx\@makecaption\@undefined
+      \caption at InfoNoLine{Document class w/o caption stuff detected}%
+    \else
+      \ifx\@makecaption\@makecaption at standard
+        \caption at InfoNoLine{Standard document class detected}%
       \else
-        \global \@minipagefalse
-        \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+        \ifx\@makecaption\@makecaption at arabic
+          \caption at InfoNoLine{arabic babel option detected}%
+        \else
+          \ifx\@makecaption\@makecaption at latvian
+            \caption at InfoNoLine{latvian babel option detected}%
+          \else
+%    \end{macrocode}
+%   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 at document|\-|class| is not correct.)
+%    \begin{macrocode}
+            \caption at InfoNoLine{%
+              Unknown document class (or package),\MessageBreak
+              standard defaults will be used}%
+            \caption at InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+            \caption at setbool{documentclass}{0}% unknown document class
+          \fi
+        \fi
       \fi
-      \vskip\belowcaptionskip}}
-    \ifx\caption at tempa\@makecaption
-      \caption at InfoNoLine{Standard document class detected}%
-    \else
+    \fi
 %    \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 at document|\-|class| is not correct.)
 %    \begin{macrocode}
-      \caption at InfoNoLine{%
-        Unknown document class (or package),\MessageBreak
-        standard defaults will be used}%
-      \caption at InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
-      \caption at setbool{documentclass}{0}%
-    \fi
-    \def\caption at documentclass{base}%
-  }}}}}}%
+    \let\caption at documentclass\@empty % don't load adaption code later on
+  }}}}}}}%
 }{}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at ifclassloaded}
-% \changes{v1.8e}{2019/09/09}{This macro added}
-% |\caption at ifclassloaded|\marg{name}\marg{yes-code}\marg{no-code}
+% \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}
-\newcommand*\caption at ifclassloaded[1]{%
-  \edef\caption at tempa{#1}%
-  \ifx\caption at tempa\caption at documentclass
-    \expandafter\@firstoftwo
-  \else
-    \expandafter\@secondoftwo
-  \fi}
+\newcommand*\AtCaptionPackage{%
+  \g at addto@macro\caption at documentclass@code}
+\@onlypreamble\AtCaptionPackage
 %    \end{macrocode}
+%    \begin{macrocode}
+\providecommand*\caption at documentclass@code{}
+\@onlypreamble\caption at documentclass@code
+%    \end{macrocode}
 % \end{macro}
 %
-% \subsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes}
+% \section{Babel support}
 %
-% 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}{\caption at IfBabelPackageLoaded}
+%   |\caption at IfBabelPackageLoaded|\marg{option}\marg{cmd}\marg{yes-code}\marg{no-code}\\
+%   expands the given \meta{yes-code} if |\caption at 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 at ifbabel@|\meta{option}|{false}|\end{quote}
 %    \begin{macrocode}
-\caption at ifclassloaded{elsarticle}{%
+\newcommand*\caption at IfBabelPackageLoaded[4]{%
+  \caption at ifdefined#2\@firstofone\caption at AtBeginDocument{%
+    \caption at if@bool{\@nameuse{caption at ifbabel@#1}}%
+      {\def\caption at tempa{\caption at ifdefined#2}}%
+      {\let\caption at tempa\@secondoftwo}%
+    \caption at tempa
+      {\caption at InfoNoLine{#1 babel package is loaded}#3}%
+      {#4}}}
+\@onlypreamble\caption at IfBabelPackageLoaded
 %    \end{macrocode}
-%    \begin{macrocode}
-  \DeclareCaptionDefaultFont{font}{\footnotesize}
-%    \end{macrocode}
-%    \begin{macrocode}
-}{}
-%    \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 at ifclassloaded{ams}{%
+\DeclareCaptionLabelSeparator{arabi}{\if at rl\space\fi: }
 %    \end{macrocode}
+%
+% \begin{macro}{\caption at IfBabelArabi}
+%   |\caption at IfBabelArabic|\marg{yes-code}\marg{no-code}
 %    \begin{macrocode}
-  \let\captionmargin\captionindent % set to 3pc by AMS class
-  \begingroup\edef\@tempa{\endgroup
-    \noexpand\caption at g@addto at list\noexpand\caption at sty@default
-      {margin=\the\captionmargin
-       \caption at ifdefined\smf at makecaption{,maxmargin=.1\linewidth}{}}}
-  \@tempa
-  \caption at g@addto at list\caption at 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 at IfBabelArabi{%
+  \caption at IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
+\@onlypreamble\caption at IfBabelArabi
 %    \end{macrocode}
 %    \begin{macrocode}
-}{}
+\providecommand*\caption at ifbabel@arabi{true}
 %    \end{macrocode}
+% \end{macro}
 %
-% \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}
-%
 %    \begin{macrocode}
-\caption at ifclassloaded{beamer}{%
+\caption at IfBabelArabi{%
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at ifbeamertemplate}
-% |\caption at 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 at rl}
+% \changes{v1.8}{2018/05/20}{This macro added}
 %    \begin{macrocode}
-  \newcommand*\caption at ifbeamertemplate[1]{%
-    \begingroup
-      \let\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
-      \@nameuse{beamer@@tmpop at caption@#1}%
-      \ifx\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
-        \endgroup\expandafter\@firstoftwo
-      \else
-        \endgroup\expandafter\@secondoftwo
-      \fi}
+  \newcommand\caption at rl[1]{\if at 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 at ifbeamertemplate{numbered}%
-      \caption at lfmt@simple
-      \caption at lfmt@unnumbered
-    {#1}{#2}}
+  \caption at ifdefined\extrasarabic{%
+    \addto\extrasarabic{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{arabi}}}{}%
+  \caption at ifdefined\extrasfarsi{%
+    \addto\extrasfarsi{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{arabi}}}{}%
 %    \end{macrocode}
-% The \package{magyar} babel package redefines the current label format to a one called |simple|\-|Magyar|,
-% defined within |\@@magyar at caption|\-|fix| which will be executed |\At|\-|Begin|\-|Document|.
+%
 %    \begin{macrocode}
-  \DeclareCaptionLabelFormat{default at magyar}{%
-    \caption at ifbeamertemplate{numbered}%
-      \caption at lfmt@simple at magyar
-      \caption at lfmt@unnumbered
-    {#1}{#2}}
-  \@ifundefined{@@magyar at captionfix}\AtBeginDocument\@firstofone{%
-    \@ifundefined{@@magyar at captionfix}{}{%
-      \g at addto@macro\@@magyar at captionfix{%
-        \let\caption at lfmt@simple at magyar\caption at lfmt@simpleMagyar
-        \let\caption at lfmt@simpleMagyar\caption at lfmt@default at magyar}}}
+}{%
+  \let\caption at 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}
-  \caption at declarelabelseparator
-    {\caption at ifbeamertemplate{caption name own line}\@gobble\@firstofone}
-    {default}
-    {\caption at 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}
+\caption at ifdecl{labelseparator}{french}
+  {\let\caption at french@labelseparator\@undefined}%
+  {\caption@@set{labelseparator}{labelseparator at french}{default}%
+   \let\caption at french@labelseparator\caption at labelseparator@french}
 %    \end{macrocode}
-%    \begin{macrocode}
-  \DeclareOption{beamerclass}{%
-    \renewcommand\caption at ifslc{%
-      \caption at 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}
-%    \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 at IfBabelFrench}
+%   |\caption at IfBabelFrench|\marg{yes-code}\marg{no-code}
 %    \begin{macrocode}
-  \defbeamertemplate{caption}{caption3}{%
-    \caption at make\insertcaptionname\insertcaptionnumber\insertcaption}
+\newcommand*\caption at IfBabelFrench{%
+  \caption at IfBabelPackageLoaded{french}{\FB at makecaption}}
+\@onlypreamble\caption at IfBabelFrench
 %    \end{macrocode}
 %    \begin{macrocode}
-  \DeclareOption{beamer}{%
-    % \usebeamertemplate**{caption} will set font
-    \DeclareCaptionDefaultFont{font}{}%
-    \setbeamertemplate{caption}[caption3]}
+\providecommand*\caption at ifbabel@french{true}
 %    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
-%
-%    \begin{macrocode]
-}{}
+\caption at 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 at ifclassloaded{koma}{%
+  \ifx\caption at french@labelseparator\caption at labelseparator@french % still set to dummy label separator?
+    \DeclareCaptionLabelSeparator{french}{%
+      \ifFBCustomiseFigTabCaptions
+        \CaptionSeparator
+      \else
+        \space : %
+      \fi}%
+  \fi
+  \caption at ifdefined\extrasfrench{%
+    \addto\extrasfrench{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{french}}}{}%
 %    \end{macrocode}
+%
+% Suppress the warning about load order (since it's not longer valid anymore).
 %    \begin{macrocode}
-  \DeclareCaptionFormat{default}[#1#2#3\par]{%
-    \ifdofullc at p
-      \caption at ifin@list\caption at lsepcrlist\caption at lsepname
-        {\caption at Error{%
-           The option `labelsep=\caption at lsepname' does not work\MessageBreak
-           with \noexpand\setcaphanging (which is set by default)}}%
-        {\caption at fmt@hang{#1}{#2}{#3}}%
-    \else
-      #1#2%
-      \ifdim\cap at indent<\z@
-        \par
-        \noindent\hspace*{-\cap at indent}%
-      \else\if at capbreak
-        \par
-      \fi\fi
-      #3\par
-    \fi}
-  \DeclareCaptionLabelSeparator{default}{\captionformat}
-  \DeclareCaptionDefaultFont{font}{\scr at fnt@caption}
-  \DeclareCaptionDefaultFont{labelfont}{\scr at fnt@captionlabel}
+  \caption at AtBeginDocument{\@nameuse{@FBwarning at capsepfalse}}%
 %    \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 at 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 at KV@parindent\KV at caption@parindent
-  \DeclareCaptionOption{parindent}[]{%
-    \ifx,#1,%
-      \caption at Debug{Option `parindent' ignored}%
-    \else
-      \caption at KV@parindent{#1}%
-    \fi}%
-%    \end{macrocode}
-%    \begin{macrocode}
-  \let\caption at KV@parskip\KV at caption@parskip
-  \DeclareCaptionOption{parskip}[]{%
-    \ifx,#1,%
-      \caption at Debug{Option `parskip' ignored}%
-    \else
-      \caption at KV@parskip{#1}%
-    \fi}%
-%    \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 at IfFrenchLe}
+%   |\caption at IfFrenchLe|\marg{yes-code}\marg{no-code}
 %    \begin{macrocode}
-\caption at ifclassloaded{ntg}{%
+\newcommand*\caption at IfFrenchLe{%
+  \caption at IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
+\@onlypreamble\caption at IfBabelFrenchLe
 %    \end{macrocode}
 %    \begin{macrocode}
-  \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
-  \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
+\providecommand*\caption at ifbabel@frenchle{true}
 %    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
-}{}
+\caption at 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 at ifclassloaded{thesis}{%
+  \ifx\caption at french@labelseparator\caption at labelseparator@french % still set to dummy label separator?
+    \DeclareCaptionLabelSeparator{french}{\captionseparator\space}%
+  \fi
+  \g at addto@macro\extrasfrench{%
+    \caption at switchdefault{labelseparator}{\let\caption at original@labelseparator#1}{french}%
+    \caption at switchdefault{font}{\let\caption at original@font#1}{it}%
+    \caption at switchdefault{labelfont}{\let\caption at original@labelfont#1}{up}}%
+  \g at addto@macro\extrasenglish{%
+    \caption at restoredefault{labelseparator}{\caption at original@labelseparator}%
+    \caption at restoredefault{font}{\caption at original@font}%
+    \caption at restoredefault{labelfont}{\caption at 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 at font}
-  \DeclareCaptionDefaultFont{textfont}{\cpb at font}
+  \caption at AtBeginDocument{%
+    \let\captionfont at original\captionfont
+    \let\captionlabelfont at original\captionlabelfont}%
+  \g at addto@macro\GOfrench{%
+    \let\captionfont\captionfont at original
+    \let\captionlabelfont\captionlabelfont at 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 at ifdefined\ArabiCoreLoaded{%
+\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
 %    \end{macrocode}
 %
-% \begin{macro}{\caption at rl}
-% \changes{v1.8}{2018/05/20}{This macro added}
+% \begin{macro}{\caption at IfBabelHungarian}
+%   |\caption at IfBabelHungarian|\marg{yes-code}\marg{no-code}
 %    \begin{macrocode}
-  \newcommand\caption at rl[1]{\if at rl\textRL{#1}\else\textLR{#1}\fi}
+\newcommand*\caption at IfBabelHungarian{%
+  \caption at IfBabelPackageLoaded{hungarian}{\magyar at opt@defaults}}
+\@onlypreamble\caption at IfBabelHungarian
 %    \end{macrocode}
+%    \begin{macrocode}
+\providecommand*\caption at ifbabel@hungarian{true}
+%    \end{macrocode}
 % \end{macro}
 %
 %    \begin{macrocode}
-  \def\fnum at figure{\figurename\nobreakspace\thefigure}%
-  \def\fnum at table{\tablename\nobreakspace\thetable}%
+\caption at IfBabelHungarian{%
 %    \end{macrocode}
-%    \begin{macrocode}
-  \DeclareCaptionLabelSeparator{arabi}{ : }
-  \DeclareCaptionLabelSeparator{default}{%
-    \if at rl\caption at lsep@arabi\else\caption at lsep@colon\fi}
-%    \end{macrocode}
-%    \begin{macrocode}
-}{%
-  \let\caption at rl\@firstofone
-}
-%    \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 at ifdefined\FB at makecaption{%
+  \caption at ifdefined\extrashungarian{%
+    \addto\extrashungarian{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{magyar}%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{period}%
+      \caption at switchdefault{listformat}{\babel at save #1}{subperiod}}}{}%
+  \caption at ifdefined\extrasmagyar{%
+    \addto\extrasmagyar{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{magyar}%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{period}%
+      \caption at switchdefault{listformat}{\babel at save #1}{subperiod}}}{}%
 %    \end{macrocode}
+%
 %    \begin{macrocode}
-  \ifx\@makecaption\STD at makecaption
-    \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
-    \def\caption at frenchb{% supress frenchb warning
-      \let\STD at makecaption\@makecaption
-      \let\FB at makecaption\@makecaption}
-  \else
-    \ifx\@makecaption\@undefined\else
-      \caption at InfoNoLine{%
-        The definition of \protect\@makecaption\space
-        has been changed,\MessageBreak
-        frenchb will NOT customize it}%
-    \fi
-  \fi
-%    \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 at ifdefined\frenchTeXmods{%
+\DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
 %    \end{macrocode}
+%
+% \begin{macro}{\caption at IfBabelLatvian}
+%   |\caption at IfBabelLatvian|\marg{yes-code}\marg{no-code}
 %    \begin{macrocode}
-  \DeclareCaptionDefaultFont{textfont}{\itshape}%
-  \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+\newcommand*\caption at IfBabelLatvian{%
+  \caption at IfBabelPackageLoaded{latvian}{\bbl at latvianindent}}
+\@onlypreamble\caption at IfBabelLatvian
 %    \end{macrocode}
 %    \begin{macrocode}
-}{}
+\providecommand*\caption at ifbabel@latvian{true}
 %    \end{macrocode}
+% \end{macro}
 %
-% \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}
-%
 %    \begin{macrocode}
-\DeclareCaptionListFormat{subperiod}{#2.}
+\caption at IfBabelLatvian{%
 %    \end{macrocode}
 %
+% If the language `latvian' is selected, we switch the default label format to `latvian'.
+%
 %    \begin{macrocode}
-\def\caption at tempa#1{%
-  \@ifpackagewith{babel}{#1}{%
-    \caption at InfoNoLine{#1 babel option is loaded}%
-    \expandafter\addto\csname extras#1\endcsname{%
-       % change default labelsep and listformat
-       \caption at setdefaultlabelsep{period}%
-       \caption at setdefaultlistformat{subperiod}}%
-    \expandafter\addto\csname noextras#1\endcsname{%
-       % change default labelsep and listformat
-       \caption at setdefaultlabelsep{colon}%
-       \caption at setdefaultlistformat{subsimple}}%
-  }{}}
+  \caption at ifdefined\extraslatvian{%
+    \addto\extraslatvian{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{latvian}}}{}%
 %    \end{macrocode}
+%
 %    \begin{macrocode}
-\caption at tempa{hungarian}
-\caption at tempa{magyar}
+}{}
 %    \end{macrocode}
 %
-% TODO: babel-latvian/latvian.ldf
-%
 % \section{Package support}
 %
-% \begin{macro}{\caption at xpackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption at 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 at ifpackageloaded}
+% \changes{v2.0}{2020/07/26}{This macro added}
+%   |\caption at 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 at xpackage[2]{%
-  \expandafter\ifx\csname ver@#2.\caption at pkgextension\endcsname\relax
-    \expandafter\@firstofone
+\newcommand*\caption at ifpackageloaded[1]{%
+  \expandafter\ifx\csname ver@#1.\caption at pkgextension\endcsname\relax
+    \expandafter\@secondoftwo
   \else
-    \expandafter\@gobbletwo
-  \fi
-  {#1{#2}}}
+    \expandafter\@firstoftwo
+  \fi}
 %    \end{macrocode}
 %    \begin{macrocode}
 \let\caption at pkgextension\@pkgextension
@@ -3017,48 +3284,41 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at loadpackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption at loadpackage|\marg{package}\marg{caption option}
-% loads the given package immediately.
+% \begin{macro}{\caption at 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 at pkg@list|\-|{{|\meta{package}|}}|,
+%    so this macro should always be defined, even if we don't use it anymore.)
 %    \begin{macrocode}
-\newcommand*\caption at loadpackage{%
-  \caption at xpackage\caption@@loadpackage}
+\newcommand*\caption at pkg@list{}
 %    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption@@loadpackage[2]{%
-  \caption at Info{Option `#2' requires the `#1' package}%
-  \RequirePackage{#1}\relax}
-%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at requirepackage}
 % \changes{v1.10}{2020/05/10}{This macro added}
-% |\caption at 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 at requirepackage|\marg{package}\marg{option}\marg{value}\\
+%   indicates that the given package option needs a package.
 %    \begin{macrocode}
-\newcommand*\caption at requirepackage{%
-  \caption at xpackage\caption@@requirepackage}
+\newcommand*\caption at requirepackage[2]{%
+  \caption at ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption@@requirepackage[2]{%
-  \@cons\caption at packagelist{{#1}{#2}}}% load package later on
+  \@cons\caption at packagelist{{#1}{#2}}} % load package later on
 %    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at 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 at 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 at pkg@list{}
+\caption at AtBeginDocument{%
+  \renewcommand*\caption@@requirepackage[2]{%
+    \caption at Error{Option `#2' requires the `#1' package}}}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at 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 at packagelist{}
 \@onlypreamble\caption at packagelist
@@ -3071,35 +3331,108 @@
     \g at addto@macro\caption at tempa{%
       \caption at loadpackage{#1}{#2}}}%
   \caption at packagelist
-  \caption at tempa
+  \caption at tempa}
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption at loadpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% \changes{v2.0}{2020/07/26}{This macro revised}
+%   |\caption at loadpackage|\marg{package}\marg{option}\marg{value}\\
+%   loads the given package immediately.
 %    \begin{macrocode}
-  \renewcommand*\caption@@loadpackage[2]{%
-    \caption at Error{Option `#2' requires the `#1' package}}%
-  \let\caption@@requirepackage\caption@@loadpackage
-  }
+\newcommand*\caption at loadpackage[2]{%
+  \caption at ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
 %    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption@@loadpackage[2]{%
+  \caption at Info{Option `#2' requires the `#1' package}%
+  \RequirePackage{#1}\relax}
+%    \end{macrocode}
+%    \begin{macrocode}
+\caption at AtBeginDocument{%
+  \let\caption@@loadpackage\caption@@requirepackage}
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at usepackage}
-% \changes{v1.11}{2020/05/10}{This macro added}
-% |\caption at 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 at usepackage[3]{%
-  \IfCaptionOptionCheck
-    {\caption at requirepackage{#1}{#2}}%
-    {\let\KV at prefix@ORI\KV at prefix
-     \let\@tempc at ORI\@tempc
-     \caption at loadpackage{#1}{#2}%
-     #3%
-     \let\@tempc\@tempc at ORI
-     \let\KV at prefix\KV at prefix@ORI}}
+\caption at AtBeginDocument{%
+  \def\@tempa{2008/08/02 v0.3b floatrow: float package extension}%
+  \expandafter\ifx\csname ver at floatrow.sty\endcsname\@tempa
+    \caption at InfoNoLine{floatrow package v0.3b is loaded}%
+%    \end{macrocode}
+%
+% \begin{macro}{\captionlabel}
+%   |\caption at format| needs to be expanded prior the use of |\caption@@@make|.
+%    \begin{macrocode}
+    \renewcommand\captionlabel[1]{{% l.559
+      \def\FR at tmp{\@captype}%
+      \ifnum\floatbox at depth>\@ne
+        \def\FR at tmp{sub\@captype}\caption at setsubtype*{\FR at tmp}\stepcounter{\FR at tmp}%
+      \fi
+      \caption at format % <= This line added
+      \caption@@@make{\caption at fnum\FR at tmp}{#1}}}
+%    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\flrow at setstyle}
+%   This patch isn't working since |\flrow at setstyle| will be used by
+%   \package{floatrow} right after loading \package{caption3}.
+%   For this reason we still define |\caption at sty@|\meta{name} in
+%   |\Declare|\-|Caption|\-|Style| instead.
+%    \begin{macrocode}
+%   \renewcommand*\flrow at setstyle[1]{% l.986
+%     \@ifundefined{flrow at sty@#1}%
+%       {\flrow at error{Undefined float style `#1'}}%
+%       {\FBstyle at reset
+%        \def\flrow at capsetup{%
+%           \caption at ifdecl{style}{#1}{\caption at setstyle*{#1}}{}%
+%           \caption at setoptions{#1}}%
+%        \flrow at esetup{\csname flrow at sty@#1\endcsname}}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow at FBoAlign}
+%   This patch isn't working since |\flrow at FBoAlign| will be used by
+%   \package{floatrow} right after loading \package{caption3}.
+%   For this reason we still define |\caption at hj@|\meta{name} in
+%   |\Declare|\-|Caption|\-|Justification| instead.
+%    \begin{macrocode}
+%   \renewcommand*\flrow at FBoAlign[1]{% l.1168
+%     \caption at ifdecl{justification}{#1}%
+%       {\expandafter\let\expandafter\floatobjectset
+%          \csname caption at justification@#1\endcsname}%
+%       {\flrow at error{Undefined object setting `#1'}}}%
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flrow at setFRsep}
+%   This patch isn't working since |\flrow at setFRsep| will be used by
+%   \package{floatrow} right after loading \package{caption3}.
+%   For this reason we still define |\caption at lsep@|\meta{name} in
+%   |\Declare|\-|Caption|\-|Label|\-|Separator| instead.
+%    \begin{macrocode}
+%   \renewcommand*\flrow at setFRsep[2]{% l.1187
+%     \caption at ifdecl{labelseparator}{#2}%
+%       {\@nameuse{caption at labelseparator@#2}% defines \caption at labelsep
+%        \let#1\caption at labelsep}%
+%       {\flrow at error{Undefined float separator `#2'}}}%
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+  \fi}
+%    \end{macrocode}
+%
 % \subsection{The newfloat package}
 %
 % \begin{macro}{\caption at newfloat}
@@ -3106,10 +3439,23 @@
 % \changes{v1.4b}{2012/01/12}{This macro added}
 % \changes{v1.8h}{2020/01/03}{Usage of \cs{caption at ifpackageloaded} replaced by \cs{RequirePackage}}
 % \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption at usepackage}}
-% |\caption at newfloat|\marg{option}\marg{code}
-% loads the \package{newfloat} package and executes the given code afterwards.
+% \changes{v2.0}{2020/07/27}{This macro revised}
+%   |\caption at 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 at newfloat{\caption at usepackage{newfloat}}
+\newcommand*\caption at newfloat[2]{%
+  \IfCaptionOptionCheck
+    {\caption at requirepackage{newfloat}{#1}}%
+    {\let\KV at prefix@ORI\KV at prefix
+     \let\@tempc at ORI\@tempc
+     \caption at loadpackage{newfloat}{#1}%
+     #2%
+     \let\@tempc\@tempc at ORI
+     \let\KV at prefix\KV at 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 at newfloat} now}
-%  |\caption at SetName|\marg{float}\marg{name}
-%    \begin{macrocode}
+%   |\caption at SetName|\marg{float}\marg{name}\\
+%   loads the \package{newfloat} package and uses |\newfloat at set|\-|name|.
+%   \begin{macrocode}
 \newcommand*\caption at SetName[2]{%
   \caption at newfloat{#1name}{\newfloat at setname{#1}{#2}}}
 \@onlypreamble\caption at SetName
@@ -3152,7 +3499,8 @@
 %    \end{macrocode}
 %
 % \begin{macro}{\caption at setname}
-%  |\caption at setname|\marg{float}\marg{name}
+%   |\caption at setname|\marg{float}\marg{name}\\
+%   sets the given float name, e.g.: `Figure` for `figure`.
 %    \begin{macrocode}
 \newcommand*\caption at 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 at newfloat} now}
-% |\caption at within|\marg{float}\marg{value}
+%   |\caption at within|\marg{float}\marg{value}\\
+%   loads the \package{newfloat} package and uses |\newfloat at set|\-|within|.
 %    \begin{macrocode}
 \newcommand*\caption at within[2]{%
-  \caption at newfloat{#1within}{\newfloat at setwithin{#1}{#2}}}
+  \caption at newfloat{#1within=#2}{\newfloat at setwithin{#1}{#2}}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3185,7 +3534,7 @@
 %
 %    \begin{macrocode}
 \DeclareCaptionOption{within}{%
-  \caption at newfloat{within}{\newfloatsetup{within=#1}}}
+  \caption at newfloat{within=#1}{\newfloatsetup{within=#1}}}
 \DeclareCaptionOptionNoValue{without}{%
   \caption at 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 at 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 at NEW@dottedxxxline#1#2#3#4#5#6#7{%
   \begingroup
@@ -3269,7 +3619,7 @@
 %
 % \begin{macro}{\sf at subfloat}
 % \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption at warmup} added}
-% New version of |\sf at subfloat|
+%   New version of |\sf at subfloat|
 %    \begin{macrocode}
 \def\sf at NEW@subfloat{%
   \begingroup
@@ -3297,21 +3647,10 @@
 %
 % Make the \package{subfig} package documentation compile.
 %    \begin{macrocode}
-%%\@ifl at aded{dtx}{subfig}{\caption at loadpackage{ragged2e}{}}{} % not needed
 \DeclareCaptionOption{lofdepth}[2]{\caption at ifdefined\c at lofdepth{\setcounter{lofdepth}{#1}}{}}
 \DeclareCaptionOption{lotdepth}[2]{\caption at ifdefined\c at lotdepth{\setcounter{lotdepth}{#1}}{}}
 %    \end{macrocode}
 %
-% \section{Execution of options}
-%
-%    \begin{macrocode}
-\captionsetup{style=default,position=default,%
-              list,listformat=default,twoside=\if at twoside 1\else 0\fi}
-%    \end{macrocode}
-%    \begin{macrocode}
-\ProcessOptions*
-%    \end{macrocode}
-%
 % \section{Making an `List of' entry}
 %
 % \begin{macro}{\caption at addcontentsline}
@@ -3324,10 +3663,9 @@
 % \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption at lstfmt}}
 % \changes{v1.7}{2015/09/20}{Unfortunately \package{subfig} defines and uses \cs{caption at 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 at 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 at 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 at addcontentsline[2]{%
   \caption at ifcontentsline{#2}{%
@@ -3357,7 +3695,7 @@
       \caption at add@contentsline
         {\csname ext@#1\endcsname}%
         {#1}%
-        {\caption at lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+        {\caption at listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
         {\ignorespaces #2}%
       \caption at chkfloat{#1}{#2}}}}
 %    \end{macrocode}
@@ -3400,39 +3738,54 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at aboveskip}
+% \begin{macro}{\caption at belowskip}
+% \changes{v2.0}{2020/08/23}{This macro moved from package to kernel}
+%   |\caption at aboveskip| and |\caption at belowskip|\\
+%   typeset the skip above resp.~below the caption.
+%    \begin{macrocode}
+\newcommand*\caption at aboveskip{%
+  \vskip\abovecaptionskip}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at belowskip{%
+  \vskip\belowcaptionskip}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}{\caption at fnum}
 % \changes{v1.1}{2007/08/21}{This macro added}
-%  |\caption at 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 at original@fnum}}
+%   |\caption at fnum|\marg{float type}\\
+%   typesets the caption label; this acts as replacement for |\fnum@|\meta{float type}.
 %    \begin{macrocode}
-\newcommand*\caption at fnum[1]{\caption at lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
+\newcommand*\caption at fnum[1]{%
+  \expandafter\let\expandafter\caption at original@fnum\csname caption at fnum@#1\endcsname % for label format `original'
+  \caption at labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at make}
-%  |\caption at make|\marg{float name}\marg{ref.\ number}\marg{text}\par
-%  Typesets the caption.
+%   |\caption at make|\marg{float name}\marg{ref.\ number}\marg{text}\\
+%   typesets the caption.
 %    \begin{macrocode}
-\newcommand\caption at make[2]{\caption@@make{\caption at lfmt{#1}{#2}}}
+\newcommand\caption at make[2]{\caption@@make{\caption at 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 at ifh} added}
+% \changes{v1.0c}{2005/02/09}{Improvement: \cs{caption at 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 at slc} now}
-% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption at calcmargin} inside
-%        single-line-check replaced by \cs{relax}}
-% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption at startbox} will always be
-%        typeset in horizontal mode}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption at calcmargin} inside single-line-check replaced by \cs{relax}}
+% \changes{v1.0g}{2006/01/11}{Bugfix: \cs{caption at startbox} will always be typeset in horizontal mode}
 % \changes{v1.0i}{2006/05/13}{Uses \cs{caption at parbox} instead of \cs{caption at 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 at ifoddpage} added}
@@ -3443,7 +3796,7 @@
 % \changes{v1.6}{2013/05/01}{Usage of \cs{caption at 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,18 +3809,15 @@
   \caption at stepthecounter
   \caption at beginhook
 %    \end{macrocode}
-%
-% Typeset the outer box |\caption at box|
+%   Typeset the outer box |\caption at box|
 %    \begin{macrocode}
   \caption at box\hsize{%
 %    \end{macrocode}
-%
-% Special single-line treatment (option |singlelinecheck=|)
+%   Special single-line treatment (option |singlelinecheck=|)
 %    \begin{macrocode}
-    \caption at ifslc{\caption at slc{#1}{#2}\caption at singleline\relax}{}%
+    \caption at singlelinecheck{\caption at slc{#1}{#2}\caption at singleline\caption at multiline}{\caption at multiline}%
 %    \end{macrocode}
-%
-% Typeset the left margin (option |margin=|)
+%   Typeset the left margin (option |margin=|)
 %    \begin{macrocode}
     \caption at calcmargin
     \caption at tempdima\captionmargin
@@ -3474,25 +3824,23 @@
     \ifdim\captionmargin@=\z@ \else
       \caption at ifoddpage{}{\advance\caption at tempdima\captionmargin@}%
     \fi
-    \caption at ifh{\advance\caption at tempdima\caption at indent}%
+    \caption at ifhmode{\advance\caption at tempdima\caption at indent}%
     \hspace\caption at tempdima
 %    \end{macrocode}
-%
-% We actually use a |\vbox| of width |\captionwidth - \caption at 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 at indent|
+%   to typeset the caption.
+%   \Note{\cs{captionindent} is \emph{not} supported if the caption format
+%   was defined with \cs{DeclareCaptionFormat*}.}
 %    \begin{macrocode}
     \caption at tempdima\captionwidth
-    \caption at ifh{\advance\caption at tempdima-\caption at indent}%
+    \caption at ifhmode{\advance\caption at tempdima-\caption at indent}%
     \caption at parbox\caption at tempdima{%
 %    \end{macrocode}
-%
-% Typeset the indention (option |indention=|)\\
-% {\small Bugfix 04-05-05:
-%  |\hskip-\caption at indent| replaced by |\ifdim\caption at indent=\z@|\ldots}
+%   Typeset the indention (option |indention=|)\\
+%   {\small Bugfix 04-05-05:
+%    |\hskip-\caption at indent| replaced by |\ifdim\caption at indent=\z@|\ldots}
 %    \begin{macrocode}
-      \caption at ifh{%
+      \caption at ifhmode{%
         \ifdim\caption at indent=\z@
           \leavevmode
         \else
@@ -3499,13 +3847,11 @@
           \hskip-\caption at indent
         \fi}%
 %    \end{macrocode}
-%
-% Typeset the caption itself and close the |\caption at parbox|
+%   Typeset the caption itself and close the |\caption at parbox|
 %    \begin{macrocode}
       \caption@@@make{#1}{#2}}%
 %    \end{macrocode}
-%
-% Typeset the right margin (option |margin=|)
+%   Typeset the right margin (option |margin=|)
 %    \begin{macrocode}
     \caption at tempdima\captionmargin
     \ifdim\captionmargin@=\z@ \else
@@ -3513,12 +3859,10 @@
     \fi
     \hspace\caption at tempdima
 %    \end{macrocode}
-%
-% Close the outer box |\caption at box|
+%   Close the outer box |\caption at box|
 %    \begin{macrocode}
   }%
 %    \end{macrocode}
-%
 %    \begin{macrocode}
   \caption at 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 at calcmargin|\par
-%  Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
-%  values.
+%   |\caption at calcmargin|\\
+%   calculates |\caption|\-|margin| and |\caption|\-|width|, so both contain
+%   valid values.
 %    \begin{macrocode}
 \newcommand*\caption at calcmargin{%
   \caption at calcmargin@hook
 %    \end{macrocode}
-% Check margin, if |\caption at minmargin| or |\caption at maxmargin| is set
+%   Check margin, if |\caption at min|\-|margin| or |\caption at max|\-|margin| is set
 %    \begin{macrocode}
   \ifx\caption at maxmargin\@undefined \else
     \ifdim\captionmargin>\caption at maxmargin\relax
@@ -3579,16 +3923,15 @@
 % \end{macro}
 %
 % \begin{macro}{\caption at slc}
-% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption at hj}\cs{relax} added}
-% \changes{v1.1}{2007/07/29}{\cs{caption at setup}\cs{caption at sls} added after \cs{begingroup}}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption at justification}\cs{relax} added}
+% \changes{v1.1}{2007/07/29}{\cs{caption at setup}\cs{\caption at sls} added after \cs{begingroup}}
 % \changes{v1.1}{2007/07/29}{\cs{caption at calcmargin} added}
-% \changes{v1.1c}{2007/10/14}{Support of \cs{caption at slfmt} added}
-% \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency}
+% \changes{v1.1c}{2007/10/14}{\cs{caption at setup}\cs{\caption at opt@SingleLine} outsourced to \cs{caption at SingleLine}}
 % \changes{v1.3}{2010/09/04}{Split into \cs{caption at 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 at 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 at slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\\
+%   This one does the single-line-check.
 %    \begin{macrocode}
 \newcommand\caption at slc[4]{%
   \caption at Debug{Begin SLC}%
@@ -3595,7 +3938,7 @@
   \singlelinecaptiontrue
   \begingroup
   \caption at singleline
-  \let\caption at hj\@empty
+  \let\caption at justification\relax
   \caption at calcmargin % calculate \captionwidth
   \caption at prepareslc
   \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
@@ -3609,27 +3952,52 @@
   \fi
   \caption at 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 at singleline}
+% \changes{v1.1c}{2007/10/14}{This macro extracted from \cs{caption at slc}}
+% \changes{v1.1c}{2007/10/14}{Support of \cs{caption at slfmt} added}
+% \changes{v1.1d}{2007/10/23}{This macro renamed from \cs{caption at SingleLine} to \cs{caption at singleline} for consistency}
+%   |\caption at singleline|\\
+%   prepares the typesetting of a single-line caption.
 %    \begin{macrocode}
 \newcommand*\caption at singleline{%
-  \caption at xsetup\caption at opt@singleline
+  \caption at xsetup\caption at slsty % Note: This could change \caption at format
+  \caption at format               % defines \caption at ifhmode, \caption at slfmt, and \caption at fmt
   \let\caption at fmt\caption at slfmt}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\caption at multiline}
+% \changes{v2.0}{2020/07/28}{This macro added}
+%   |\caption at multiline|\\
+%   prepares the typesetting of a multi-line caption.
+%    \begin{macrocode}
+\newcommand*\caption at multiline{%
+  \caption at format}              % defines \caption at ifhmode, \caption at slfmt, and \caption at fmt
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\caption at 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 at hj}\cs{relax} added}
+% \changes{v1.0c}{2005/02/12}{\cs{let}\cs{caption at 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 at hj}\cs{relax} moved to \cs{caption at slc}}
+% \changes{v1.1}{2007/06/13}{\cs{let}\cs{caption at justification}\cs{relax} moved to \cs{caption at 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 at 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)}
@@ -3636,9 +4004,8 @@
 % \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 at prepareslc|\par
-%  Re-define anything which would disturb the single-line-check.
+%   |\caption at prepareslc|\\
+%   re-defines anything which could disturb the single-line-check.
 %    \begin{macrocode}
 \providecommand*\caption at prepareslc{}
 \g at addto@macro\caption at prepareslc{%
@@ -3645,11 +4012,12 @@
   \let\label\caption at 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 at footnote@ORI\footnote
   \def\footnote{\caption at withoptargs\caption at footnote}%
@@ -3658,7 +4026,7 @@
   \let\caption at footnotetext@ORI\@footnotetext
   \let\@footnotetext\caption at gobble
 %    \end{macrocode}
-% Same for \cs{endnote}
+%   Same for \cs{endnote}
 %    \begin{macrocode}
   \let\caption at endnote@ORI\endnote
   \def\endnote{\caption at withoptargs\caption at endnote}%
@@ -3667,22 +4035,19 @@
   \let\caption at endnotetext@ORI\@endnotetext
   \let\@endnotetext\caption at gobble
 %    \end{macrocode}
+%   Adaption to the \package{acronym} package\par
+%   See also \url{https://tex.stackexchange.com/questions/428788}
 %    \begin{macrocode}
-  \let\pagenote\caption at gobble
-%    \end{macrocode}
-% Adaption to the \package{acronym} package\par
-% See also \url{https://tex.stackexchange.com/questions/428788}
-%    \begin{macrocode}
   \let\acused\@gobble
   \let\AC at 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 at 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 at footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
-% in \class{beamer} to offer a less dirty patch.)
-%    \begin{macrocode}
-\caption at ifclassloaded{beamer}{%
-  \g at addto@macro\caption at prepareslc{%
-    \def\footnote{%
-      \begingroup
-      \let\stepcounter\caption at l@stepcounter
-      \renewcommand<>\beamer at framefootnotetext[1]{%
-        \endgroup}%
-      \let\@footnotetext\beamer at framefootnotetext
-      \caption at footnote@ORI}}}{}
-%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\caption at applyfont}
 % \changes{v1.3}{2010/09/04}{This macro added}
-%  |\caption at applyfont|\par
-%  This macro executes the font relevant macros, i.e. by default
-%  the options set by |justification=|, |font=|, and |size=|.
+%   |\caption at applyfont|\\
+%   applies the relevant font settings, i.e. by default
+%   the options set by |justification=|, |font=|, and |size=|.
 %    \begin{macrocode}
 \newcommand*\caption at applyfont{%
-  \caption at hj\captionfont\captionsize}
+  \caption at 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 at ifempty};
-%        \cs{let}\cs{caption at ifstrut}\cs{@secondoftwo} added}
+% \changes{v1.0d}{2005/05/05}{Use \cs{caption at ifempty}; \cs{let}\cs{caption at ifstrut}\cs{@secondoftwo} added}
 % \changes{v1.0d}{2005/05/05}{Bugfix: Handling of \cs{ifcaption at star} changed}
 % \changes{v1.0f}{2005/08/24}{Check for empty label added}
 % \changes{v1.0f}{2005/08/25}{\cs{caption at iflf} added}
-% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption at tfmt} added}
+% \changes{v1.0j}{2007/02/18}{Usage of \cs{caption at 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 at 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 at 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 at 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 at 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 at lsep\relax
+    \caption at 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 at ifempty{#2}{%
-    \let\caption at lsep\@empty
-    \let\caption at tfmt\@firstofone
+    \caption at set{labelseparator}{none}%
+    \caption at set{textformat}{simple}%
 %   \@capbreakfalse
 %   \let\caption at ifstrut\@secondoftwo
   }%
 %    \end{macrocode}
-%
-% Take care that |\caption at parindent| and |\caption at hangindent| will be used
-% to typeset the paragraph.
 %    \begin{macrocode}
+  \caption at labelseparator % defines \caption at iflabelfont, \caption at labelsep and \caption at labelsep@name (the latter is needed by \caption at fmt)
+%    \end{macrocode}
+%   Take care that |\caption at par|\-|indent| and |\caption at 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 at applyfont
   \caption at fmt
@@ -3808,26 +4151,26 @@
      \fi}%
     {\ifcaption at star\else
        \begingroup
-         \caption at iflf\captionlabelfont
-         \relax\caption at lsep
+         \caption at iflabelfont\captionlabelfont
+         \relax\caption at labelsep
        \endgroup
      \fi}%
     {{\captiontextfont
-      \captiontextstart
+      \caption at textstart
       \caption at ifstrut
         {\vrule\@height\ht\strutbox\@width\z@}%
         {}%
       \nobreak\hskip\z at skip % enable hyphenation
-      \caption at tfmt{#2}%
+      \caption at textformat{#2}%
 %     \caption at ifstrut{\vrule\@height\z@\@depth\dp\strutbox\@width\z@}{}%
       \caption at ifstrut
         {\ifhmode\@finalstrut\strutbox\fi}%
         {}%
-      \captiontextend}}}
+      \caption at textend}}}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\captiontextstart{}
-\newcommand*\captiontextend{\par}
+\newcommand*\caption at textstart{}
+\newcommand*\caption at 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 at 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 at 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 at ifempty[1]{%
   \caption at 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 at parindent\hangindent\caption at hangindent}%
@@ -3909,30 +4252,48 @@
 % \changes{v1.2b}{2008/08/02}{Support of \cs{float at exts} and \cs{float at addtolists} added}
 % \changes{v1.2e}{2010/01/09}{Usage of \cs{caption at 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 at loadpackage{newfloat}{}%
+  \caption at loadpackage{newfloat}{declare type}%
   \DeclareFloatingEnvironment}
 \@onlypreamble\DeclareCaptionType
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at ForEachType}
+% \begin{macro}{\ForEachCaptionType}
 % \changes{v1.4a}{2011/10/29}{This macro added}
-% |\caption at ForEachType|\marg{code}
-% will execute the given code for all (known) floating environments.
+% \changes{v1.13}{2020/07/29}{Renamed from \cs{caption at 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\caption at ForEachType[1]{%
+\newcommand*\ForEachCaptionType{%
+  \@ifstar
+    {\caption at foreach@type\@gobble}%
+    {\caption at foreach@type\@iden}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand\caption at foreach@type[2]{%
   \caption at ifdefined\ForEachFloatingEnvironment
-    {\ForEachFloatingEnvironment{#1}}%
-    {\def\@elt##1{#1}%
+    {\ForEachFloatingEnvironment*{#2}}%
+    {\def\@elt##1{#2}%
      \caption at ifdefined\c at figure\@elt\@gobble{figure}%
      \caption at ifdefined\c at table\@elt\@gobble{table}%
-     \let\@elt\relax
-     \newfloat at addtohook{#1}}}
+     \let\@elt\relax}%
+  #1{\newfloat at addtohook{#2}}}
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat at addtohook}
+%   |\newfloat at 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 at addtohook[1]{%
   \toks@=\expandafter{\newfloat at hook{##1}#1}%
@@ -3939,6 +4300,10 @@
   \edef\@tempa{\def\noexpand\newfloat at hook####1{\the\toks@}}%
   \@tempa}
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat at hook}
+%   Hook used in |\Declare|\-|Floating|\-|Environment|.
 %    \begin{macrocode}
 \providecommand*\newfloat at 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 at 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 at l@addto at list} instead of \cs{@cons} now}
+% \changes{v1.13}{2020/07/29}{Usage of \cs{caption at 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 at teststar\caption at declaresubtype\@firstoftwo\@secondoftwo}
@@ -3973,41 +4340,44 @@
 \def\caption@@declaresubtype#1[#2]#3{%
   \@ifundefined{c@#3}%
     {\caption at 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 at ifsubtype{sub#3}%
-     {\caption at Debug{Modify subtype `sub#3'}}%
-     {\caption at Debug{New subtype `sub#3'}%
-      \@ifundefined{c at sub#3}%
-        {\newcounter{sub#3}\relax}%
-        {\caption at Warning{Using already defined counter `sub#3'}}%
-      \@addtoreset{sub#3}{#3}%
-      \@namedef{ext at sub#3}{\csname ext@#3\endcsname}%
-      \caption at declaresublistentry{#3}%
-      \@cons\caption at subtypelist{{#3}}}%
+\newcommand*\caption@@@declaresubtype[4]{%
 %    \end{macrocode}
-% Support of \package{titletoc} package
 %    \begin{macrocode}
-     \caption at ifdefined\contentsuse{%
-       \contentsuse{sub#3}{\csname ext at 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 at ifin@list\caption at subtypelist{#4}%
+    {\caption at Debug{Modify subtype `#4'}}%
+    {\caption at Debug{New subtype `#4'}%
+     \newcounter{#4}[{#3}]%
+     \@namedef{ext@#4}{\csname ext@#3\endcsname}%
+     \caption at declaresublistentry{#3}%
+     \caption at l@addto at list\caption at subtypelist{#4}%
+     \caption at 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 at sub#3}{}%
-      \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
-     {\@namedef{p at sub#3}{\csname the#3\endcsname}%
-      \@namedef{thesub#3}{\@nameuse{#2}{sub#3}}}%
-     \@namedef{theHsub#3}{\csname theH#3\endcsname.\arabic{sub#3}}%
-    }}
+    \caption at 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 at declaresublistentry{%
   \caption at ifdefined\l at chapter
     {\caption@@declaresublistentry\l at subsection}%
@@ -4026,12 +4396,12 @@
 %    \begin{macrocode}
 \long\def\caption@@@declaresublistentry#1\@dottedtocline#2\caption at 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 at nil
   \else
-% No
+%   No
     \caption@@@@declaresublistentry{#3}@{3.8em}{3.2em}\caption at nil
   \fi}
 \@onlypreamble\caption@@@declaresublistentry
@@ -4067,8 +4437,8 @@
 % \end{macro}
 %
 % \begin{macro}{\caption at 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 at subtypelist{}
 %    \end{macrocode}
@@ -4076,54 +4446,69 @@
 %
 % \begin{macro}{\caption at 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 at ifin@list} now}
+%   |\caption at ifsubtype|\marg{yes-code}\marg{no-code}\\
+%   checks if the given subtype was defined with
+%   |\Declare|\-|Caption|\-|Sub|\-|Type|.
 %    \begin{macrocode}
-\newcommand*\caption at ifsubtype[1]{%
-  \begingroup
-    \let\next\@secondoftwo
-    \edef\@tempa{#1}%
-    \def\@elt##1{%
-      \def\@tempb{sub##1}%
-      \ifx\@tempa\@tempb
-        \let\next\@firstoftwo
-     \fi}%
-    \caption at subtypelist
-  \expandafter\endgroup\next}
+\newcommand*\caption at ifsubtype{%
+  \caption at ifin@list\caption at subtypelist}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\ForEachCaptionSubType}
+% \changes{v1.13}{2020/07/29}{This macro added as replacement for \cs{caption at 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 at foreach@subtype\@gobble}%
+    {\caption at foreach@subtype\@iden}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand\caption at foreach@subtype[2]{%
+  \caption at for@list\caption at subtypelist{#2}%
+  #1{\caption at addto@subtype at hook{#2}}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\providecommand\caption at addto@subtype at hook[1]{%
+  \toks@=\expandafter{\caption at subtype@hook{##1}#1}%
+  \edef\@tempa{\def\noexpand\caption at subtype@hook####1{\the\toks@}}%
+  \@tempa}
+%    \end{macrocode}
+%    \begin{macrocode}
+\providecommand*\caption at 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 at restorecounters}
+% \begin{macro}{\caption at savesubcounters}
 % \changes{v1.5}{2013/05/01}{This macro added}
-% |\caption at restore|\-|counters| restores all counters saved with
-% |\caption at save|\-|counter|.
+% \changes{v1.13}{2020/07/28}{Uses \cs{caption at for@list} now for iterating the list}
+%   |\caption at save|\-|sub|\-|counters|\\
+%   saves all sub-caption counters,
+%   so they can be restored with |\caption at restore|\-|counters| later on.
 %    \begin{macrocode}
-\newcommand*\caption at restorecounters{%
-  \caption at restore@counters
-  \global\let\caption at restore@counters\@empty}
+\newcommand*\caption at savesubcounters{%
+  \caption at for@list\caption at subtypelist{\caption at savecounter{##1}}}
 %    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at restore@counters{}
-%    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\caption at savesubcounters}
+%
+% \begin{macro}{\caption at savecounter}
 % \changes{v1.5}{2013/05/01}{This macro added}
-% |\caption at save|\-|sub|\-|counters| saves all sub-caption counters,
-% so they can be restored with |\caption at restore|\-|counters| later on.
+%   |\caption at save|\-|counter|\marg{counter}\\
+%   saves the given counter, so it can be restored with
+%   |\caption at restore|\-|counters| later on.
 %    \begin{macrocode}
-\newcommand*\caption at savesubcounters{%
-  \def\@elt##1{\caption at savecounter{sub##1}}%
-  \caption at subtypelist
-  \let\@elt\relax}%
-%    \end{macrocode}
-%    \begin{macrocode}
 \newcommand*\caption at savecounter[1]{%
   \edef\caption at tempa{%
     \noexpand\l at addto@macro\noexpand\caption at restore@counters
@@ -4132,26 +4517,42 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\caption at For}
-% \changes{v1.1a}{2007/09/07}{This macro added}
-% \changes{v1.2}{2007/11/16}{Renamed from \cs{ForFloatingEnvironments} to \cs{caption at For}}
-%  |\caption at For|\marg{elt-list}\marg{code with \#1}\\
-%  |\caption at For*|\marg{elt-list}\marg{code with \#1}
+% \begin{macro}{\caption at restorecounters}
+% \changes{v1.5}{2013/05/01}{This macro added}
+%   |\caption at restore|\-|counters|
+%   restores all counters saved with |\caption at save|\-|counter|.
 %    \begin{macrocode}
-\newcommand*\caption at For{%
-  \caption at withoptargs\caption@@For}
-%\@onlypreamble\caption at For
+\newcommand*\caption at restorecounters{%
+  \caption at restore@counters
+  \global\let\caption at restore@counters\@empty}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand\caption@@For[3]{%
-  \caption at AtBeginDocument#1{%
-    \def\@elt##1{#3}%
-    \@nameuse{caption@#2}%
-    \let\@elt\relax}}%
-%\@onlypreamble\caption@@For
+\newcommand*\caption at restore@counters{}
 %    \end{macrocode}
 % \end{macro}
 %
+% \section{Execution of options}
+%
+%    \begin{macrocode}
+\ifx\caption at documentclass\@empty\else
+  \@pushfilename
+  \edef\@currname{caption-\caption at 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

Modified: trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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}

Modified: trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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,13 +799,17 @@
 %
 % \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
 % --------------------------------------------------------------------------- %
 % \fi
@@ -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,7 +935,7 @@
 %
 %    \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}
@@ -931,23 +942,25 @@
 %
 % 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 at 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 at CheckCompatibility{%
+\newcommand*\subcaption at CheckCompatibility{%
 %    \end{macrocode}
 %    \begin{macrocode}
-  \@ifundefined{caption at ifcompatibility}{}{%
-    \caption at ifcompatibility{%
-      \caption at Error{%
-        The `subcaption' package does not work correctly\MessageBreak
-        in compatibility mode}}{}}%
+  \caption at ifcompatibility{%
+    \PackageError{subcaption}%
+      {This package does not work with\MessageBreak
+       caption option `compatibility=v1'}%
+      {\subcaption at eh}%
+    \endinput}{}%
 %    \end{macrocode}
 %    \begin{macrocode}
   \@ifpackageloaded{subfigure}{%
@@ -954,7 +967,7 @@
     \PackageError{subcaption}%
       {This package can't be used in cooperation\MessageBreak
        with the subfigure package}%
-      {\subcaption at EH}%
+      {\subcaption at eh}%
     \endinput}{}%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -962,7 +975,7 @@
     \PackageError{subcaption}%
       {This package can't be used in cooperation\MessageBreak
        with the subfig package}%
-      {\subcaption at EH}%
+      {\subcaption at eh}%
     \endinput}{}%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -969,7 +982,7 @@
 }
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\subcaption at EH{%
+\newcommand*\subcaption at 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}
@@ -976,13 +989,9 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \subcaption at CheckCompatibility
-%    \end{macrocode}
-%    \begin{macrocode}
 \caption at AtBeginDocument{%
   \subcaption at CheckCompatibility
-  \let\subcaption at CheckCompatibility\@undefined
-  \let\subcaption at EH\@undefined
-}
+  \let\subcaption at 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 at 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 at 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 at 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 at For{subtypelist}{%
-  \newenvironment{sub#1}%
+\ForEachCaptionSubType{%
+  \newenvironment{#1}%
     {\@ifnextchar[%]
        \subcaption at iminipage
        {\subcaption at iminipage[c]}}%
     {\subcaption at endminipage
-     \endminipage}}%
+     \endminipage}}
 %    \end{macrocode}
 % We pass all other optional arguments using the generic helper macro
 % |\caption at with|\-|opt|\-|args| offered by the \package{caption} kernel).
@@ -1183,13 +1193,14 @@
 %    \end{macrocode}
 %
 % \begin{macro}{\subcaption at setrefformat}
+% \changes{v1.3g}{2020/07/27}{Adapted to \package{caption3} v2.0}
 %  |\subcaption at setrefformat|\marg{name}\par
 %  Selecting a subref format simply means saving the code (in |\subcaption at reffmt|).
 %    \begin{macrocode}
 \newcommand*\subcaption at setrefformat[1]{%
-  \@ifundefined{caption at lfmt@#1}%
+  \@ifundefined{caption at labelformat@#1}%
     {\caption at Error{Undefined label format `#1'}}%
-    {\expandafter\let\expandafter\subcaption at reffmt\csname caption at lfmt@#1\endcsname}}
+    {\expandafter\let\expandafter\subcaption at reffmt\csname caption at labelformat@#1\endcsname}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \subcaption at setrefformat{simple}
@@ -1200,11 +1211,12 @@
 %
 % We use |\caption at ExecuteOptions| and |\caption at 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 at SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
 \caption at 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 at 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 at hj@default} replaced by \cs{captionbox at 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 at getlabel#3\label{}\@nil
+  \caption at getlabel{#3}%
   #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
   \global\let\caption at 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 at hj@default]%
+    [\wd\@tempboxa][\captionbox at innerpos@default]%
     {\unhbox\@tempboxa}%
   \ignorespaces}
 %    \end{macrocode}

Deleted: trunk/Master/texmf-dist/source/latex/caption/totalcount.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/totalcount.dtx	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/source/latex/caption/totalcount.dtx	2020-08-30 21:10:24 UTC (rev 56213)
@@ -1,384 +0,0 @@
-% \iffalse meta-comment
-% 
-% This is file `totalcount.dtx'.
-% 
-% Copyright (C) 2010-2018 Axel Sommerfeldt (axel.sommerfeldt at 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 at 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 at 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 at edef,\protected at 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 at 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 at counters} delayed}
-% |\DeclareTotalCounter|\marg{counter name}
-%    \begin{macrocode}
-\newcommand*\DeclareTotalCounter[1]{%
-  \newcounter{totalcount@#1}%
-  \@namedef{total#1s}{\nfss at text{\reset at font\bfseries ??}}%
-  \@namedef{total#1es}{\@nameuse{total#1s}}%
-  \expandafter\newif\csname iftotal#1s\endcsname
-  \@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}%
-% \@nameuse{totalcount at set@#1}%
-  \AtBeginDocument{\@ifundefined{c@#1}%
-    {\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
-    {\@cons\totalcount at counters{{#1}}}}}
-\@onlypreamble\DeclareTotalCounter
-%    \end{macrocode}
-%    \begin{macrocode}
-\let\totalcount at counters\@empty
-%    \end{macrocode}
-% \end{macro}
-%
-% \subsection{Declaration of options}
-%
-%    \begin{macrocode}
-\newcommand*\totalcount at xspace{}
-\DeclareOption{xspace}{\renewcommand*\totalcount at xspace{\xspace}}
-%    \end{macrocode}
-%    \begin{macrocode}
-\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
-%    \end{macrocode}
-%
-% \subsection{Execution of options}
-%
-%    \begin{macrocode}
-\ProcessOptions\relax
-\ifx\totalcount at xspace\@empty\else
-  \RequirePackage{xspace}
-\fi
-%    \end{macrocode}
-%
-% \subsection{Main code}
-%
-% \begin{macro}{\totalcount at addtocounter}
-% |\totalcount at addtocounter|\marg{counter name}
-%    \begin{macrocode}
-\newcommand*\totalcount at addtocounter[1]{%
-  \@ifundefined{c at totalcount@#1}{}{%
-    \addtocounter{totalcount@#1}{\value{#1}}}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@stpelt}
-% |\@stpelt|\marg{counter name}
-%    \begin{macrocode}
-\let\totalcount at stpelt@ORI\@stpelt
-\renewcommand*\@stpelt[1]{%
-  \totalcount at addtocounter{#1}%
-  \totalcount at stpelt@ORI{#1}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\totalcount at set}
-% \changes{v1.0a}{2018/01/21}{A negative counter value will be handled correctly now}
-% |\totalcount at set|\marg{counter name}\marg{value}
-%    \begin{macrocode}
-\newcommand*\totalcount at set[2]{%
-  \@ifundefined{c at totalcount@#1}%
-%   {\global\@namedef{totalcount at set@#1}{\totalcount at set{#1}{#2}}}%
-    {}%
-    {\global\@namedef{total#1s}{#2\totalcount at xspace}%
-     \ifnum#2<1\relax \else
-       \global\@nameuse{total#1strue}%
-     \fi}}
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-\AtBeginDocument{\AtEndDocument{%
-  \begingroup
-    \@tempswafalse
-    \if at filesw
-      \immediate\write\@mainaux{%
-        \string\providecommand\string\totalcount at set[2]{}}%
-    \fi
-    \def\@elt#1{%
-      \totalcount at addtocounter{#1}%
-      \edef\totalcount at tempa{\the\value{totalcount@#1}}%
-      \expandafter\let\expandafter\totalcount at tempb\csname total#1s\endcsname
-      \@expandtwoargs\totalcount at set{#1}{\totalcount at tempa}%
-      \expandafter\ifx\csname total#1s\endcsname\totalcount at tempb \else
-        \@tempswatrue
-      \fi
-      \if at filesw
-        \immediate\write\@mainaux{%
-          \string\totalcount at set{#1}{\totalcount at tempa}}%
-      \fi}%
-    \totalcount at counters
-    \if at 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

Modified: trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at AtBeginDocument{\caption at ifcompatibility{%
-  \caption at 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 at Info[1]{%
   \PackageInfo{bicaption}{#1}}
 \newcommand*\bicaption at InfoNoLine[1]{%
@@ -55,6 +55,16 @@
 \newcommand*\bicaption at 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 at CheckCompatibility{%
+  \caption at ifcompatibility{%
+    \bicaption at Error
+      {This package does not work with\MessageBreak
+       caption option `compatibility=v1'}%
+    \endinput}{}}
+\bicaption at CheckCompatibility
+\caption at AtBeginDocument{%
+  \bicaption at CheckCompatibility
+  \let\bicaption at CheckCompatibility\@undefined}
 \newcount\bicaption at lang
 \DeclareCaptionOption{bi-lang}{%
   \caption at ifinlist{#1}{0,all,both}{%
@@ -212,7 +222,7 @@
 \long\def\@@@bicaption[#1]#2{%
   \caption at dblarg{\@@@@bicaption{#1}{#2}}}
 \long\def\@@@@bicaption#1#2[#3]#4{%
-  \caption at getlabel#2\label{}\@nil
+  \caption at getlabel{#2}%
   \bicaption at ifswap
     {\bicaption at setup{#1}{#2}%
      \bicaption at cmd[{#3}]{#4}}%
@@ -232,7 +242,7 @@
   \caption at dblarg{\LT@@@@bicaption{#1}{#2}}}
 \long\def\LT@@@@bicaption#1#2[#3]#4{%
   \gdef\bicaption at LTsetup{%
-    \caption at getlabel#2\label{}\@nil
+    \caption at getlabel{#2}%
     \bicaption at LT@setup}%
   \gdef\bicaption at LT@setup{%
     \bicaption at ifswap

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-ams-smf.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at font}{\@captionfont}
+\DeclareCaptionFont{ams at labelfont}{\@captionheadfont}
+\DeclareCaptionFont{ams at textfont}{\@captionfont\upshape}
+\SetCaptionDefault{font}{ams at font}
+\SetCaptionDefault{labelfont}{ams at labelfont}
+\SetCaptionDefault{textfont}{ams at textfont}
+\AtCaptionPackage{\setlength\belowcaptionskip{0pt}}
+\captionsetup{position=t,figureposition=b}
+\endinput
+%%
+%% End of file `caption-ams-smf.sto'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-beamer.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-beamer.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-beamer.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at ifbeamertemplate[1]{%
+  \begingroup
+    \let\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
+    \@nameuse{beamer@@tmpop at caption@#1}%
+    \ifx\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
+      \endgroup\expandafter\@firstoftwo
+    \else
+      \endgroup\expandafter\@secondoftwo
+    \fi}
+\DeclareCaptionSinglelinecheck{default}{%
+  \caption at ifbeamertemplate{caption name own line}%
+    \@secondoftwo % \@secondoftwo -> singlelinecheck=off
+    \@firstoftwo} % \@firstoftwo  -> singlelinecheck=on
+\g at addto@macro\caption at prepareslc{%
+  \def\footnote{%
+    \begingroup
+    \let\stepcounter\caption at l@stepcounter
+    \renewcommand<>\beamer at framefootnotetext[1]{%
+      \endgroup}%
+    \let\@footnotetext\beamer at framefootnotetext
+    \caption at footnote@ORI}}
+\DeclareCaptionLabelFormat{default}{%
+  \caption at ifbeamertemplate{numbered}%
+    \caption at labelformat@simple
+    \caption at labelformat@unnumbered
+  {#1}{#2}}
+\DeclareCaptionLabelFormat{simpleMagyar}{%
+  \caption at ifbeamertemplate{numbered}%
+    {#2.\bothIfSecond{\nobreakspace}{#1}}%
+    {\caption at labelformat@unnumbered{#1}{#2}}}
+\let\@@magyar at captionfix\relax
+\AtBeginDocument{\let\@@magyar at captionfix\relax}
+\DeclareCaptionLabelSeparator**{default}%
+  {\caption at ifbeamertemplate{caption name own line}}%
+  {\caption at ifbeamertemplate{caption name own line}%
+     {\\}%
+     {\usebeamertemplate{caption label separator}}}
+\DeclareCaptionFont{beamer at font}{%
+  \usebeamerfont*{caption}%
+  \usebeamercolor[fg]{caption}}
+\SetCaptionDefault{font}{beamer at font}
+\DeclareCaptionFont{beamer at 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 at labelfont}
+\DeclareCaptionFont{beamer at textfont}{}
+\SetCaptionDefault{textfont}{beamer at textfont}
+\SetCaptionDefault{justification}{raggedright}
+\captionsetup{list=off}
+\AtCaptionPackage{%
+  \expandafter\let\expandafter\caption at beamer@figure
+    \csname\string\figure\endcsname
+  \@namedef{\string\figure}[#1]{%
+    \caption at beamer@figure[#1]% use original beamer code first
+    \caption at settype{figure}} % set "type=figure" afterwards
+  \expandafter\let\expandafter\caption at beamer@table
+    \csname\string\table\endcsname
+  \@namedef{\string\table}[#1]{%
+    \caption at beamer@table[#1]% use original beamer code first
+    \caption at settype{table}} % set "type=table" afterwards
+}
+\endinput
+%%
+%% End of file `caption-beamer.sto'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-elsarticle.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-koma.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-koma.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-koma.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at koma@setcapwidth
+                \csname\string\setcapwidth\endcsname
+\@namedef{\string\setcapwidth}[#1]#2{%
+  \caption at koma@setcapwidth[{#1}]{#2}%
+  \caption at setcapwidth@opt{#1}%
+  \caption at setcapwidth}
+\newcommand*\caption at setcapwidth@opt[1]{}
+\AtCaptionPackage{\renewcommand*\caption at setcapwidth@opt[1]{%
+  \ifx\\#1\\\else
+    \caption at ifdefined\cap at margin{%
+      \def\@tempa{captionbeside}%
+      \ifx\@tempa\@currenvir\else\caption at Warning{%
+        Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
+      \fi}{}%
+  \fi}}
+\newcommand*\caption at setcapwidth{%
+  \captionsetup{width=\cap at width}}
+\def\caption at tempa{\hsize}%
+\ifx\caption at tempa\cap at width \else
+  \caption at setcapwidth
+\fi
+\expandafter\let\expandafter\caption at koma@setcapmargin
+                \csname\string\@setcapmargin\endcsname
+\@namedef{\string\@setcapmargin}[#1]#2{%
+  \caption at koma@setcapmargin[{#1}]{#2}%
+  \caption at setcapmargin}
+\expandafter\let\expandafter\caption at koma@@setcapmargin
+                \csname\string\@@setcapmargin\endcsname
+\@namedef{\string\@@setcapmargin}[#1]#2{%
+  \caption at koma@@setcapmargin[{#1}]{#2}%
+  \caption at setcapmargin}
+\newcommand*\caption at setcapmargin{%
+  \begingroup
+    \let\onelinecaptionsfalse\relax
+    \def\@twoside{0}%
+    \def\if at twoside{\def\@twoside{1}\iffalse}%
+    \cap at margin
+    \def\@tempa{\endgroup}%
+    \ifx\cap at left\hfill\else\ifx\cap at right\hfill\else
+      \def\hspace##1##{\@firstofone}%
+      \edef\@tempa{\endgroup
+        \noexpand\captionsetup{%
+          twoside=\@twoside,slc=0,%
+          margin={\cap at left,\cap at right}}}%
+    \fi\fi
+    \@tempa}
+\ifx\cap at margin\relax \else
+  \caption at setcapmargin
+\fi
+\let\caption at koma@setcapindent\@setcapindent
+\renewcommand*\@setcapindent[1]{%
+  \caption at koma@setcapindent{#1}%
+  \caption at setcapindent}
+\let\caption at koma@@setcapindent\@@setcapindent
+\renewcommand*\@@setcapindent[1]{%
+  \caption at koma@@setcapindent{#1}%
+  \caption at setcapindent}
+\newcommand*\caption at setcapindent{%
+  \captionsetup{indent=\ifdim\cap at indent<\z@\z@\else\cap at indent\fi}}
+\caption at ifdefined\cap at indent{\caption at setcapindent}{}
+\let\caption at koma@parindent\KV at caption@parindent
+\DeclareCaptionOption{parindent}[]{%
+  \ifx,#1,%
+    \caption at Debug{Option `parindent' ignored}%
+  \else
+    \caption at koma@parindent{#1}%
+  \fi}%
+\let\caption at koma@parskip\KV at caption@parskip
+\DeclareCaptionOption{parskip}[]{%
+  \ifx,#1,%
+    \caption at Debug{Option `parskip' ignored}%
+  \else
+    \caption at koma@parskip{#1}%
+  \fi}%
+\g at addto@macro\onelinecaptionstrue{\caption at setsinglelinecheck{true}}%
+\g at addto@macro\onelinecaptionsfalse{\caption at setsinglelinecheck{false}}%
+\ifonelinecaptions
+  \onelinecaptionstrue
+\else
+  \onelinecaptionsfalse
+\fi
+\DeclareCaptionFormat{default}[#1#2#3\par]{%
+  \ifdofullc at p
+    \caption at useformat{hang}{#1}{#2}{#3}%
+  \else
+    #1#2%
+    \ifdim\cap at indent<\z@
+      \par
+      \noindent\hspace*{-\cap at indent}%
+    \else\if at capbreak
+      \par
+    \fi\fi
+    #3\par
+  \fi}
+\SetCaptionDefault{labelformat}{autodot}
+\DeclareCaptionLabelSeparator{default}{\captionformat}
+\DeclareCaptionFont{scr at font}{\scr at fnt@caption}
+\DeclareCaptionFont{scr at labelfont}{\scr at fnt@captionlabel}
+\SetCaptionDefault{font}{scr at font}
+\SetCaptionDefault{labelfont}{scr at labelfont}
+\g at addto@macro\@captionabovetrue{\caption at setposition{t}}%
+\g at addto@macro\@captionabovefalse{\caption at setposition{b}}%
+\if at captionabove
+  \@captionabovetrue
+\else
+  \@captionabovefalse
+\fi
+\AtBeginCaption{\caption at AtBeginLongtable{%
+  \def\@captionabovetrue{\LT at captionsetup{position=t}}%
+  \def\@captionabovefalse{\LT at captionsetup{position=b}}}}
+\g at addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}%
+\g at addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}%
+\if at tablecaptionabove
+  \@tablecaptionabovetrue
+\else
+  \@tablecaptionabovefalse
+\fi
+\caption at ifdefined\@figurecaptionabovetrue{%
+  \g at addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}%
+  \g at addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}%
+  \if at figurecaptionabove
+    \@figurecaptionabovetrue
+  \else
+    \@figurecaptionabovefalse
+  \fi}{}
+\AtCaptionPackage{%
+  \let\caption at koma@figureposition\KV at caption@figureposition
+  \DeclareCaptionOption{figureposition}{%
+    \caption at WarningNoLine{%
+      Option `figureposition=#1' has no effect\MessageBreak
+      when used with a KOMA-Script document class}%
+    \caption at koma@figureposition{#1}}
+  \let\caption at koma@tableposition\KV at caption@tableposition
+  \DeclareCaptionOption{tableposition}{%
+    \caption at WarningNoLine{%
+      Option `tableposition=#1' has no effect\MessageBreak
+      when used with a KOMA-Script document class}%
+    \caption at koma@tableposition{#1}}}
+\AtBeginDocument{\let\scr at caption\caption}
+\endinput
+%%
+%% End of file `caption-koma.sto'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-light.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-light.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-light.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at ifbool{documentclass}{}{%
+  \caption at WarningNoLine{%
+    Unknown document class (or package),\MessageBreak
+    standard defaults will be used}}
+\@ifpackageloaded{caption2}{%
+  \caption at Error{%
+    You can't use both, the (obsolete) caption2 *and*\MessageBreak
+    the caption-light package}%
+  \endinput
+}{}
+\caption at SetupOptions{caption-light}{\caption at setkeys{caption}{#2}}
+\caption at ProcessOptions*{caption-light}
+\caption at ifdefined\caption at makecaption
+  {\caption at Info{\noexpand\caption at makecaption is already defined}%
+   \endinput}{}
+\long\def\caption at makecaption#1#2{%
+  \caption at iftop\caption at belowskip\caption at aboveskip
+  \caption at labelseparator % defines \caption at iflabelfont and \caption at labelsep
+  \caption at singlelinecheck
+    {\sbox\@tempboxa{\caption@@makecaption{#1}{#2}}%
+     \ifdim \wd\@tempboxa >\hsize}%
+    {\iftrue}%
+    \caption@@makecaption{#1}{#2}\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi
+  \caption at iftop\caption at aboveskip\caption at belowskip}
+\newcommand\caption@@makecaption[2]{%
+  \caption at applyfont
+  {\captionlabelfont #1}%
+  {\caption at iflabelfont\captionlabelfont
+   \relax\caption at labelsep}%
+  {\captiontextfont #2}}
+\let\@makecaption\caption at makecaption
+\caption at AtBeginDocument{%
+  \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
+  \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
+}
+\newcommand*\setcaptiontype{%
+  \caption at teststar{\def\@captype}{}{}}
+\caption at AtBeginDocument{%
+  \def\captionof{\caption at teststar\caption at of{\caption*}\caption}}
+\newcommand*\caption at of[2]{\setcaptiontype*{#2}#1}
+\endinput
+%%
+%% End of file `caption-light.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/caption/caption-light.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/caption/caption-memoir.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-memoir.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-memoir.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at addto@macro\caption at prepareslc{%
+  \let\pagenote\caption at gobble}
+\endinput
+%%
+%% End of file `caption-memoir.sto'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-ntg.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-ntg.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-ntg.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at labelfont}{\CaptionLabelFont}
+\DeclareCaptionFont{ntg at textfont}{\CaptionTextFont}
+\SetCaptionDefault{labelfont}{ntg at labelfont}
+\SetCaptionDefault{textfont}{ntg at textfont}
+\endinput
+%%
+%% End of file `caption-ntg.sto'.

Added: trunk/Master/texmf-dist/tex/latex/caption/caption-thesis.sto
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption-thesis.sto	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption-thesis.sto	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at font}{\cph at font}
+\DeclareCaptionFont{cpb at font}{\cpb at font}
+\SetCaptionDefault{labelfont}{cph at font}
+\SetCaptionDefault{textfont}{cpb at font}
+\endinput
+%%
+%% End of file `caption-thesis.sto'.

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at ifbool{documentclass}{}{%
   \caption at WarningNoLine{%
     Unknown document class (or package),\MessageBreak
@@ -170,98 +174,9 @@
 \DeclareCaptionOption{hypcap}[1]{\caption at setbool{hypcap}{#1}}
 \DeclareCaptionOption{hypcapspace}{\def\caption at hypcapspace{#1}}
 \captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
-\caption at ifclassloaded{ams}{%
-  \caption at InfoNoLine{AMS or SMF document class}%
-  \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class
-}{}
-\caption at ifclassloaded{koma}{%
-  \caption at InfoNoLine{KOMA-Script document class}%
-  \g at addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
-  \g at addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
-  \if at tablecaptionabove
-    \@tablecaptionabovetrue
-  \else
-    \@tablecaptionabovefalse
-  \fi
-  \caption at ifdefined\@figurecaptionabovetrue{%
-    \g at addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
-    \g at addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
-    \if at figurecaptionabove
-      \@figurecaptionabovetrue
-    \else
-      \@figurecaptionabovefalse
-    \fi
-  }{}%
-  \g at addto@macro\onelinecaptionstrue{\let\caption at ifslc\@firstoftwo}
-  \g at addto@macro\onelinecaptionsfalse{\let\caption at ifslc\@secondoftwo}
-  \ifonelinecaptions
-    \onelinecaptionstrue
-  \else
-    \onelinecaptionsfalse
-  \fi
-  \g at addto@macro\@captionabovetrue{\let\caption at position\@firstoftwo}
-  \g at addto@macro\@captionabovefalse{\let\caption at position\@secondoftwo}
-  \DeclareCaptionOption{figureposition}{%
-    \caption at WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak
-    when used with a KOMA script document class}%
-    \captionsetup*[figure]{position=#1}}
-  \DeclareCaptionOption{tableposition}{%
-    \caption at WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak
-    when used with a KOMA script document class}%
-    \captionsetup*[table]{position=#1}}
-  \let\caption at KOMA@setcapindent\@setcapindent
-  \renewcommand*\@setcapindent[1]{%
-    \caption at KOMA@setcapindent{#1}\caption at setcapindent}
-  \let\caption at KOMA@@setcapindent\@@setcapindent
-  \renewcommand*\@@setcapindent[1]{%
-    \caption at KOMA@@setcapindent{#1}\caption at setcapindent}
-  \newcommand*\caption at setcapindent{%
-    \captionsetup{indent=\ifdim\cap at indent<\z@\z@\else\cap at indent\fi}}
-  \caption at ifdefined\cap at indent{\caption at setcapindent}{}
-  \expandafter\let\expandafter\caption at KOMA@setcapwidth
-                  \csname\string\setcapwidth\endcsname
-  \@namedef{\string\setcapwidth}[#1]#2{%
-    \caption at KOMA@setcapwidth[{#1}]{#2}\caption at setcapwidth{#1}}
-  \newcommand*\caption at setcapwidth[1]{%
-    \ifx\\#1\\\else
-      \caption at ifdefined\cap at margin{%
-        \def\@tempa{captionbeside}%
-        \ifx\@tempa\@currenvir\else\caption at Warning{%
-          Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}%
-        \fi}{}%
-    \fi
-    \captionsetup{width=\cap at width}}
-  \def\caption at tempa{\hsize}%
-  \ifx\caption at tempa\cap at width \else
-    \caption at setcapwidth{?}
-  \fi
-  \expandafter\let\expandafter\caption at KOMA@setcapmargin
-                  \csname\string\@setcapmargin\endcsname
-  \@namedef{\string\@setcapmargin}[#1]#2{%
-    \caption at KOMA@setcapmargin[{#1}]{#2}\caption at setcapmargin}
-  \expandafter\let\expandafter\caption at KOMA@@setcapmargin
-                  \csname\string\@@setcapmargin\endcsname
-  \@namedef{\string\@@setcapmargin}[#1]#2{%
-    \caption at KOMA@@setcapmargin[{#1}]{#2}\caption at setcapmargin}
-  \newcommand*\caption at setcapmargin{%
-    \begingroup
-      \let\onelinecaptionsfalse\relax
-      \def\@twoside{0}%
-      \def\if at twoside{\def\@twoside{1}\iffalse}%
-      \cap at margin
-      \def\@tempa{\endgroup}%
-      \ifx\cap at left\hfill\else\ifx\cap at right\hfill\else
-        \def\hspace##1##{\@firstofone}%
-        \edef\@tempa{\endgroup
-          \noexpand\captionsetup{%
-            twoside=\@twoside,slc=0,%
-            margin={\cap at left,\cap at right}}}%
-      \fi\fi
-      \@tempa}
-  \ifx\cap at margin\relax \else
-    \caption at setcapmargin
-  \fi
-}{}
+\caption at documentclass@code
+\let\caption at documentclass@code\@undefined
+\let\AtCaptionPackage\@firstofone
 \caption at SetupOptions{caption}{\caption at setkeys{#1}{#2}}
 \caption at ProcessOptions*{caption}
 \newcounter{caption at flags}
@@ -312,12 +227,12 @@
                    {\ignorespaces\caption at makeanchor{#3}}\par
       \caption at if@minipage\@minipagetrue\@minipagefalse}%
   \caption at end}
-\providecommand\M at gettitle[1]{}
 \providecommand\memcaptioninfo[4]{}
 \newcommand*\caption at prepareanchor[2]{%
   \caption at makecurrent{#1}{#2}%
   \caption at ifhypcap\caption@@start\relax
   \M at gettitle{#2}}
+\providecommand\M at gettitle[1]{}
 \long\def\caption at makecaption#1#2{%
   \caption at make@above
   \caption@@make{#1}{#2}%
@@ -330,10 +245,6 @@
   \caption at iftop
     {\caption at aboveskip\caption at rule}%
     \caption at belowskip}
-\newcommand*\caption at aboveskip{%
-  \vskip\abovecaptionskip}
-\newcommand*\caption at belowskip{%
-  \vskip\belowcaptionskip}
 \newcommand*\caption at redefine{}
 \g at addto@macro\caption at redefine{%
   \caption at ifcompatibility{%
@@ -341,7 +252,7 @@
       \noexpand\caption will not be redefined since `compatibility' is set to v1}%
     \renewcommand*\caption at redefine{}%
     \renewcommand*\caption at continuedfloat[1]{%
-      \caption at Error{Not available in compatibility mode}}%
+      \caption at Error{Not available with option `compatibility=v1'}}%
     \caption at AtBeginDocument*{%
       \let\caption at start\relax
       \caption at ifdefined\caption at ORI@capstart{%
@@ -361,7 +272,15 @@
   \let\caption at ORI@xfloat\@xfloat
   \def\@xfloat#1[#2]{%
     \caption at ORI@xfloat{#1}[#2]%
-    \caption at settype{#1}}%
+    \caption at settype{#1}%
+    \caption at xfloat@hook}%
+  \newcommand*\caption at xfloat@hook{}%
+  \let\caption at ORI@xdblfloat\@xdblfloat
+  \def\@xdblfloat#1[#2]{%
+    \caption at ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
+    \caption at setoptions{#1*}%
+    \caption at xdblfloat@hook}%
+  \newcommand*\caption at xdblfloat@hook{}%
 }
 \caption at AtBeginDocument{\caption at redefine}
 \let\@makecaption\caption at makecaption
@@ -375,7 +294,7 @@
   \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
   \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
 }
-\newcommand\setcaptiontype{%
+\def\setcaptiontype{%
   \caption at boxrestore@mini
   \caption at settype}
 \newcommand\setcaptionsubtype{%
@@ -422,29 +341,32 @@
        \caption at start}}}
 \newcommand*\caption at iftype{\caption at ifdefined\@captype}
 \newcommand*\caption at checktype[1]{%
-  \caption at ifsubtype{#1}%
-     {\caption at Error{Should not be used with subtype `#1'}%
-      \@gobble}%
-     \@firstofone}
+  \caption at ifsubtype{#1}\@firstoftwo{\caption at ifin@list\sf at counterlist{#1}}%
+    {\caption at Error{Should not be used with subtype `#1'}%
+     \@gobble}%
+    \@firstofone}
 \newcommand*\caption at checksubtype[1]{%
   \caption at ifsubtype{#1}%
-     \@firstofone
-     {\caption at Error{Undefined subtype `#1'}%
-      \@gobble}}
-\caption at ifeTeX{%
-  \newcommand*\caption at checkgrouplevel[2]{%
-    \@ifundefined{#1caption at grouplevel}{%
-       \caption at ifundefined\caption at grouplevel{\let\caption at grouplevel\z@}{}%
-       \ifnum\currentgrouplevel>\caption at grouplevel\relax
-         \expandafter\edef\csname #1caption at grouplevel\endcsname{%
-           \the\currentgrouplevel}%
-       \else
-         \caption at Warning{\string#2\MessageBreak outside box or environment}%
-       \fi
-    }{}}%
-}{%
-  \let\caption at checkgrouplevel\@gobbletwo
-}
+    \@firstofone
+    {\caption at ifin@list\sf at counterlist{#1}%
+       {\caption at 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 at Error{Undefined subtype `#1'}%
+        \@gobble}}}
+\newcommand*\caption at checkgrouplevel[2]{%
+  \@ifundefined{#1caption at grouplevel}{%
+     \caption at ifundefined\caption at grouplevel{\let\caption at grouplevel\z@}{}%
+     \ifnum\currentgrouplevel>\caption at grouplevel\relax
+       \expandafter\edef\csname #1caption at grouplevel\endcsname{%
+         \the\currentgrouplevel}%
+     \else
+       \caption at Warning{\string#2\MessageBreak outside box or environment}%
+     \fi
+  }{}}%
 \newcommand*\caption at undefinedlabel{%
   \protect\caption at xref{\caption at labelname}{\on at line}}
 \DeclareRobustCommand*\caption at xref[2]{%
@@ -466,7 +388,7 @@
   \@esphack}
 \caption at AtBeginDocument{%
   \def\captionof{\caption at teststar\caption at of{\caption*}\caption}}
-\newcommand*\caption at of[2]{\setcaptiontype*{#2}#1}
+\providecommand*\caption at of[2]{\setcaptiontype*{#2}#1}
 \newcommand*\captionlistentry{%
   \caption at teststar\@captionlistentry\@firstoftwo\@secondoftwo}
 \newcommand*\@captionlistentry[1]{%
@@ -485,10 +407,10 @@
     {\caption at iibox{#1}{#2}{#3}}%
     {\caption at iibox@{#1}{#2}{#3}}}
 \long\def\caption at iibox#1#2#3[#4]{%
-  \@testopt{\caption at iiibox{#1}{#2}{#3}[{#4}]}\captionbox at hj@default}
+  \@testopt{\caption at iiibox{#1}{#2}{#3}[{#4}]}\captionbox at innerpos@default}
 \long\def\caption at iibox@#1#2#3#4{%
   \setbox\@tempboxa\hbox{#4}%
-  \caption at iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox at hj@default]{\unhbox\@tempboxa}}
+  \caption at iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox at innerpos@default]{\unhbox\@tempboxa}}
 \long\def\caption at iiibox#1{%
   \caption at iiiibox{#1}\vbox\vtop}
 \long\def\caption at iiiibox#1#2#3#4#5[#6][#7]#8{%
@@ -501,7 +423,7 @@
       \caption at setposition t%
       #2{\caption#4{#5}}%
       \captionbox at hrule
-      \csname caption at hj@#7\endcsname
+      \csname caption at justification@#7\endcsname
       #8}%
   }{%
     \endgroup
@@ -508,17 +430,17 @@
     \parbox[b]{#6}{%
       #1\relax
       \caption at setposition b%
-      \csname caption at hj@#7\endcsname
+      \csname caption at justification@#7\endcsname
       #8%
       \captionbox at hrule
       #3{\caption#4{#5}}}%
   }}
-\newcommand*\captionbox at hj@default{c}
+\newcommand*\captionbox at innerpos@default{c}
 \newcommand*\captionbox at hrule{\hrule\@height\z@\relax}
-\providecommand*\caption at hj@c{\centering}
-\providecommand*\caption at hj@l{\raggedright}
-\providecommand*\caption at hj@r{\raggedleft}
-\providecommand*\caption at hj@s{}
+\providecommand*\caption at justification@c{\centering}
+\providecommand*\caption at justification@l{\raggedright}
+\providecommand*\caption at justification@r{\raggedleft}
+\providecommand*\caption at justification@s{}
 \def\continuedfloat{%
   \caption at iftype
     {\caption at continuedfloat\@captype}%
@@ -569,7 +491,7 @@
   \@ifundefined{c@#1}%
     {\caption at Error{No float type '#1' defined}}%
     {\caption at ref@stepcounter{#1}%
-     \caption at fixposition
+     \caption at fixposition % TODO: Make this independant on the "position" setting
      \caption at iftop\caption at setflag\caption at clrflag2% caption
      \caption at clrflag4% subcaption
      \@nameuse{donemaincaptiontrue}}}
@@ -626,9 +548,10 @@
 \newcommand*\caption at end{%
   \endgroup}
 \newcommand*\caption at setfnum[1]{%
-  \@ifundefined{fnum@#1}{\iftrue}{\ifx\caption at lfmt\caption at lfmt@default\else}%
-    \@namedef{fnum@#1}{\caption at fnum{#1}}%
-  \fi}
+  \@ifundefined{caption at fnum@#1}%
+    {\expandafter\let\csname caption at fnum@#1\expandafter\endcsname\csname fnum@#1\endcsname
+     \@namedef{fnum@#1}{\caption at fnum{#1}}}%
+    {}}
 \newcommand*\caption at boxrestore{%
   \caption at parboxrestore{\@parboxrestore}{%
     \let\if at nobreak\iffalse
@@ -647,7 +570,7 @@
   \parindent\z@ \parskip\z at skip
   \sloppy}
 \newcommand*\caption at normalsize{%
-  \caption at font*{\KV at caption@fnt at normal\@unused}}
+  \caption at font@normal\@unused}
 \let\caption at setfloatcapt\@firstofone
 \newcommand*\caption at makecurrent[1]{\caption at gettitle}
 \let\caption at makeanchor\@firstofone
@@ -659,15 +582,6 @@
   \caption at ifdefined\NR at gettitle
     {\NR at gettitle{#1}}%
     {\def\@currentlabelname{#1}}}
-\def\caption at DeclareSubType sub#1\@nil{%
-  \caption at Debug{Initializing subtype for `#1'\@gobble}%
-  \@namedef{caption at beginsub#1}{\caption at beginsubfloat{#1}}}
-\@onlypreamble\caption at DeclareSubType
-\caption at For*{subtypelist}{\caption at DeclareSubType sub#1\@nil}
-\caption at AtBeginDocument*{%
-  \caption at ifdefined\sf at counterlist{%
-    \@for\sf at temp:=\sf at counterlist\do{%
-      \expandafter\caption at DeclareSubType\sf at temp\@nil}}{}}
 \newcommand*\caption at subtypehook{%
   \ifx\caption\caption at subcaption \else
     \caption at warmup
@@ -686,7 +600,7 @@
     \c at continuedfloat=0\relax
     \let\caption at setfloatcapt\@firstofone
     \let\caption at chkfloat\@gobbletwo
-    \caption at setbox{none}%
+    \caption at set{box}{none}%
     \caption at clearmargin
     \caption at iflist{}{\let\caption at setlist\@gobble}%
     \caption at setoptions{sub}%
@@ -767,61 +681,33 @@
       \caption at addsubcontentslines{appendix}\caption at appendix@ORI}}{}%
   \caption at addsubcontentslines{AtEndDocument}%
 }
-\caption at ifdefined\smf at makecaption{\let\smf at makecaption\@makecaption}{}
-\@ifclassloaded{beamer}{%
-  \caption at InfoNoLine{beamer document class}%
-  \let\caption at ORI@figure\figure
-  \def\figure{\caption at settype{figure}\caption at ORI@figure}
-  \let\caption at ORI@table\table
-  \def\table{\caption at settype{table}\caption at ORI@table}
+\caption at IfBabelArabi{%
+  \let\@makecaption\caption at makecaption
+  \def\fnum at figure{\figurename\nobreakspace\thefigure}%
+  \def\fnum at table{\tablename\nobreakspace\thetable}%
 }{}
-\caption at ifdefined\scr at caption{%
-  \caption at AtBeginDocument{\let\scr at caption\caption}}{}
-\@nameuse{caption at frenchb}\@nameundef{caption at frenchb}
-\caption at AtBeginDocument{\caption at ifdefined\frenchTeXmods{%
-  \caption at InfoNoLine{frenchle/pro package is loaded}%
-  \let\captionfont at ORI\captionfont
-  \let\captionlabelfont at ORI\captionlabelfont
-  \let\@makecaption at ORI\@makecaption
-
-  \caption at ifdefined\GOfrench
-    {\def\caption at tempa{\g at addto@macro\GOfrench}}%
-    {\let\caption at tempa\@firstofone}%
-  \caption at tempa{%
-    \let\captionfont\captionfont at ORI
-    \let\captionfont at ORI\@undefined
-    \let\captionlabelfont\captionlabelfont at ORI
-    \let\captionlabelfont at ORI\@undefined
-    \let\@makecaption\@makecaption at ORI
-    \let\@makecaption at ORI\@undefined
-    \let\@cnORI\caption
-    \let\caption at tcORI\@tablescaption
-    \def\@tablescaption{\caption at star\relax\caption at tcORI}%
-    \let\@eatDP\@undefined
-    \let\caption at tempa\@empty
-    \ifx\f at ffrench\fnum at figure
-      \l at addto@macro\caption at tempa{\let\fnum at figure\f at ffrench}%
-    \fi
-    \ifx\f at tfrench\fnum at table
-      \l at addto@macro\caption at tempa{\let\fnum at table\f at tfrench}%
-    \fi
-    \def\f at ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
-    \def\f at tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
-    \caption at tempa
-  }%
-}{}}
-\def\caption at tempa#1{%
-  \@ifpackagewith{babel}{#1}{%
-    \caption at InfoNoLine{#1 babel option is loaded}%
-    \expandafter\addto\csname extras#1\endcsname{%
-       % reverse changes made by magyar.ldf
-       \let\@makecaption\caption at makecaption
-       \babel at save\@makecaption
-       \caption at redefine
-       \babel at save\@caption}%
-  }{}}
-\caption at tempa{hungarian}%
-\caption at tempa{magyar}%
+\caption at IfFrenchLe{%
+  \def\f at ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
+  \def\f at tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
+  \let\@eatDP\@undefined
+  \caption at AtBeginDocument{%
+    \let\caption at original@makecaption\@makecaption}%
+  \g at addto@macro\GOfrench{%
+    \let\@makecaption\caption at original@makecaption}%
+}{}
+\caption at IfBabelHungarian{%
+  \caption at AtBeginDocument{%
+    \let\caption at original@makecaption\@makecaption}%
+  \caption at ifdefined\extrashungarian{%
+    \addto\extrashungarian{%
+      \let\@makecaption\caption at original@makecaption}}{}%
+  \caption at ifdefined\extrasmagyar{%
+    \addto\extrasmagyar{%
+      \let\@makecaption\caption at original@makecaption}}{}%
+}{}
+\caption at IfBabelLatvian{%
+  \let\@makecaption\caption at makecaption
+}{}
 \newcommand\caption at IfPackageLoaded[1]{%
   \@testopt{\caption@@IfPackageLoaded{#1}}{}}
 \@onlypreamble\caption at IfPackageLoaded
@@ -930,7 +816,7 @@
         \hsize=\linewidth
       \fi
     \fi}%
-\AtBeginCaption{\caption at test@adjustwidth}
+  \AtBeginCaption{\caption at test@adjustwidth}%
   }{}%
 \caption at IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
   \caption at ifdefined\chkfloat at addcontentsline{%
@@ -970,8 +856,7 @@
   }}%
   \newcommand*\caption at 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 at addto@macro\fs at plaintop{\def\@fs at mid{\vspace\abovecaptionskip\relax}}%
   \g at addto@macro\fs at boxed{\def\@fs at mid{\kern\abovecaptionskip\relax}}%
@@ -1176,21 +1061,6 @@
   \let\caption at ORI@lst at MakeCaption\lst at MakeCaption
   \def\lst at MakeCaption#1{% #1 is `t' or `b'
     \begingroup
-%%    \caption at Debug{%
-%%      linewidth=\lst at linewidth,
-%%      xleftmargin=\lst at xleftmargin,\MessageBreak
-%%      xrightmargin=\lst at xrightmargin,
-%%      resetmargins=\lst at ifresetmargins true\else false\fi}%
-%%    \caption at iflst@Init{}{%
-%%      \linewidth\lst at linewidth\relax
-%%      \lst at ifresetmargins
-%%        \advance\linewidth\@totalleftmargin
-%%        \advance\linewidth\rightmargin
-%%        \@totalleftmargin\z@
-%%      \fi
-%%      \advance\linewidth-\lst at xleftmargin
-%%      \advance\linewidth-\lst at xrightmargin
-%%      \advance\@totalleftmargin\lst at xleftmargin\relax}%
       \caption at iflst@Init{}{%
         \edef\caption at lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
         \l at addto@macro\caption at beginhook\caption at lst@leftskip}%
@@ -1211,6 +1081,9 @@
   \providecommand*\ext at lstlisting{lol}%
 }{}
 \providecommand*\LTcaptype{table}
+\providecommand*\caption at LT@array{}
+\newcommand\caption at AtBeginLongtable{%
+  \g at addto@macro\caption at LT@array}
 \caption at IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
   \RequirePackage{ltcaption}[2018/08/26]%
   \let\LT@@makecaption\@undefined
@@ -1217,26 +1090,27 @@
   \caption at AtBeginDocument{%
     \let\caption at ORI@LT at array\LT at array
     \renewcommand*\LT at array{%
-      \global\let\caption at opt@@longtable\@undefined
-      \def\captionsetup{%
-        \noalign\bgroup
-        \@ifstar\@captionsetup\@captionsetup}% gobble *
-      \def\@captionsetup##1{\LT at captionsetup{##1}\egroup}%
-      \def\LT at captionsetup##1{%
-        \captionsetup at startrue\caption at setup@options[@longtable]{##1}%
-        \global\let\caption at opt@@longtable\caption at opt@@longtable}%
-      \def\@captionabovetrue{\LT at captionsetup{position=t}}%
-      \def\@captionabovefalse{\LT at captionsetup{position=b}}%
-      \def\captionlistentry{%
-        \noalign\bgroup
-        \@ifstar{\egroup\LT at listentry\LTcaptype}% gobble *
-                {\egroup\LT at listentry\LTcaptype}}%
-%%        \let\Hy at LT@currentHlabel\@currentHlabel
-%%          \let\@currentHlabel\Hy at LT@currentHlabel
-      \def\continuedfloat{\noalign{%
-        \caption at Error{\noexpand\continuedfloat outside float}}}%
-      \let\bicaption\LT at bicaption
+      \caption at LT@array
       \caption at ORI@LT at array}}%
+  \caption at AtBeginLongtable{%
+    \global\let\caption at opt@@longtable\@undefined
+    \def\captionsetup{%
+      \noalign\bgroup
+      \@ifstar\@captionsetup\@captionsetup}% gobble *
+    \def\@captionsetup#1{\LT at captionsetup{#1}\egroup}%
+    \def\LT at captionsetup#1{%
+      \captionsetup at startrue\caption at setup@options[@longtable]{#1}%
+      \global\let\caption at opt@@longtable\caption at opt@@longtable}%
+    \def\captionlistentry{%
+      \noalign\bgroup
+      \@ifstar{\egroup\LT at listentry\LTcaptype}% gobble *
+              {\egroup\LT at listentry\LTcaptype}}%
+%%      \let\Hy at LT@currentHlabel\@currentHlabel
+%%        \let\@currentHlabel\Hy at LT@currentHlabel
+    \def\continuedfloat{\noalign{%
+      \caption at Error{\noexpand\continuedfloat outside float}}}%
+    \let\bicaption\LT at bicaption
+  }%
   \def\LT at capti@n{%
     \@ifstar
       {\egroup\LT at c@ption\@gobble[]}%
@@ -1280,7 +1154,10 @@
       \fi
       \caption at flrow@setlist@{#1}}%
   }{}}%
-}{}
+}{%
+  \let\caption at AtBeginLongtable\@gobble
+  \let\caption at LT@array\@undefined
+}
 \providecommand*\caption at LT@setup{}
 \caption at IfPackageLoaded{picinpar}{%
   \long\def\figwindow[#1,#2,#3,#4] {%
@@ -1385,7 +1262,7 @@
     \def\caption at setSC@justify{%
       \caption at clearmargin
         \ifx\SC at justify\@empty \else
-          \let\caption at hj\SC at justify
+          \let\caption at justification\SC at justify
           \let\SC at justify\@empty
         \fi}%
     \let\caption\SC at orig@caption
@@ -1428,8 +1305,7 @@
   \long\def\ST at caption#1[#2]#3{\par%
     \caption at settype*{#1}%
     \caption at setoptions{supertabular}%
-    \def\caption at fixposition{%
-      \caption at setposition{\if at topcaption t\else b\fi}}%
+    \caption at setposition{\if at topcaption t\else b\fi}%
     \caption at beginex{#1}{#2}{#3}%
       \caption at boxrestore
       \caption at normalsize
@@ -1448,8 +1324,7 @@
   \long\def\ST at caption#1[#2]#3{\par%
     \caption at settype*{#1}%
     \caption at setoptions{xtabular}%
-    \def\caption at fixposition{%
-      \caption at setposition{\if at topcaption t\else b\fi}}%
+    \caption at set{position}{\if at topcaption t\else b\fi}%
     \@initisotab
     \caption at beginex{#1}{#2}{#3}%
       \caption at boxrestore
@@ -1463,7 +1338,7 @@
   \let\caption at ORI@threeparttable\threeparttable
   \renewcommand*\threeparttable{%
     \caption at settype{\@ifundefined{@captype}{table}{\@captype}}%
-%%% \caption at setposition a% ?
+%%% \caption at setposition{auto}% ?
     \caption at clearmargin
     \caption at setoptions{threeparttable}%
     \caption at ORI@threeparttable}%
@@ -1470,7 +1345,7 @@
   \let\caption at ORI@measuredfigure\measuredfigure
   \renewcommand*\measuredfigure{%
     \caption at settype{\@ifundefined{@captype}{figure}{\@captype}}%
-%%% \caption at setposition a% ?
+%%% \caption at setposition{auto}% ?
     \caption at clearmargin
     \caption at setoptions{measuredfigure}%
     \caption at ORI@measuredfigure}%

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption2.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption2.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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.
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at FixArabTeX{%
-  \def\caption at tempa##1{}%
-  \ifx\caption at tempa\@gobble
-    \PackageInfo{caption3}{Fixing ArabTeX}%
-    \long\def\@gobble##1{}%
-  \fi}
-\caption at FixArabTeX
-\AtBeginDocument{%
-  \caption at FixArabTeX
-  \let\caption at 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 at ifeTeX\@secondoftwo
-  \providecommand\l at addto@macro[2]{%
-    \begingroup
-      \toks@\expandafter{#1#2}%
-      \xdef\caption at addto@temp{\the\toks@}%
-    \endgroup
-    \let#1\caption at addto@temp}
-\else
-  \PackageInfo{caption3}{TeX engine: e-TeX}
-  \let\caption at ifeTeX\@firstoftwo
-  \providecommand\l at addto@macro[2]{%
-    \edef#1{\unexpanded\expandafter{#1#2}}}
-\fi
+\providecommand\l at addto@macro[2]{%
+  \edef#1{\unexpanded\expandafter{#1#2}}}
 \def\bothIfFirst#1#2{%
   \protected at edef\caption at tempa{#1}%
   \ifx\caption at tempa\@empty \else
@@ -74,21 +54,25 @@
     #1#2%
   \fi}
 \newcommand*\caption at ifundefined[1]{%
-  \ifx#1\@undefined
+  \ifdefined#1%
+    \ifx#1\relax
+      \expandafter\expandafter\expandafter\@firstoftwo
+    \else
+      \expandafter\expandafter\expandafter\@secondoftwo
+    \fi
+  \else
     \expandafter\@firstoftwo
-  \else\ifx#1\relax
-    \expandafter\expandafter\expandafter\@firstoftwo
+  \fi}
+\newcommand*\caption at ifdefined[1]{%
+  \ifdefined#1%
+    \ifx#1\relax
+      \expandafter\expandafter\expandafter\@secondoftwo
+    \else
+      \expandafter\expandafter\expandafter\@firstoftwo
+    \fi
   \else
-    \expandafter\expandafter\expandafter\@secondoftwo
-  \fi\fi}
-\newcommand*\caption at ifdefined[1]{%
-  \ifx#1\@undefined
     \expandafter\@secondoftwo
-  \else\ifx#1\relax
-    \expandafter\expandafter\expandafter\@secondoftwo
-  \else
-    \expandafter\expandafter\expandafter\@firstoftwo
-  \fi\fi}
+  \fi}
 \newcommand*\caption at ifinlist{%
   \@expandtwoargs\caption@@ifinlist}
 \newcommand*\caption@@ifinlist[2]{%
@@ -115,10 +99,10 @@
 \newcommand*\caption at l@removefrom at list[2]{%
   \caption at ifempty@list#1{}{\@expandtwoargs\@removeelement{#2}#1#1}}
 \newcommand*\caption at for@list[2]{%
-  \caption at ifempty@list#1{}{%
-    \def\caption at tempb##1{#2}%
-    \@for\caption at tempa:=#1\do{%
-      \expandafter\caption at tempb\expandafter{\caption at tempa}}}}
+  \caption at ifempty@list#1{}%
+    {\def\caption at tempb##1{#2}%
+     \@for\caption at tempa:=#1\do{%
+       \expandafter\caption at tempb\expandafter{\caption at tempa}}}}
 \newcommand*\caption at ifempty@list[1]{%
   \ifx#1\@undefined
     \expandafter\@firstoftwo
@@ -134,16 +118,18 @@
 \newcommand*\caption at setbool[1]{%
   \expandafter\caption at set@bool\csname caption at if#1\endcsname}
 \newcommand*\caption at set@bool[2]{%
-  \caption at ifinlist{#2}{1,true,yes,on}{%
-    \let#1\@firstoftwo
-  }{\caption at ifinlist{#2}{0,false,no,off}{%
-    \let#1\@secondoftwo
-  }{%
-    \caption at Error{Undefined boolean value `#2'}%
-  }}}
+  \caption at if@bool{#2}{\let#1\@firstoftwo}{\let#1\@secondoftwo}}
+\newcommand*\caption at if@bool[1]{%
+  \caption at ifinlist{#1}{1,true,yes,on}%
+    {\@firstoftwo}%
+    {\caption at ifinlist{#1}{0,false,no,off}%
+       {}%
+       {\caption at Error{Undefined boolean value `#1'}}%
+     \@secondoftwo}}
 \newcommand*\caption at ifbool[1]{\@nameuse{caption at if#1}}
 \newcommand*\caption at undefbool[1]{\@nameundef{caption at if#1}}
-\newcommand*\caption at teststar[3]{\@ifstar{#1{#2}}{#1{#3}}}
+\newcommand*\caption at teststar[3]{%
+  \@ifstar{#1{#2}}{#1{#3}}}
 \newcommand*\caption at teststar@[3]{%
   \@ifstar{#1{#2}}{\caption at ifatletter{#1{#2}}{#1{#3}}}}
 \AtBeginDocument{\let\caption at teststar@\caption at teststar}
@@ -223,7 +209,7 @@
 \@onlypreamble\caption at declareoption
 \newcommand*\caption at declare@option{%
   \define at key{caption}}
-%% no \@onlypreamble\caption at declare@option, will be used by \captionsetup
+%% no \@onlypreamble\caption at declare@option since it will be used by \captionsetup
 \newcommand*\DeclareCaptionOptionNoValue{%
   \caption at teststar\caption at declareoption@novalue\AtEndOfPackage\@gobble}
 \@onlypreamble\DeclareCaptionOptionNoValue
@@ -330,10 +316,10 @@
   \fi}
 \newcommand*\caption at xsetup[1]{\expandafter\caption at setup\expandafter{#1}}
 \newcommand*\caption at addtooptlist[1]{%
-  \@ifundefined{caption at opt@#1 at lineno}{%
-    \caption at dooptlist\caption at g@addto at list{#1}%
-    \expandafter\xdef\csname caption at opt@#1 at lineno\endcsname{\the\inputlineno}%
-  }{}}
+  \@ifundefined{caption at opt@#1 at lineno}%
+    {\caption at dooptlist\caption at g@addto at list{#1}%
+     \expandafter\xdef\csname caption at opt@#1 at lineno\endcsname{\the\inputlineno}}%
+    {}}
 \newcommand*\caption at removefromoptlist[1]{%
   \caption at dooptlist\caption at g@removefrom at list{#1}%
   \global\expandafter\let\csname caption at opt@#1 at lineno\endcsname\@undefined}
@@ -343,10 +329,10 @@
     \expandafter#1\expandafter\caption at optlist\expandafter{\@tempa}%
   \endgroup}
 \AtEndDocument{%
-  \caption at for@list\caption at optlist{%
-    \caption at WarningNoLine{%
-      Unused \string\captionsetup[#1]
-      on input line \csname caption at opt@#1 at lineno\endcsname}}}
+  \caption at for@list\caption at optlist
+    {\caption at WarningNoLine{%
+       Unused \string\captionsetup[#1]
+       on input line \csname caption at opt@#1 at lineno\endcsname}}}
 \newcommand*\caption at setkeys{\@dblarg\caption@@setkeys}
 \long\def\caption@@setkeys[#1]#2#3{%
   \@bsphack
@@ -361,7 +347,7 @@
   \fi
   \def\KV at errx{\KV at err}%
   \def\XKV at err{\let\@tempa\XKV at tkey\KV at err}%
-  \caption at Debug{\protect\setkeys{#2}{#3}}%
+  \caption at Debug{\noexpand\setkeys{#2}{#3}}%
   \setkeys{#2}{#3}%
   \edef\caption at keydepth{\expandafter\@gobble\caption at keydepth}%
   \expandafter\let\expandafter\KV at err\csname ORI at KV@err\caption at keydepth\endcsname
@@ -422,9 +408,92 @@
   \caption at SetupOptions@list
   \@tempa}
 \@onlypreamble\caption at onefilewithoptions
-\newdimen\captionmargin
-\newdimen\captionmargin@
-\newdimen\captionwidth
+\newcommand*\caption at decl[3][\def]{%
+  \global\long\expandafter#1\csname caption@#2@#3\endcsname}
+\@onlypreamble\caption at decl
+\newcommand*\caption at ifdecl[2]{%
+  \@ifundefined{caption@#1@#2}\@secondoftwo\@firstoftwo}
+\newcommand*\caption at checkdecl[2]{%
+  \caption at ifdecl{#1}{#2}%
+    \@firstofone
+    {\caption at Error{Undefined #1 `#2'}%
+     \@gobble}}
+\newcommand*\caption at set{%
+  \caption at maparg\caption@@set}%
+\newcommand*\caption@@set[3]{%
+  \caption at checkdecl{#1}{#3}{%
+    \expandafter\def\csname caption@#2\expandafter\endcsname\expandafter{\csname caption@#1@#3\endcsname}}}
+\newcommand*\SetCaptionDefault{%
+  \caption at teststar\caption at setdefault\def\edef}
+\@onlypreamble\SetCaptionDefault
+\newcommand*\caption at setdefault[2]{%
+  \@ifundefined{caption at setdefault@#2}%
+    {\caption at maparg\caption@@setdefault}%
+    {\@nameuse{caption at setdefault@#2}{#1}}%
+  {#2}}
+\newcommand*\caption@@setdefault[3]{%
+  \caption at ifdefault{#3}%
+    {\caption at Error{Invalid argument for \string\SetCaptionDefault: `#3'}}% would cause an infinite loop otherwise
+    {\caption@@set{#1}{#2 at default}{#3}}}
+\newcommand*\caption at ifdefault[1]{%
+  \edef\caption at tempa{#1}%
+  \def\caption at tempb{default}%
+  \ifx\caption at tempa\caption at tempb
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi}
+\newcommand*\caption at setmapping[2]{%
+  \@namedef{caption at map@#1}{#2}}
+\@onlypreamble\caption at setmapping
+\newcommand*\caption at maparg[2]{%
+  \@ifundefined{caption at map@#2}%
+    {#1{#2}}%
+    {#1{\csname caption at map@#2\endcsname}}%
+  {#2}}
+\def\caption at switchdefault#1#2{%
+  \def\caption at tempa##1{#2}%
+  \expandafter\caption at tempa\csname caption@#1 at default\endcsname
+  \caption at setdefault\def{#1}}
+\def\caption at restoredefault#1#2{%
+  \caption at checkdecl{#1}{default}{%
+    \caption at ifdefined#2{%
+      \expandafter\let\csname caption@#1 at default\endcsname#2%
+      \let#2\@undefined}{}}}
+\newcommand*\caption at decl@package[2]{%
+  \@ifnextchar[%]
+    {\caption at declare@package{#1}{#2}}%
+    {\caption at declarepackage{#1}{#2}}}
+\@onlypreamble\caption at decl@package
+\def\caption at declare@package#1#2[#3]#4{%
+  \global\@namedef{caption@#1@#4 at package}{#3}%
+  #2{#4}}
+\@onlypreamble\caption at declare@package
+\newcommand*\caption at declarepackage[3]{%
+  \global\@nameundef{caption@#1@#3 at package}%
+  #2{#3}}
+\@onlypreamble\caption at declarepackage
+\newcommand*\caption at load@package[2]{%
+  \expandafter\let\expandafter\caption at tempa\csname caption@#1@#2 at package\endcsname
+  \caption at ifdefined\caption at tempa
+    {\caption at requirepackage\caption at tempa{#1=#2}}%
+    {}}
+\newcommand*\DeclareCaptionLength[1]{%
+  \expandafter\newdimen\csname caption#1\endcsname
+  \@namedef{caption at setdefault@#1}##1{%
+    \caption at setdefault@length{##1}}%
+  \SetCaptionDefault*{#1}}
+\@onlypreamble\DeclareCaptionLength
+\newcommand*\caption at setdefault@length[3]{%
+  \expandafter#1\csname caption#2 at default\endcsname{#3}}
+\newcommand*\caption at setlength[2]{%
+  \caption at ifdefault{#2}%
+    {\expandafter\let\expandafter\caption at tempa\csname caption#1 at default\endcsname}%
+    {\def\caption at tempa{#2}}%
+  \expandafter\setlength\csname caption#1\endcsname\caption at tempa}
+\DeclareCaptionLength{margin}{0pt}
+\DeclareCaptionLength{margin@}{\the\captionmargin}
+\DeclareCaptionLength{width}{0pt}
 \newdimen\caption at tempdima
 \DeclareCaptionOption{margin}{\setcaptionmargin{#1}}
 \DeclareCaptionOption{margin*}{\setcaptionmargin*{#1}}
@@ -436,6 +505,7 @@
 \DeclareCaptionOption{calcwidth*}{\caption at setcalcwidth*{#1}}
 \DeclareCaptionOption{twoside}[1]{\caption at set@bool\caption at iftwoside{#1}}
 \DeclareCaptionOptionNoValue{oneside}{\caption at set@bool\caption at iftwoside0}
+\caption at set@bool\caption at iftwoside{\if at twoside 1\else 0\fi}
 \DeclareCaptionOption{minmargin}{\caption at setoptcmd\caption at minmargin{#1}}
 \DeclareCaptionOption{maxmargin}{\caption at setoptcmd\caption at 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 at setlength{margin}{#1}%
+  \caption at setlength{margin@}{#2}%
   \addtolength\captionmargin@{-\captionmargin}}
 \newcommand*\setcaptionwidth{%
   \caption at resetcalcmargin
@@ -457,9 +527,7 @@
   \caption at teststar\caption@@setwidth\@gobble\@firstofone}
 \newcommand*\caption@@setwidth[2]{%
   #1{\captionmargin\z@\captionmargin@\z@}%
-  \setlength\captionwidth{#2}}%
-\newcommand*\caption at resetcalcmargin{%
-  \let\caption at calcmargin@hook\@empty}
+  \caption at setlength{width}{#2}}%
 \newcommand*\caption at setcalcmargin{%
   \caption at teststar{\caption@@setcalcmargin\caption at setmargin}%
     \@secondoftwo\@firstoftwo}
@@ -467,6 +535,8 @@
   #2{\caption at resetcalcmargin
      \l at addto@macro\caption at calcmargin@hook{#1{#3}}}%
     {\l at addto@macro\caption at calcmargin@hook{#1*{#3}}}}
+\newcommand*\caption at resetcalcmargin{%
+  \let\caption at calcmargin@hook\@empty}
 \newcommand*\caption at setcalcwidth{%
   \caption at teststar{\caption@@setcalcmargin\caption at setwidth}%
     \@secondoftwo\@firstoftwo}
@@ -505,83 +575,91 @@
   \caption at ifoddpage}
 \newcommand*\caption at setoptcmd[2]{%
   \caption at ifinlist{#2}{0,false,no,off}{\let#1\@undefined}{\def#1{#2}}}
-\newdimen\caption at indent
-\newdimen\caption at parindent
-\newdimen\caption at hangindent
-\DeclareCaptionOption{indent}[\leftmargini]{% obsolete!
-       \setlength\caption at indent{#1}}
+\DeclareCaptionLength{@indent}{0pt}
+\DeclareCaptionLength{@parindent}{0pt}
+\DeclareCaptionLength{@hangindent}{0pt}
+\DeclareCaptionOption{indent}[\leftmargini]{% obsolete
+  \caption at setlength{@indent}{#1}}
 \DeclareCaptionOption{indention}[\leftmargini]{%
-       \setlength\caption at indent{#1}}
+  \caption at setlength{@indent}{#1}}
 \DeclareCaptionOption{parindent}{%
-       \setlength\caption at parindent{#1}}
+  \caption at setlength{@parindent}{#1}}
 \DeclareCaptionOption{hangindent}{%
-       \setlength\caption at hangindent{#1}}
+  \caption at setlength{@hangindent}{#1}}
 \DeclareCaptionOption{parskip}{%
-       \l at addto@macro\caption@@par{\setlength\parskip{#1}}}
+  \l at addto@macro\caption@@par{\setlength\parskip{#1}}}
 \newcommand*\DeclareCaptionStyle[1]{%
   \@testopt{\caption at declarestyle{#1}}{}}
 \@onlypreamble\DeclareCaptionStyle
 \def\caption at declarestyle#1[#2]#3{%
-  \global\@namedef{caption at sls@#1}{#2}%
-  \global\@namedef{caption at sty@#1}{#3}}
+  \caption at decl{style}{#1}%
+    {\def\caption at slsty{#2}%
+     \def\caption at sty{#3}}%
+  \@namedef{caption at sty@#1}{\@unused}}
 \@onlypreamble\caption at declarestyle
 \DeclareCaptionOption{style}{\caption at setstyle{#1}}
 \DeclareCaptionOption{style*}{\caption at setstyle*{#1}}
 \newcommand*\caption at setstyle{%
-  \caption at teststar\caption@@setstyle\@gobble\@firstofone}
+  \caption at teststar\caption@@setstyle\caption at ifdecl\caption at checkdecl}
 \newcommand*\caption@@setstyle[2]{%
-  \@ifundefined{caption at sty@#2}%
-    {#1{\caption at Error{Undefined style `#2'}}}%
-    {\expandafter\let\expandafter\caption at sty\csname caption at sty@#2\endcsname
+  #1{style}{#2}%
+    {\caption at set{style}{#2}%
+     \caption at style % defines \caption at sty & \caption at slsty
      \ifx\caption at setstyle@flag\@undefined
-       \let\caption at setstyle@flag\relax
+       \let\caption at setstyle@flag\relax % prevent \caption at resetstyle if called recursively
        \caption at resetstyle
        \caption at xsetup\caption at sty
        \let\caption at setstyle@flag\@undefined
      \else
        \caption at xsetup\caption at sty
-     \fi
-     \expandafter\let\expandafter\caption at sls\csname caption at sls@#2\endcsname
-     \expandafter\caption at l@addto at list\expandafter\caption at opt@singleline
-       \expandafter{\caption at sls}}}
+     \fi}%
+    {}}
 \newcommand*\caption at resetstyle{%
   \caption at 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 at 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 at set@bool\caption at 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 at decl{singlelinecheck}{#1}{#2}}
+\@onlypreamble\DeclareCaptionSinglelinecheck
+\DeclareCaptionOption{singlelinecheck}[1]{\caption at setsinglelinecheck{#1}}
 \DeclareCaptionOption{slc}[1]{\KV at caption@singlelinecheck{#1}}
+\DeclareCaptionSinglelinecheck{on}{\@firstoftwo}
+\DeclareCaptionSinglelinecheck{off}{\@secondoftwo}
+\SetCaptionDefault{singlelinecheck}{on}
+\newcommand*\caption at setsinglelinecheck[1]{%
+  \caption at ifdecl{singlelinecheck}{#1}%
+    {\caption at set{singlelinecheck}{#1}}%
+    {\caption at set@bool\caption at singlelinecheck{#1}}}
 \newcommand*\DeclareCaptionBox[2]{%
-  \global\long\@namedef{caption at box@#1}##1##2{#2}}
+  \caption at decl{box}{#1}##1##2{#2}}
 \@onlypreamble\DeclareCaptionBox
-\DeclareCaptionOption{box}{\caption at setbox{#1}}
-\DeclareCaptionOption{parbox}{\caption at set@box\caption at parbox{#1}}
-\newcommand*\caption at setbox{%
-  \caption at set@box\caption at box}
-\newcommand*\caption at set@box[2]{%
-  \@ifundefined{caption at box@#2}%
-    {\caption at Error{Undefined box `#2'}}%
-    {\expandafter\let\expandafter#1\csname caption at box@#2\endcsname}}
+\DeclareCaptionOption{box}{\caption at set{box}{#1}}
+\DeclareCaptionOption{parbox}{\caption at set{parbox}{#1}}
+\caption at setmapping{parbox}{box}
 \DeclareCaptionBox{empty}{}
 \DeclareCaptionBox{none}{#2}
 \DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}}
-\DeclareCaptionBox{colorbox}{\colorbox{\caption at boxcolor}{%
-  \setlength\caption at tempdima{#1}%
-  \addtolength\caption at tempdima{-2\fboxsep}%
-  \linewidth\caption at tempdima
-  \hsize\caption at tempdima
-  #2}}
+\DeclareCaptionBox{colorbox}{%
+  \colorbox\caption at boxcolor{%
+    \setlength\caption at tempdima{#1}%
+    \addtolength\caption at tempdima{-2\fboxsep}%
+    \linewidth\caption at tempdima
+    \hsize\caption at tempdima
+    #2}}
 \DeclareCaptionOption{boxcolor}{\def\caption at boxcolor{#1}}
 \DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
-\def\caption at box@default{\caption at box@none}
+\SetCaptionDefault{box}{none}
 \newcommand*\DeclareCaptionFormat{%
   \caption at teststar\caption at declareformat\@gobble\@firstofone}
 \@onlypreamble\DeclareCaptionFormat
@@ -589,44 +667,32 @@
   \@dblarg{\caption@@declareformat#1{#2}}}
 \@onlypreamble\caption at declareformat
 \long\def\caption@@declareformat#1#2[#3]#4{%
-  \global\expandafter\let\csname caption at ifh@#2\endcsname#1%
-  \global\long\@namedef{caption at slfmt@#2}##1##2##3{#3}%
-  \global\long\@namedef{caption at fmt@#2}##1##2##3{#4}}
+  \caption at decl[\edef]{format}{#2}{%
+    \unexpanded{\let\caption at ifhmode#1}%
+    \unexpanded{\long\def\caption at slfmt}####1####2####3\unexpanded{{#3}}%
+    \unexpanded{\long\def\caption at fmt}####1####2####3\unexpanded{{#4}}}}
 \@onlypreamble\caption@@declareformat
-\DeclareCaptionOption{format}{\caption at setformat{#1}}
-\newcommand*\caption at setformat[1]{%
-  \@ifundefined{caption at fmt@#1}%
-    {\caption at Error{Undefined format `#1'}}%
-    {\expandafter\let\expandafter\caption at ifh\csname caption at ifh@#1\endcsname
-     \expandafter\let\expandafter\caption at slfmt\csname caption at slfmt@#1\endcsname
-     \expandafter\let\expandafter\caption at fmt\csname caption at fmt@#1\endcsname}}
-\newcommand*\DeclareCaptionDefaultFormat[1]{%
-  \expandafter\def\expandafter\caption at fmt@default\expandafter
-    {\csname caption at fmt@#1\endcsname}%
-  \expandafter\def\expandafter\caption at slfmt@default\expandafter
-    {\csname caption at slfmt@#1\endcsname}%
-  \expandafter\def\expandafter\caption at ifh@default\expandafter
-    {\csname caption at ifh@#1\endcsname}}
-\@onlypreamble\DeclareCaptionDefaultFormat
+\newcommand*\caption at useformat[1]{% used by caption-koma.sto
+  \caption at checkdecl{format}{#1}{%
+    \begingroup
+      \@nameuse{caption at format@#1}\global\let\caption at tempa\caption at fmt
+    \endgroup\caption at tempa}}
+\DeclareCaptionOption{format}{\caption at set{format}{#1}}
 \DeclareCaptionFormat{plain}{#1#2#3\par}
 \DeclareCaptionFormat{hang}[#1#2#3\par]{%
-  \caption at ifin@list\caption at lsepcrlist\caption at lsepname
+  \caption at iflabelseparatorwithnewline
     {\caption at Error{%
-       The option `labelsep=\caption at lsepname' does not work\MessageBreak
+       The option `labelsep=\caption at labelsep@name' does not work\MessageBreak
        with `format=hang'}}%
     {\@hangfrom{#1#2}%
      \advance\caption at parindent\hangindent
      \advance\caption at hangindent\hangindent
      \caption@@par#3\par}}
-\DeclareCaptionDefaultFormat{plain}
+\SetCaptionDefault{format}{plain}
 \newcommand*\DeclareCaptionLabelFormat[2]{%
-  \global\@namedef{caption at lfmt@#1}##1##2{#2}}
+  \caption at decl{labelformat}{#1}##1##2{#2}}
 \@onlypreamble\DeclareCaptionLabelFormat
-\DeclareCaptionOption{labelformat}{\caption at setlabelformat{#1}}
-\newcommand*\caption at setlabelformat[1]{%
-  \@ifundefined{caption at lfmt@#1}%
-    {\caption at Error{Undefined label format `#1'}}%
-    {\expandafter\let\expandafter\caption at lfmt\csname caption at lfmt@#1\endcsname}}
+\DeclareCaptionOption{labelformat}{\caption at set{labelformat}{#1}}
 \DeclareCaptionLabelFormat{empty}{}
 \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
 \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
@@ -633,28 +699,41 @@
 \DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
 \DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}#2\autodot}
 \DeclareCaptionLabelFormat{unnumbered}{#1}
-\def\caption at lfmt@default{\caption at lfmt@simple}
+\DeclareCaptionLabelFormat{original}{%
+  \caption at ifdefined\caption at original@fnum
+    {\caption at original@fnum}%
+    {\caption at labelformat@simple{#1}{#2}}}
+\SetCaptionDefault{labelformat}{original}
 \newcommand\DeclareCaptionLabelSeparator{%
-  \caption at teststar\caption at declarelabelseparator\@gobble\@firstofone}
+  \@ifstar
+    \DeclareCaptionLabelSeparator@
+    {\caption at declarelabelseparator\@firstofone}}
 \@onlypreamble\DeclareCaptionLabelSeparator
+\newcommand\DeclareCaptionLabelSeparator@{%
+  \@ifstar
+    \DeclareCaptionLabelSeparator@@
+    {\caption at declarelabelseparator\@gobble}}
+\@onlypreamble\DeclareCaptionLabelSeparator@
+\newcommand*\DeclareCaptionLabelSeparator@@[2]{%
+  \caption at declarelabelseparator
+    {#2\@gobble\@firstofone}%
+    {#1}}
+\@onlypreamble\DeclareCaptionLabelSeparator@@
 \newcommand\caption at declarelabelseparator[3]{%
-  \global\@namedef{caption at iflf@#2}{#1}%
-  \global\long\@namedef{caption at lsep@#2}{#3}%
-  \caption@@declarelabelseparator{#2}#3\\\@nil}
+  \caption at decl{labelseparator}{#2}%
+    {\def\caption at iflabelfont{#1}%
+     \def\caption at labelsep@name{#2}%
+     \def\caption at labelsep{#3}}%
+  \@namedef{caption at lsep@#2}{#3}}
+\newcommand*\caption at lsep@default{\caption at labelseparator@default\caption at labelsep}%
 \@onlypreamble\caption at declarelabelseparator
-\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{%
-  \def\@tempa{#3}\ifx\@tempa\@empty \else
-    \caption at g@addto at list\caption at lsepcrlist{#1}%
-  \fi}
-\@onlypreamble\caption@@declarelabelseparator
-\DeclareCaptionOption{labelsep}{\caption at setlabelseparator{#1}}
-\DeclareCaptionOption{labelseparator}{\caption at setlabelseparator{#1}}
-\newcommand*\caption at setlabelseparator[1]{%
-  \@ifundefined{caption at lsep@#1}%
-    {\caption at Error{Undefined label separator `#1'}}%
-    {\edef\caption at lsepname{#1}%
-     \expandafter\let\expandafter\caption at iflf\csname caption at iflf@#1\endcsname
-     \expandafter\let\expandafter\caption at lsep\csname caption at lsep@#1\endcsname}}
+\newcommand*\caption at LabelSeparatorWithNewline[1]{%
+  \caption at g@addto at list\caption at labelsep@crlist{#1}}
+\@onlypreamble\caption at LabelSeparatorWithNewline
+\newcommand*\caption at iflabelseparatorwithnewline{%
+  \caption at ifin@list\caption at labelsep@crlist\caption at labelsep@name}
+\DeclareCaptionOption{labelsep}{\caption at set{labelseparator}{#1}}
+\DeclareCaptionOption{labelseparator}{\caption at set{labelseparator}{#1}}
 \DeclareCaptionLabelSeparator{none}{}
 \DeclareCaptionLabelSeparator{colon}{: }
 \DeclareCaptionLabelSeparator{period}{. }
@@ -661,28 +740,14 @@
 \DeclareCaptionLabelSeparator{space}{ }
 \DeclareCaptionLabelSeparator*{quad}{\quad}
 \DeclareCaptionLabelSeparator*{newline}{\captionnewline}
+\caption at LabelSeparatorWithNewline{newline} % does not work with "format=hang"
 \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}
-\newcommand*\captionnewline{\\}
-\newcommand*\caption at setdefaultlabelsep[1]{%
-  \ifx\caption at lsep\caption at lsep@default
-    \caption at set@default at labelsep{#1}%
-    \caption at setlabelseparator{default}%
-  \else
-    \caption at set@default at labelsep{#1}%
-  \fi}
-\newcommand*\caption at set@default at labelsep[1]{%
-  \def\caption at lsep@default{\@nameuse{caption at lsep@#1}}%
-  \def\caption at iflf@default{\@nameuse{caption at iflf@#1}}}
-\caption at set@default at labelsep{colon}
+\newcommand*\captionnewline{\\\relax}
+\SetCaptionDefault{labelseparator}{colon}
 \newcommand*\DeclareCaptionTextFormat[2]{%
-  \global\long\@namedef{caption at tfmt@#1}##1{#2}}
+  \caption at decl{textformat}{#1}##1{#2}}
 \@onlypreamble\DeclareCaptionTextFormat
-\DeclareCaptionOption{textformat}{\caption at settextformat{#1}}
-\DeclareCaptionOption{strut}[1]{\caption at set@bool\caption at ifstrut{#1}}
-\newcommand*\caption at settextformat[1]{%
-  \@ifundefined{caption at tfmt@#1}%
-    {\caption at Error{Undefined text format `#1'}}%
-    {\expandafter\let\expandafter\caption at tfmt\csname caption at tfmt@#1\endcsname}}
+\DeclareCaptionOption{textformat}{\caption at set{textformat}{#1}}
 \DeclareCaptionTextFormat{empty}{%
   \caption at get@label#1\caption at makeanchor{}\@nil
   \caption at thelabel
@@ -690,14 +755,16 @@
 \long\def\caption at get@label#1\caption at makeanchor#2#3\@nil{%
   \def\caption at tempa{#2}%
   \ifx\caption at tempa\@empty
-    \caption at getlabel#1\label{}\@nil
+    \caption at getlabel{#1}%
   \else
-    \caption at getlabel#2\label{}\@nil
+    \caption at getlabel{#2}%
   \fi}
 \DeclareCaptionTextFormat{simple}{#1}
 \DeclareCaptionTextFormat{period}{#1.}
-\def\caption at tfmt@default{\caption at tfmt@simple}
-\long\def\caption at getlabel#1\label#2#3\@nil{%
+\SetCaptionDefault{textformat}{simple}
+\newcommand\caption at getlabel[1]{%
+  \caption@@getlabel#1\label{}\@nil}
+\long\def\caption@@getlabel#1\label#2#3\@nil{%
   \def\@tempa{#2}%
   \ifx\@tempa\@empty
     \let\caption at thelabel\relax
@@ -705,81 +772,55 @@
     \def\@tempb{*}%
     \ifx\@tempa\@tempb
       \def\caption at thelabel{\label*}%
-      \caption@@getlabel#3\@nil
+      \caption@@@getlabel#3\@nil
     \else
       \def\caption at 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 at addto@macro\caption at thelabel{{#1}}%
   \fi}
-\long\def\caption@@@getlabel[#1]#2\@nil{%
+\long\def\caption@@@@getlabel[#1]#2\@nil{%
   \l at addto@macro\caption at thelabel{[{#1}]}%
-  \caption@@getlabel#2\@nil}
+  \caption@@@getlabel#2\@nil}
 \let\caption at thelabel\relax
+\DeclareCaptionOption{strut}[1]{\caption at set@bool\caption at ifstrut{#1}}
 \newcommand*\DeclareCaptionFont{%
-  \@ifnextchar[%]
-    \caption at declare@font
-    \caption at declarefont}
+  \caption at decl@package{font}{\caption at declarefont}}
 \@onlypreamble\DeclareCaptionFont
-\def\caption at declare@font[#1]#2{%
-  \global\@namedef{caption at fnt@#2 at package}{#1}%
-  \caption@@declarefont{#2}}
-\@onlypreamble\caption at declare@font
-\newcommand*\caption at declarefont[1]{%
-  \global\@nameundef{caption at fnt@#1 at package}%
-  \caption@@declarefont{#1}}
-\@onlypreamble\caption at declarefont
-\newcommand*\caption@@declarefont[2]{%
-  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#1}{#2}}%
-  \caption@@@declarefont{#1}{#2}}
+\newcommand*\caption at declarefont[2]{%
+  \caption at decl{font}{#1}##1{#2}%
+  \define at key{caption at font}{#1}[]{\caption at addto@font{#1}{##1}}}
 \@onlypreamble\caption@@declarefont
-\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
-\@onlypreamble\caption@@@declarefont
-\newcommand*\caption at addto@fnt[2]{%
-  \expandafter\let\expandafter\caption at package\csname caption at fnt@#1 at package\endcsname
-  \caption at ifdefined\caption at package
-    {\caption at requirepackage\caption at package{#1}}% load package, if necessary
-    {}%
-  \l at addto@macro\caption at fnt{#2}}
-\newcommand*\DeclareCaptionDefaultFont[2]{%
-  \global\@namedef{caption#1 at default}{#2}}
-\@onlypreamble\DeclareCaptionDefaultFont
+\newcommand*\caption at addto@font[1]{%
+  \caption at load@package{font}{#1}%
+  \caption at add@to at font{font}{#1}}
+\newcommand*\caption at add@to at font[3]{%
+  \expandafter\g at addto@macro\expandafter\caption at fnt\expandafter{\csname caption@#1@#2\endcsname{#3}}}
 \DeclareCaptionOption{font}{\caption at setfont{font}{#1}}
 \DeclareCaptionOption{font+}{\caption at addtofont{font}{#1}}
-\DeclareCaptionDefaultFont{font}{}
 \DeclareCaptionOption{labelfont}{\caption at setfont{labelfont}{#1}}
 \DeclareCaptionOption{labelfont+}{\caption at addtofont{labelfont}{#1}}
-\DeclareCaptionDefaultFont{labelfont}{}
+\caption at setmapping{labelfont}{font}
 \DeclareCaptionOption{textfont}{\caption at setfont{textfont}{#1}}
 \DeclareCaptionOption{textfont+}{\caption at addtofont{textfont}{#1}}
-\DeclareCaptionDefaultFont{textfont}{}
+\caption at setmapping{textfont}{font}
 \newcommand*\caption at setfont[1]{%
   \expandafter\let\csname caption#1\endcsname\@empty
   \caption at addtofont{#1}}
 \newcommand*\caption at addtofont[2]{%
+  \expandafter\let\expandafter\caption at fnt\csname caption#1\endcsname
   \begingroup
-    \expandafter\let\expandafter\caption at fnt\csname caption#1\endcsname
-    \define at key{caption at fnt}{default}[]{%
-      \l at addto@macro\caption at fnt{\csname caption#1 at default\endcsname}}%
-    \caption at setkeys[caption]{caption at fnt}{#2}%
-    \global\let\caption at tempa\caption at fnt
+    \define at key{caption at font}{default}[]{\caption at add@to at font{#1}{default}{##1}}%
+    \caption at setkeys[caption]{caption at font}{#2}%
   \endgroup
-  \expandafter\let\csname caption#1\endcsname\caption at tempa}
-\newcommand*\caption at font{%
-  \caption at teststar\caption@@font\@firstofone
-          {\caption at setkeys[caption]{caption at fnt}}}
-\newcommand*\caption@@font[2]{%
-  \begingroup
-  \def\caption at fnt{\endgroup}%
-  #1{#2}%
-  \caption at fnt}
+  \expandafter\let\csname caption#1\endcsname\caption at 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 at smaller}
+\DeclareCaptionFont{larger}{\caption at larger}
+\DeclareCaptionFont{none}{}
+\DeclareCaptionFont{normal}{%
+  \caption at font@normalcolor\@unused
+  \caption at font@normalfont\@unused
+  \caption at font@normalsize\@unused
+  \caption at font@singlespacing\@unused}
+\SetCaptionDefault{font}{none}
+\SetCaptionDefault{labelfont}{none}
+\SetCaptionDefault{textfont}{none}
 \newcommand\caption at 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 at smaller}
 \newcommand\caption at larger{%
   \ifx\@currsize\tiny
     \scriptsize
@@ -855,29 +906,21 @@
       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 at larger}
-\DeclareCaptionFont{singlespacing}{}
-\DeclareCaptionFont{normal}{%
-  \caption at font*{%
-    \KV at caption@fnt at normalcolor\@unused
-    \KV at caption@fnt at normalfont\@unused
-    \KV at caption@fnt at normalsize\@unused
-    \KV at caption@fnt at singlespacing\@unused}}
+\newcommand*\caption at hypersetup{\caption at ifdefined\hypersetup\hypersetup\@gobble}
+\DeclareCaptionFont{hypersetup}{\caption at hypersetup{#1}}   % for usage in \captionsetup{font={hypersetup=...}}
+\DeclareCaptionOption{hypersetup}{\caption at hypersetup{#1}} % for usage in \captionsetup[<env>]{hypersetup=...}
 \DeclareCaptionOption{size}{\caption at setfont{size}{#1}}
-\DeclareCaptionDefaultFont{size}{}
+\caption at setmapping{size}{font}
+\SetCaptionDefault{size}{none}
 \newcommand*\DeclareCaptionJustification{%
-  \def\caption@@@declarefont##1##2{%
-    \global\@namedef{caption at hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
-    \let\caption@@@declarefont\@gobbletwo}%
-  \DeclareCaptionFont}
+  \caption at withoptargs\caption at declare@justification}
+\newcommand*\caption at declare@justification[3]{%
+  \caption at decl@package{justification}{\caption at decl{justification}}#1{#2}{#3}%
+  \expandafter\let\csname caption at hj@#2\expandafter\endcsname\csname caption at justification@#2\endcsname}
 \@onlypreamble\DeclareCaptionJustification
-\newcommand*\DeclareCaptionDefaultJustification[1]{%
-  \global\@namedef{caption at hj@default}{#1}% for compatibility to v1.0
-  \DeclareCaptionDefaultFont{@hj}{#1}}
-\@onlypreamble\DeclareCaptionDefaultJustification
-\DeclareCaptionOption{justification}{\caption at setjustification{#1}}
-\DeclareCaptionDefaultJustification{}
-\newcommand*\caption at setjustification{\caption at setfont{@hj}}
+\DeclareCaptionOption{justification}{%
+  \caption at load@package{justification}{#1}%
+  \caption at set{justification}{#1}}
 \DeclareCaptionJustification{justified}{}
 \DeclareCaptionJustification{centering}{\centering}
 \DeclareCaptionJustification{centerfirst}{\centerfirst}
@@ -884,6 +927,7 @@
 \DeclareCaptionJustification{centerlast}{\centerlast}
 \DeclareCaptionJustification{raggedleft}{\raggedleft}
 \DeclareCaptionJustification{raggedright}{\raggedright}
+\SetCaptionDefault{justification}{justified}
 \providecommand\centerfirst{%
   \let\\\@centercr
   \edef\caption at normaladjust{%
@@ -910,50 +954,41 @@
 \newcommand*\caption at rule{\caption at ifrule\caption at hrule\relax}
 \newcommand*\caption at hrule{\hrule\@height\z@}
 \DeclareCaptionOption{rule}[1]{\caption at set@bool\caption at ifrule{#1}}
+\newcommand*\caption at declare@position[2]{%
+  \caption at decl{position}{#1}{#2}}
+\@onlypreamble\caption at declare@position
 \DeclareCaptionOption{position}{\caption at setposition{#1}}
-\DeclareCaptionOption{figureposition}{%
-  \captionsetup*[figure]{position=#1}}
+\DeclareCaptionOption{figureposition}{\captionsetup*[figure]{position=#1}}
 \@onlypreamble at key{caption}{figureposition}
-\DeclareCaptionOption{tableposition}{%
-  \captionsetup*[table]{position=#1}}
+\DeclareCaptionOption{tableposition}{\captionsetup*[table]{position=#1}}
 \@onlypreamble at key{caption}{tableposition}
-\newcommand*\caption at setposition[1]{%
-  \caption at ifinlist{#1}{d,default}{%
-    \let\caption at position\caption at defaultpos
-  }{\caption at ifinlist{#1}{t,top,above}{%
-    \let\caption at position\@firstoftwo
-  }{\caption at ifinlist{#1}{b,bottom,below}{%
-    \let\caption at position\@secondoftwo
-  }{\caption at ifinlist{#1}{a,auto}{%
-    \let\caption at position\@undefined
-  }{%
-    \caption at Error{Undefined position `#1'}%
-  }}}}}
-\let\caption at defaultpos\@undefined
-\newcommand*\caption at iftop{%
-  \ifx\caption at position\@undefined
-    \let\caption at position\@secondoftwo
-  \fi
-  \caption at position}
+\newcommand*\caption at setposition{\caption at set{position}}
+\caption at declare@position{t}{\@firstoftwo}
+\caption at declare@position{top}{\@firstoftwo}
+\caption at declare@position{above}{\@firstoftwo}
+\caption at declare@position{b}{\@secondoftwo}
+\caption at declare@position{bottom}{\@secondoftwo}
+\caption at declare@position{below}{\@secondoftwo}
+\caption at declare@position{a}{\caption at autoposition}% needed by floatrow package, \flrow at cappos
+\caption at declare@position{auto}{\caption at autoposition}
+\SetCaptionDefault{position}{auto}
+\let\caption at autoposition\@secondoftwo
+\newcommand*\caption at iftop{\caption at position}
 \newcommand*\caption at fixposition{%
-  \ifx\caption at position\@undefined
-    \caption at autoposition
-  \fi}
-\newcommand*\caption at autoposition{%
   \ifvmode
     \edef\caption at tempa{\the\prevdepth}%
     \caption at Debug{\protect\prevdepth=\caption at tempa}%
     \ifdim\prevdepth>-\p@
-      \let\caption at position\@secondoftwo
+      \let\caption at autoposition\@secondoftwo % position=below
     \else
-      \let\caption at position\@firstoftwo
+      \let\caption at autoposition\@firstoftwo  % position=above
     \fi
   \else
     \caption at Debug{no \protect\prevdepth}%
-    \let\caption at position\@secondoftwo
+    \let\caption at autoposition\@secondoftwo   % position=below
   \fi}
 \newcommand*\caption at setautoposition[1]{%
-  \def\caption at autoposition{\caption at setposition{#1}}}
+  \def\caption at fixposition{\caption@@set{position}{autoposition}{#1}}}
 \newcommand*\caption at beginhook{}
 \newcommand*\caption at endhook{}
 \newcommand*\AtBeginCaption{\l at addto@macro\caption at beginhook}
@@ -961,6 +996,7 @@
 \DeclareCaptionOption{list}[1]{\caption at setlist{#1}}
 \DeclareCaptionOption{listof}[1]{\caption at setlist{#1}}
 \newcommand*\caption at setlist{\caption at set@bool\caption at iflist}
+\caption at setlist{on}
 \DeclareCaptionOption{listtype}{\caption at setlisttype{#1}}
 \DeclareCaptionOption{listtype+}{\caption at setlisttype@ext{#1}}
 \newcommand*\caption at setlisttype{%
@@ -972,29 +1008,18 @@
 \newcommand*\caption at setlisttype@ext{%
   \caption@@setlisttype\caption at listtype@ext}
 \newcommand*\DeclareCaptionListFormat[2]{%
-  \global\@namedef{caption at lstfmt@#1}##1##2{#2}}
+  \caption at decl{listformat}{#1}##1##2{#2}}
 \@onlypreamble\DeclareCaptionListFormat
-\DeclareCaptionOption{listformat}{\caption at setlistformat{#1}}
-\newcommand*\caption at setlistformat[1]{%
-  \@ifundefined{caption at lstfmt@#1}%
-    {\caption at Error{Undefined list format `#1'}}%
-    {\expandafter\let\expandafter\caption at lstfmt
-       \csname caption at lstfmt@#1\endcsname}}
+\DeclareCaptionOption{listformat}{\caption at set{listformat}{#1}}
 \DeclareCaptionListFormat{empty}{}
 \DeclareCaptionListFormat{simple}{#1#2}
+\DeclareCaptionListFormat{subsimple}{#2}
 \DeclareCaptionListFormat{parens}{#1(#2)}
-\DeclareCaptionListFormat{subsimple}{#2}
 \DeclareCaptionListFormat{subparens}{(#2)}
-\newcommand*\caption at setdefaultlistformat[1]{%
-  \ifx\caption at lstfmt\caption at lstfmt@default
-    \caption at set@default at listformat{#1}%
-    \caption at setlistformat{default}%
-  \else
-    \caption at set@default at listformat{#1}%
-  \fi}
-\newcommand*\caption at set@default at listformat[1]{%
-  \def\caption at lstfmt@default{\@nameuse{caption at lstfmt@#1}}}
-\caption at set@default at listformat{subsimple}
+\DeclareCaptionListFormat{period}{#1#2.}
+\DeclareCaptionListFormat{subperiod}{#2.}
+\SetCaptionDefault{listformat}{subsimple}
+\newcommand*\caption at lstfmt{\caption at listformat}
 \DeclareCaptionOption{debug}[1]{%
   \caption at set@bool\caption at ifdebug{#1}%
   \caption at ifdebug
@@ -1002,6 +1027,45 @@
     {\let\caption at Debug\@gobble}}
 \DeclareOption{debug}{\setkeys{caption}{debug}}
 \setkeys{caption}{debug=0}
+\newcommand\@makecaption at standard[2]{%
+  \vskip\abovecaptionskip
+  \sbox\@tempboxa{#1: #2}%
+  \ifdim \wd\@tempboxa >\hsize
+    #1: #2\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi
+  \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption at standard
+\newcommand\@makecaption at arabic[2]{%
+  \vskip\abovecaptionskip
+  \sbox\@tempboxa{#1: #2}%
+  \sbox\@Arabitempboxa{\textRL{#2} : #1}%
+  \if at rl{
+    \ifdim \wd\@Arabitempboxa >\hsize
+    \textRL{#2} : #1\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+  \fi}\else{
+  \ifdim \wd\@tempboxa >\hsize
+    #1: #2\par
+  \else
+    \global \@minipagefalse
+    \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi}\fi
+  \vskip\belowcaptionskip}
+\@onlypreamble\@makecaption at arabic
+\newcommand\@makecaption at 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 at latvian
 \caption at setbool{documentclass}{1}
 \caption at ifundefined\caption at documentclass{%
   \@ifclassloaded{beamer}{%
@@ -1018,7 +1082,7 @@
     \def\caption at documentclass{koma}%
   }{\caption at ifdefined\@captionheadfont{%
     \caption at InfoNoLine{AMS or SMF document class detected}%
-    \def\caption at documentclass{ams}%
+    \def\caption at documentclass{ams-smf}%
   }{\caption at ifdefined\CaptionFonts{%
     \caption at InfoNoLine{NTG document class detected}%
     \def\caption at documentclass{ntg}%
@@ -1030,213 +1094,147 @@
     \caption at InfoNoLine{thesis document class detected}%
     \def\caption at documentclass{thesis}%
   }{%
-    % article|report|book [2005/09/16 v1.4f Standard LaTeX document class]
-    \long\def\caption at tempa#1#2{%
-      \vskip\abovecaptionskip
-      \sbox\@tempboxa{#1: #2}%
-      \ifdim \wd\@tempboxa >\hsize
-        #1: #2\par
+    \ifx\@makecaption\@undefined
+      \caption at InfoNoLine{Document class w/o caption stuff detected}%
+    \else
+      \ifx\@makecaption\@makecaption at standard
+        \caption at InfoNoLine{Standard document class detected}%
       \else
-        \global \@minipagefalse
-        \hb at xt@\hsize{\hfil\box\@tempboxa\hfil}%
+        \ifx\@makecaption\@makecaption at arabic
+          \caption at InfoNoLine{arabic babel option detected}%
+        \else
+          \ifx\@makecaption\@makecaption at latvian
+            \caption at InfoNoLine{latvian babel option detected}%
+          \else
+            \caption at InfoNoLine{%
+              Unknown document class (or package),\MessageBreak
+              standard defaults will be used}%
+            \caption at InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
+            \caption at setbool{documentclass}{0}% unknown document class
+          \fi
+        \fi
       \fi
-      \vskip\belowcaptionskip}}
-    \ifx\caption at tempa\@makecaption
-      \caption at InfoNoLine{Standard document class detected}%
-    \else
-      \caption at InfoNoLine{%
-        Unknown document class (or package),\MessageBreak
-        standard defaults will be used}%
-      \caption at InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}%
-      \caption at setbool{documentclass}{0}%
     \fi
-    \def\caption at documentclass{base}%
-  }}}}}}%
+    \let\caption at documentclass\@empty % don't load adaption code later on
+  }}}}}}}%
 }{}
-\newcommand*\caption at ifclassloaded[1]{%
-  \edef\caption at tempa{#1}%
-  \ifx\caption at tempa\caption at documentclass
-    \expandafter\@firstoftwo
-  \else
-    \expandafter\@secondoftwo
-  \fi}
-\caption at ifclassloaded{elsarticle}{%
-  \DeclareCaptionDefaultFont{font}{\footnotesize}
-}{}
-\caption at ifclassloaded{ams}{%
-  \let\captionmargin\captionindent % set to 3pc by AMS class
-  \begingroup\edef\@tempa{\endgroup
-    \noexpand\caption at g@addto at list\noexpand\caption at sty@default
-      {margin=\the\captionmargin
-       \caption at ifdefined\smf at makecaption{,maxmargin=.1\linewidth}{}}}
-  \@tempa
-  \caption at g@addto at list\caption at 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 at ifclassloaded{beamer}{%
-  \newcommand*\caption at ifbeamertemplate[1]{%
-    \begingroup
-      \let\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
-      \@nameuse{beamer@@tmpop at caption@#1}%
-      \ifx\beamer@@tmpl at caption@ORI\beamer@@tmpl at caption
-        \endgroup\expandafter\@firstoftwo
-      \else
-        \endgroup\expandafter\@secondoftwo
-      \fi}
-  \DeclareCaptionLabelFormat{default}{%
-    \caption at ifbeamertemplate{numbered}%
-      \caption at lfmt@simple
-      \caption at lfmt@unnumbered
-    {#1}{#2}}
-  \DeclareCaptionLabelFormat{default at magyar}{%
-    \caption at ifbeamertemplate{numbered}%
-      \caption at lfmt@simple at magyar
-      \caption at lfmt@unnumbered
-    {#1}{#2}}
-  \@ifundefined{@@magyar at captionfix}\AtBeginDocument\@firstofone{%
-    \@ifundefined{@@magyar at captionfix}{}{%
-      \g at addto@macro\@@magyar at captionfix{%
-        \let\caption at lfmt@simple at magyar\caption at lfmt@simpleMagyar
-        \let\caption at lfmt@simpleMagyar\caption at lfmt@default at magyar}}}
-  \caption at declarelabelseparator
-    {\caption at ifbeamertemplate{caption name own line}\@gobble\@firstofone}
-    {default}
-    {\caption at 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 at ifslc{%
-      \caption at 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 at make\insertcaptionname\insertcaptionnumber\insertcaption}
-  \DeclareOption{beamer}{%
-    % \usebeamertemplate**{caption} will set font
-    \DeclareCaptionDefaultFont{font}{}%
-    \setbeamertemplate{caption}[caption3]}
-}{}
-\caption at ifclassloaded{koma}{%
-  \DeclareCaptionFormat{default}[#1#2#3\par]{%
-    \ifdofullc at p
-      \caption at ifin@list\caption at lsepcrlist\caption at lsepname
-        {\caption at Error{%
-           The option `labelsep=\caption at lsepname' does not work\MessageBreak
-           with \noexpand\setcaphanging (which is set by default)}}%
-        {\caption at fmt@hang{#1}{#2}{#3}}%
-    \else
-      #1#2%
-      \ifdim\cap at indent<\z@
-        \par
-        \noindent\hspace*{-\cap at indent}%
-      \else\if at capbreak
-        \par
-      \fi\fi
-      #3\par
-    \fi}
-  \DeclareCaptionLabelSeparator{default}{\captionformat}
-  \DeclareCaptionDefaultFont{font}{\scr at fnt@caption}
-  \DeclareCaptionDefaultFont{labelfont}{\scr at fnt@captionlabel}
-  \let\caption at KV@parindent\KV at caption@parindent
-  \DeclareCaptionOption{parindent}[]{%
-    \ifx,#1,%
-      \caption at Debug{Option `parindent' ignored}%
-    \else
-      \caption at KV@parindent{#1}%
-    \fi}%
-  \let\caption at KV@parskip\KV at caption@parskip
-  \DeclareCaptionOption{parskip}[]{%
-    \ifx,#1,%
-      \caption at Debug{Option `parskip' ignored}%
-    \else
-      \caption at KV@parskip{#1}%
-    \fi}%
-}{}
-\caption at ifclassloaded{ntg}{%
-  \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont}
-  \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont}
-}{}
-\caption at ifclassloaded{thesis}{%
-  \DeclareCaptionDefaultFormat{hang}
-  \DeclareCaptionDefaultFont{labelfont}{\cph at font}
-  \DeclareCaptionDefaultFont{textfont}{\cpb at font}
-}{}
-\caption at ifdefined\ArabiCoreLoaded{%
-  \newcommand\caption at rl[1]{\if at rl\textRL{#1}\else\textLR{#1}\fi}
-  \def\fnum at figure{\figurename\nobreakspace\thefigure}%
-  \def\fnum at table{\tablename\nobreakspace\thetable}%
-  \DeclareCaptionLabelSeparator{arabi}{ : }
-  \DeclareCaptionLabelSeparator{default}{%
-    \if at rl\caption at lsep@arabi\else\caption at lsep@colon\fi}
+\newcommand*\AtCaptionPackage{%
+  \g at addto@macro\caption at documentclass@code}
+\@onlypreamble\AtCaptionPackage
+\providecommand*\caption at documentclass@code{}
+\@onlypreamble\caption at documentclass@code
+\newcommand*\caption at IfBabelPackageLoaded[4]{%
+  \caption at ifdefined#2\@firstofone\caption at AtBeginDocument{%
+    \caption at if@bool{\@nameuse{caption at ifbabel@#1}}%
+      {\def\caption at tempa{\caption at ifdefined#2}}%
+      {\let\caption at tempa\@secondoftwo}%
+    \caption at tempa
+      {\caption at InfoNoLine{#1 babel package is loaded}#3}%
+      {#4}}}
+\@onlypreamble\caption at IfBabelPackageLoaded
+\DeclareCaptionLabelSeparator{arabi}{\if at rl\space\fi: }
+\newcommand*\caption at IfBabelArabi{%
+  \caption at IfBabelPackageLoaded{arabi}{\ArabiCoreLoaded}}
+\@onlypreamble\caption at IfBabelArabi
+\providecommand*\caption at ifbabel@arabi{true}
+\caption at IfBabelArabi{%
+  \newcommand\caption at rl[1]{\if at rl\textRL{#1}\else\textLR{#1}\fi}%
+  \caption at ifdefined\extrasarabic{%
+    \addto\extrasarabic{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{arabi}}}{}%
+  \caption at ifdefined\extrasfarsi{%
+    \addto\extrasfarsi{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{arabi}}}{}%
 }{%
   \let\caption at rl\@firstofone
 }
-\caption at ifdefined\FB at makecaption{%
-  \ifx\@makecaption\STD at makecaption
-    \DeclareCaptionLabelSeparator{default}{\CaptionSeparator}
-    \def\caption at frenchb{% supress frenchb warning
-      \let\STD at makecaption\@makecaption
-      \let\FB at makecaption\@makecaption}
-  \else
-    \ifx\@makecaption\@undefined\else
-      \caption at InfoNoLine{%
-        The definition of \protect\@makecaption\space
-        has been changed,\MessageBreak
-        frenchb will NOT customize it}%
-    \fi
+\caption at ifdecl{labelseparator}{french}
+  {\let\caption at french@labelseparator\@undefined}%
+  {\caption@@set{labelseparator}{labelseparator at french}{default}%
+   \let\caption at french@labelseparator\caption at labelseparator@french}
+\newcommand*\caption at IfBabelFrench{%
+  \caption at IfBabelPackageLoaded{french}{\FB at makecaption}}
+\@onlypreamble\caption at IfBabelFrench
+\providecommand*\caption at ifbabel@french{true}
+\caption at IfBabelFrench{%
+  \ifx\caption at french@labelseparator\caption at labelseparator@french % still set to dummy label separator?
+    \DeclareCaptionLabelSeparator{french}{%
+      \ifFBCustomiseFigTabCaptions
+        \CaptionSeparator
+      \else
+        \space : %
+      \fi}%
   \fi
+  \caption at ifdefined\extrasfrench{%
+    \addto\extrasfrench{%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{french}}}{}%
+  \caption at AtBeginDocument{\@nameuse{@FBwarning at capsepfalse}}%
 }{}
-\caption at ifdefined\frenchTeXmods{%
-  \DeclareCaptionDefaultFont{textfont}{\itshape}%
-  \DeclareCaptionLabelSeparator{default}{\captionseparator\space}%
+\newcommand*\caption at IfFrenchLe{%
+  \caption at IfBabelPackageLoaded{frenchle}{\frenchTeXmods}}
+\@onlypreamble\caption at IfBabelFrenchLe
+\providecommand*\caption at ifbabel@frenchle{true}
+\caption at IfFrenchLe{%
+  \ifx\caption at french@labelseparator\caption at labelseparator@french % still set to dummy label separator?
+    \DeclareCaptionLabelSeparator{french}{\captionseparator\space}%
+  \fi
+  \g at addto@macro\extrasfrench{%
+    \caption at switchdefault{labelseparator}{\let\caption at original@labelseparator#1}{french}%
+    \caption at switchdefault{font}{\let\caption at original@font#1}{it}%
+    \caption at switchdefault{labelfont}{\let\caption at original@labelfont#1}{up}}%
+  \g at addto@macro\extrasenglish{%
+    \caption at restoredefault{labelseparator}{\caption at original@labelseparator}%
+    \caption at restoredefault{font}{\caption at original@font}%
+    \caption at restoredefault{labelfont}{\caption at original@labelfont}}%
+  \caption at AtBeginDocument{%
+    \let\captionfont at original\captionfont
+    \let\captionlabelfont at original\captionlabelfont}%
+  \g at addto@macro\GOfrench{%
+    \let\captionfont\captionfont at original
+    \let\captionlabelfont\captionlabelfont at original}%
 }{}
-\DeclareCaptionListFormat{subperiod}{#2.}
-\def\caption at tempa#1{%
-  \@ifpackagewith{babel}{#1}{%
-    \caption at InfoNoLine{#1 babel option is loaded}%
-    \expandafter\addto\csname extras#1\endcsname{%
-       % change default labelsep and listformat
-       \caption at setdefaultlabelsep{period}%
-       \caption at setdefaultlistformat{subperiod}}%
-    \expandafter\addto\csname noextras#1\endcsname{%
-       % change default labelsep and listformat
-       \caption at setdefaultlabelsep{colon}%
-       \caption at setdefaultlistformat{subsimple}}%
-  }{}}
-\caption at tempa{hungarian}
-\caption at tempa{magyar}
-\newcommand*\caption at xpackage[2]{%
-  \expandafter\ifx\csname ver@#2.\caption at pkgextension\endcsname\relax
-    \expandafter\@firstofone
+\DeclareCaptionLabelFormat{magyar}{#2\bothIfSecond{.~}{#1}}
+\newcommand*\caption at IfBabelHungarian{%
+  \caption at IfBabelPackageLoaded{hungarian}{\magyar at opt@defaults}}
+\@onlypreamble\caption at IfBabelHungarian
+\providecommand*\caption at ifbabel@hungarian{true}
+\caption at IfBabelHungarian{%
+  \caption at ifdefined\extrashungarian{%
+    \addto\extrashungarian{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{magyar}%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{period}%
+      \caption at switchdefault{listformat}{\babel at save #1}{subperiod}}}{}%
+  \caption at ifdefined\extrasmagyar{%
+    \addto\extrasmagyar{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{magyar}%
+      \caption at switchdefault{labelseparator}{\babel at save #1}{period}%
+      \caption at switchdefault{listformat}{\babel at save #1}{subperiod}}}{}%
+}{}
+\DeclareCaptionLabelFormat{latvian}{#2\bothIfSecond{~}{#1}}
+\newcommand*\caption at IfBabelLatvian{%
+  \caption at IfBabelPackageLoaded{latvian}{\bbl at latvianindent}}
+\@onlypreamble\caption at IfBabelLatvian
+\providecommand*\caption at ifbabel@latvian{true}
+\caption at IfBabelLatvian{%
+  \caption at ifdefined\extraslatvian{%
+    \addto\extraslatvian{%
+      \caption at switchdefault{labelformat}{\babel at save #1}{latvian}}}{}%
+}{}
+\newcommand*\caption at ifpackageloaded[1]{%
+  \expandafter\ifx\csname ver@#1.\caption at pkgextension\endcsname\relax
+    \expandafter\@secondoftwo
   \else
-    \expandafter\@gobbletwo
-  \fi
-  {#1{#2}}}
+    \expandafter\@firstoftwo
+  \fi}
 \let\caption at pkgextension\@pkgextension
-\newcommand*\caption at loadpackage{%
-  \caption at xpackage\caption@@loadpackage}
-\newcommand*\caption@@loadpackage[2]{%
-  \caption at Info{Option `#2' requires the `#1' package}%
-  \RequirePackage{#1}\relax}
-\newcommand*\caption at requirepackage{%
-  \caption at xpackage\caption@@requirepackage}
+\newcommand*\caption at pkg@list{}
+\newcommand*\caption at requirepackage[2]{%
+  \caption at ifpackageloaded{#1}{}{\caption@@requirepackage{#1}{#2}}}
 \newcommand*\caption@@requirepackage[2]{%
-  \@cons\caption at packagelist{{#1}{#2}}}% load package later on
-\newcommand*\caption at pkg@list{}
+  \@cons\caption at packagelist{{#1}{#2}}} % load package later on
+\caption at AtBeginDocument{%
+  \renewcommand*\caption@@requirepackage[2]{%
+    \caption at Error{Option `#2' requires the `#1' package}}}
 \newcommand*\caption at packagelist{}
 \@onlypreamble\caption at packagelist
 \caption at AtBeginDocument{%
@@ -1246,21 +1244,35 @@
     \g at addto@macro\caption at tempa{%
       \caption at loadpackage{#1}{#2}}}%
   \caption at packagelist
-  \caption at tempa
-  \renewcommand*\caption@@loadpackage[2]{%
-    \caption at Error{Option `#2' requires the `#1' package}}%
-  \let\caption@@requirepackage\caption@@loadpackage
-  }
-\newcommand*\caption at usepackage[3]{%
+  \caption at tempa}
+\newcommand*\caption at loadpackage[2]{%
+  \caption at ifpackageloaded{#1}{}{\caption@@loadpackage{#1}{#2}}}
+\newcommand*\caption@@loadpackage[2]{%
+  \caption at Info{Option `#2' requires the `#1' package}%
+  \RequirePackage{#1}\relax}
+\caption at AtBeginDocument{%
+  \let\caption@@loadpackage\caption@@requirepackage}
+\caption at AtBeginDocument{%
+  \def\@tempa{2008/08/02 v0.3b floatrow: float package extension}%
+  \expandafter\ifx\csname ver at floatrow.sty\endcsname\@tempa
+    \caption at InfoNoLine{floatrow package v0.3b is loaded}%
+    \renewcommand\captionlabel[1]{{% l.559
+      \def\FR at tmp{\@captype}%
+      \ifnum\floatbox at depth>\@ne
+        \def\FR at tmp{sub\@captype}\caption at setsubtype*{\FR at tmp}\stepcounter{\FR at tmp}%
+      \fi
+      \caption at format % <= This line added
+      \caption@@@make{\caption at fnum\FR at tmp}{#1}}}
+  \fi}
+\newcommand*\caption at newfloat[2]{%
   \IfCaptionOptionCheck
-    {\caption at requirepackage{#1}{#2}}%
+    {\caption at requirepackage{newfloat}{#1}}%
     {\let\KV at prefix@ORI\KV at prefix
      \let\@tempc at ORI\@tempc
-     \caption at loadpackage{#1}{#2}%
-     #3%
+     \caption at loadpackage{newfloat}{#1}%
+     #2%
      \let\@tempc\@tempc at ORI
      \let\KV at prefix\KV at prefix@ORI}}
-\newcommand*\caption at newfloat{\caption at usepackage{newfloat}}
 \DeclareCaptionOption{figurename}{\caption at SetName{figure}{#1}}
 \@onlypreamble at key{caption}{figurename}
 \DeclareCaptionOption{tablename}{\caption at SetName{table}{#1}}
@@ -1281,9 +1293,9 @@
 \DeclareCaptionOption{tablewithin}{\caption at within{table}{#1}}
 \DeclareCaptionOptionNoValue{tablewithout}{\caption at within{table}{none}}
 \newcommand*\caption at within[2]{%
-  \caption at newfloat{#1within}{\newfloat at setwithin{#1}{#2}}}
+  \caption at newfloat{#1within=#2}{\newfloat at setwithin{#1}{#2}}}
 \DeclareCaptionOption{within}{%
-  \caption at newfloat{within}{\newfloatsetup{within=#1}}}
+  \caption at newfloat{within=#1}{\newfloatsetup{within=#1}}}
 \DeclareCaptionOptionNoValue{without}{%
   \caption at newfloat{without}{\newfloatsetup{without}}}
 \DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
@@ -1337,12 +1349,8 @@
     \@ifnextchar [%  %] match left bracket
       {\sf@@subfloat}%
       {\sf@@subfloat[\@empty]}}
-%%\@ifl at aded{dtx}{subfig}{\caption at loadpackage{ragged2e}{}}{} % not needed
 \DeclareCaptionOption{lofdepth}[2]{\caption at ifdefined\c at lofdepth{\setcounter{lofdepth}{#1}}{}}
 \DeclareCaptionOption{lotdepth}[2]{\caption at ifdefined\c at lotdepth{\setcounter{lotdepth}{#1}}{}}
-\captionsetup{style=default,position=default,%
-              list,listformat=default,twoside=\if at twoside 1\else 0\fi}
-\ProcessOptions*
 \newcommand\caption at addcontentsline[2]{%
   \caption at ifcontentsline{#2}{%
     \begingroup
@@ -1368,7 +1376,7 @@
       \caption at add@contentsline
         {\csname ext@#1\endcsname}%
         {#1}%
-        {\caption at lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+        {\caption at listformat{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
         {\ignorespaces #2}%
       \caption at chkfloat{#1}{#2}}}}
 \newcommand*\caption at add@contentsline{%
@@ -1387,8 +1395,14 @@
   \fi}
 \newcommand*\caption at addsubcontentslines[1]{}
 \newif\ifcaption at star
-\newcommand*\caption at fnum[1]{\caption at lfmt{\@nameuse{#1name}}{\@nameuse{the#1}}}
-\newcommand\caption at make[2]{\caption@@make{\caption at lfmt{#1}{#2}}}
+\newcommand*\caption at aboveskip{%
+  \vskip\abovecaptionskip}
+\newcommand*\caption at belowskip{%
+  \vskip\belowcaptionskip}
+\newcommand*\caption at fnum[1]{%
+  \expandafter\let\expandafter\caption at original@fnum\csname caption at fnum@#1\endcsname % for label format `original'
+  \caption at labelformat{\@nameuse{#1name}}{\@nameuse{the#1}}}
+\newcommand\caption at make[2]{\caption@@make{\caption at labelformat{#1}{#2}}}
 \newcommand\caption@@make[2]{%
   \begingroup
     \caption@@make@{#1}{#2}%
@@ -1398,18 +1412,18 @@
   \caption at stepthecounter
   \caption at beginhook
   \caption at box\hsize{%
-    \caption at ifslc{\caption at slc{#1}{#2}\caption at singleline\relax}{}%
+    \caption at singlelinecheck{\caption at slc{#1}{#2}\caption at singleline\caption at multiline}{\caption at multiline}%
     \caption at calcmargin
     \caption at tempdima\captionmargin
     \ifdim\captionmargin@=\z@ \else
       \caption at ifoddpage{}{\advance\caption at tempdima\captionmargin@}%
     \fi
-    \caption at ifh{\advance\caption at tempdima\caption at indent}%
+    \caption at ifhmode{\advance\caption at tempdima\caption at indent}%
     \hspace\caption at tempdima
     \caption at tempdima\captionwidth
-    \caption at ifh{\advance\caption at tempdima-\caption at indent}%
+    \caption at ifhmode{\advance\caption at tempdima-\caption at indent}%
     \caption at parbox\caption at tempdima{%
-      \caption at ifh{%
+      \caption at ifhmode{%
         \ifdim\caption at indent=\z@
           \leavevmode
         \else
@@ -1458,7 +1472,7 @@
   \singlelinecaptiontrue
   \begingroup
   \caption at singleline
-  \let\caption at hj\@empty
+  \let\caption at justification\relax
   \caption at calcmargin % calculate \captionwidth
   \caption at prepareslc
   \sbox\@tempboxa{\caption@@@make{#1}{#2}}%
@@ -1473,8 +1487,11 @@
   \caption at Debug{End SLC}}
 \newif\ifsinglelinecaption
 \newcommand*\caption at singleline{%
-  \caption at xsetup\caption at opt@singleline
+  \caption at xsetup\caption at slsty % Note: This could change \caption at format
+  \caption at format               % defines \caption at ifhmode, \caption at slfmt, and \caption at fmt
   \let\caption at fmt\caption at slfmt}
+\newcommand*\caption at multiline{%
+  \caption at format}              % defines \caption at ifhmode, \caption at slfmt, and \caption at fmt
 \providecommand*\caption at prepareslc{}
 \g at addto@macro\caption at prepareslc{%
   \let\label\caption at gobble
@@ -1491,7 +1508,6 @@
   \def\endnotemark{\caption at withoptargs\caption at endnotemark}%
   \let\caption at endnotetext@ORI\@endnotetext
   \let\@endnotetext\caption at gobble
-  \let\pagenote\caption at gobble
   \let\acused\@gobble
   \let\AC at placelabel\@gobble
   \let\glsunset\@gobble
@@ -1512,26 +1528,18 @@
   \endgroup}
 \newcommand*\caption at l@stepcounter[1]{%
   \advance\csname c@#1\endcsname\@ne\relax}
-\caption at ifclassloaded{beamer}{%
-  \g at addto@macro\caption at prepareslc{%
-    \def\footnote{%
-      \begingroup
-      \let\stepcounter\caption at l@stepcounter
-      \renewcommand<>\beamer at framefootnotetext[1]{%
-        \endgroup}%
-      \let\@footnotetext\beamer at framefootnotetext
-      \caption at footnote@ORI}}}{}
 \newcommand*\caption at applyfont{%
-  \caption at hj\captionfont\captionsize}
+  \caption at justification\captionfont\captionsize}
 \newcommand\caption@@@make[2]{%
   \sbox\@tempboxa{#1}%
   \ifdim\wd\@tempboxa=\z@
-    \let\caption at lsep\relax
+    \caption at set{labelseparator}{none}%
   \fi
   \caption at ifempty{#2}{%
-    \let\caption at lsep\@empty
-    \let\caption at tfmt\@firstofone
+    \caption at set{labelseparator}{none}%
+    \caption at set{textformat}{simple}%
   }%
+  \caption at labelseparator % defines \caption at iflabelfont, \caption at labelsep and \caption at labelsep@name (the latter is needed by \caption at fmt)
   \@setpar{\@@par\caption@@par}\caption@@par
   \caption at applyfont
   \caption at fmt
@@ -1543,23 +1551,23 @@
      \fi}%
     {\ifcaption at star\else
        \begingroup
-         \caption at iflf\captionlabelfont
-         \relax\caption at lsep
+         \caption at iflabelfont\captionlabelfont
+         \relax\caption at labelsep
        \endgroup
      \fi}%
     {{\captiontextfont
-      \captiontextstart
+      \caption at textstart
       \caption at ifstrut
         {\vrule\@height\ht\strutbox\@width\z@}%
         {}%
       \nobreak\hskip\z at skip % enable hyphenation
-      \caption at tfmt{#2}%
+      \caption at textformat{#2}%
       \caption at ifstrut
         {\ifhmode\@finalstrut\strutbox\fi}%
         {}%
-      \captiontextend}}}
-\newcommand*\captiontextstart{}
-\newcommand*\captiontextend{\par}
+      \caption at textend}}}
+\newcommand*\caption at textstart{}
+\newcommand*\caption at textend{\par}
 \newcommand\caption at ifempty[1]{%
   \caption at if@empty{#1}%
   \caption at ifempty\@unused}
@@ -1601,17 +1609,21 @@
 \newcommand*\caption@@par{%
   \parindent\caption at parindent\hangindent\caption at hangindent}%
 \newcommand*\DeclareCaptionType{%
-  \caption at loadpackage{newfloat}{}%
+  \caption at loadpackage{newfloat}{declare type}%
   \DeclareFloatingEnvironment}
 \@onlypreamble\DeclareCaptionType
-\newcommand\caption at ForEachType[1]{%
+\newcommand*\ForEachCaptionType{%
+  \@ifstar
+    {\caption at foreach@type\@gobble}%
+    {\caption at foreach@type\@iden}}
+\newcommand\caption at foreach@type[2]{%
   \caption at ifdefined\ForEachFloatingEnvironment
-    {\ForEachFloatingEnvironment{#1}}%
-    {\def\@elt##1{#1}%
+    {\ForEachFloatingEnvironment*{#2}}%
+    {\def\@elt##1{#2}%
      \caption at ifdefined\c at figure\@elt\@gobble{figure}%
      \caption at ifdefined\c at table\@elt\@gobble{table}%
-     \let\@elt\relax
-     \newfloat at addtohook{#1}}}
+     \let\@elt\relax}%
+  #1{\newfloat at addtohook{#2}}}
 \providecommand\newfloat at addtohook[1]{%
   \toks@=\expandafter{\newfloat at hook{##1}#1}%
   \edef\@tempa{\def\noexpand\newfloat at hook####1{\the\toks@}}%
@@ -1626,28 +1638,28 @@
 \def\caption@@declaresubtype#1[#2]#3{%
   \@ifundefined{c@#3}%
     {\caption at Error{No float type '#3' defined}}%
-    {\caption at ifsubtype{sub#3}%
-     {\caption at Debug{Modify subtype `sub#3'}}%
-     {\caption at Debug{New subtype `sub#3'}%
-      \@ifundefined{c at sub#3}%
-        {\newcounter{sub#3}\relax}%
-        {\caption at Warning{Using already defined counter `sub#3'}}%
-      \@addtoreset{sub#3}{#3}%
-      \@namedef{ext at sub#3}{\csname ext@#3\endcsname}%
-      \caption at declaresublistentry{#3}%
-      \@cons\caption at subtypelist{{#3}}}%
-     \caption at ifdefined\contentsuse{%
-       \contentsuse{sub#3}{\csname ext at sub#3\endcsname}}{}%
-     \@namedef{sub#3name}{}%
-     \@namedef{sub#3autorefname}{\csname #3autorefname\endcsname}%
-     #1% is \@firstoftwo in star form, and \@secondoftwo otherwise
-     {\@namedef{p at sub#3}{}%
-      \@namedef{thesub#3}{\csname the#3\endcsname.\@nameuse{#2}{sub#3}}}%
-     {\@namedef{p at 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 at ifin@list\caption at subtypelist{#4}%
+    {\caption at Debug{Modify subtype `#4'}}%
+    {\caption at Debug{New subtype `#4'}%
+     \newcounter{#4}[{#3}]%
+     \@namedef{ext@#4}{\csname ext@#3\endcsname}%
+     \caption at declaresublistentry{#3}%
+     \caption at l@addto at list\caption at subtypelist{#4}%
+     \caption at subtype@hook{#4}}%
+    \caption at 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 at declaresublistentry{%
   \caption at ifdefined\l at chapter
     {\caption@@declaresublistentry\l at subsection}%
@@ -1691,37 +1703,43 @@
   \fi}
 \@onlypreamble\caption@@@@@@declaresublistentry
 \newcommand*\caption at subtypelist{}
-\newcommand*\caption at ifsubtype[1]{%
-  \begingroup
-    \let\next\@secondoftwo
-    \edef\@tempa{#1}%
-    \def\@elt##1{%
-      \def\@tempb{sub##1}%
-      \ifx\@tempa\@tempb
-        \let\next\@firstoftwo
-     \fi}%
-    \caption at subtypelist
-  \expandafter\endgroup\next}
-\newcommand*\caption at restorecounters{%
-  \caption at restore@counters
-  \global\let\caption at restore@counters\@empty}
-\newcommand*\caption at restore@counters{}
+\newcommand*\caption at ifsubtype{%
+  \caption at ifin@list\caption at subtypelist}
+\newcommand*\ForEachCaptionSubType{%
+  \@ifstar
+    {\caption at foreach@subtype\@gobble}%
+    {\caption at foreach@subtype\@iden}}
+\newcommand\caption at foreach@subtype[2]{%
+  \caption at for@list\caption at subtypelist{#2}%
+  #1{\caption at addto@subtype at hook{#2}}}
+\providecommand\caption at addto@subtype at hook[1]{%
+  \toks@=\expandafter{\caption at subtype@hook{##1}#1}%
+  \edef\@tempa{\def\noexpand\caption at subtype@hook####1{\the\toks@}}%
+  \@tempa}
+\providecommand*\caption at subtype@hook[1]{}
 \newcommand*\caption at savesubcounters{%
-  \def\@elt##1{\caption at savecounter{sub##1}}%
-  \caption at subtypelist
-  \let\@elt\relax}%
+  \caption at for@list\caption at subtypelist{\caption at savecounter{##1}}}
 \newcommand*\caption at savecounter[1]{%
   \edef\caption at tempa{%
     \noexpand\l at addto@macro\noexpand\caption at restore@counters
       {\noexpand\setcounter{#1}{\number\value{#1}}}}%
   \caption at tempa}
-\newcommand*\caption at For{%
-  \caption at withoptargs\caption@@For}
-\newcommand\caption@@For[3]{%
-  \caption at AtBeginDocument#1{%
-    \def\@elt##1{#3}%
-    \@nameuse{caption@#2}%
-    \let\@elt\relax}}%
+\newcommand*\caption at restorecounters{%
+  \caption at restore@counters
+  \global\let\caption at restore@counters\@empty}
+\newcommand*\caption at restore@counters{}
+\ifx\caption at documentclass\@empty\else
+  \@pushfilename
+  \edef\@currname{caption-\caption at 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'.

Modified: trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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.
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -25,37 +25,42 @@
 %% 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 at CheckCompatibility{%
-  \@ifundefined{caption at ifcompatibility}{}{%
-    \caption at ifcompatibility{%
-      \caption at 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 at CheckCompatibility{%
+  \caption at ifcompatibility{%
+    \PackageError{subcaption}%
+      {This package does not work with\MessageBreak
+       caption option `compatibility=v1'}%
+      {\subcaption at eh}%
+    \endinput}{}%
   \@ifpackageloaded{subfigure}{%
     \PackageError{subcaption}%
       {This package can't be used in cooperation\MessageBreak
        with the subfigure package}%
-      {\subcaption at EH}%
+      {\subcaption at eh}%
     \endinput}{}%
   \@ifpackageloaded{subfig}{%
     \PackageError{subcaption}%
       {This package can't be used in cooperation\MessageBreak
        with the subfig package}%
-      {\subcaption at EH}%
+      {\subcaption at eh}%
     \endinput}{}%
 }
-\newcommand*\subcaption at EH{%
+\newcommand*\subcaption at 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}
@@ -62,10 +67,8 @@
 \subcaption at CheckCompatibility
 \caption at AtBeginDocument{%
   \subcaption at CheckCompatibility
-  \let\subcaption at CheckCompatibility\@undefined
-  \let\subcaption at EH\@undefined
-}
-\caption at ForEachType{\DeclareCaptionSubType{#1}}
+  \let\subcaption at CheckCompatibility\@undefined}
+\ForEachCaptionType{\DeclareCaptionSubType{#1}}
 \caption at ifundefined\newsubfloat{}{%
   \renewcommand*\newsubfloat{\DeclareCaptionSubType}}
 \def\subcaption{%
@@ -81,13 +84,13 @@
     {\caption at Error{\noexpand\phantomsubcaption outside float}}}%
 \g at addto@macro\caption at subtypehook{%
   \let\phantomsubcaption\phantomcaption}
-\caption at For{subtypelist}{%
-  \newenvironment{sub#1}%
+\ForEachCaptionSubType{%
+  \newenvironment{#1}%
     {\@ifnextchar[%]
        \subcaption at iminipage
        {\subcaption at iminipage[c]}}%
     {\subcaption at endminipage
-     \endminipage}}%
+     \endminipage}}
 \def\subcaption at iminipage[#1]{%
   \caption at withoptargs{\subcaption at iiminipage{#1}}}
 \newcommand*\subcaption at iiminipage[3]{%
@@ -136,13 +139,13 @@
 \newcommand*\p at subref{}
 \DeclareCaptionOption{subrefformat}{\subcaption at setrefformat{#1}}
 \newcommand*\subcaption at setrefformat[1]{%
-  \@ifundefined{caption at lfmt@#1}%
+  \@ifundefined{caption at labelformat@#1}%
     {\caption at Error{Undefined label format `#1'}}%
-    {\expandafter\let\expandafter\subcaption at reffmt\csname caption at lfmt@#1\endcsname}}
+    {\expandafter\let\expandafter\subcaption at reffmt\csname caption at labelformat@#1\endcsname}}
 \subcaption at setrefformat{simple}
 \caption at SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
 \caption at 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 at 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 at getlabel#3\label{}\@nil
+  \caption at getlabel{#3}%
   #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
   \global\let\caption at 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 at hj@default]%
+    [\wd\@tempboxa][\captionbox at innerpos@default]%
     {\unhbox\@tempboxa}%
   \ignorespaces}
 \endinput

Deleted: trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty	2020-08-29 23:53:49 UTC (rev 56212)
+++ trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty	2020-08-30 21:10:24 UTC (rev 56213)
@@ -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 at 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 at text{\reset at 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 at counters{{#1}}}}}
-\@onlypreamble\DeclareTotalCounter
-\let\totalcount at counters\@empty
-\newcommand*\totalcount at xspace{}
-\DeclareOption{xspace}{\renewcommand*\totalcount at xspace{\xspace}}
-\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
-\ProcessOptions\relax
-\ifx\totalcount at xspace\@empty\else
-  \RequirePackage{xspace}
-\fi
-\newcommand*\totalcount at addtocounter[1]{%
-  \@ifundefined{c at totalcount@#1}{}{%
-    \addtocounter{totalcount@#1}{\value{#1}}}}
-\let\totalcount at stpelt@ORI\@stpelt
-\renewcommand*\@stpelt[1]{%
-  \totalcount at addtocounter{#1}%
-  \totalcount at stpelt@ORI{#1}}
-\newcommand*\totalcount at set[2]{%
-  \@ifundefined{c at totalcount@#1}%
-    {}%
-    {\global\@namedef{total#1s}{#2\totalcount at xspace}%
-     \ifnum#2<1\relax \else
-       \global\@nameuse{total#1strue}%
-     \fi}}
-\AtBeginDocument{\AtEndDocument{%
-  \begingroup
-    \@tempswafalse
-    \if at filesw
-      \immediate\write\@mainaux{%
-        \string\providecommand\string\totalcount at set[2]{}}%
-    \fi
-    \def\@elt#1{%
-      \totalcount at addtocounter{#1}%
-      \edef\totalcount at tempa{\the\value{totalcount@#1}}%
-      \expandafter\let\expandafter\totalcount at tempb\csname total#1s\endcsname
-      \@expandtwoargs\totalcount at set{#1}{\totalcount at tempa}%
-      \expandafter\ifx\csname total#1s\endcsname\totalcount at tempb \else
-        \@tempswatrue
-      \fi
-      \if at filesw
-        \immediate\write\@mainaux{%
-          \string\totalcount at set{#1}{\totalcount at tempa}}%
-      \fi}%
-    \totalcount at counters
-    \if at tempswa
-      \PackageWarningNoLine{totalcount}{%
-        Total counter(s) have changed.\MessageBreak
-        Rerun to get them right}%
-    \fi
-  \endgroup}}%
-\endinput
-%%
-%% End of file `totalcount.sty'.



More information about the tex-live-commits mailing list.