texlive[55099] Master/texmf-dist: caption (11may20)

commits+karl at tug.org commits+karl at tug.org
Mon May 11 22:46:52 CEST 2020


Revision: 55099
          http://tug.org/svn/texlive?view=revision&revision=55099
Author:   karl
Date:     2020-05-11 22:46:52 +0200 (Mon, 11 May 2020)
Log Message:
-----------
caption (11may20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/caption/README
    trunk/Master/texmf-dist/source/latex/caption/caption.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
    trunk/Master/texmf-dist/tex/latex/caption/caption.sty
    trunk/Master/texmf-dist/tex/latex/caption/caption3.sty

Modified: trunk/Master/texmf-dist/doc/latex/caption/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/README	2020-05-11 20:46:30 UTC (rev 55098)
+++ trunk/Master/texmf-dist/doc/latex/caption/README	2020-05-11 20:46:52 UTC (rev 55099)
@@ -1,7 +1,7 @@
 ==========================================================================
 
 The `caption' package bundle
-Release 2020-01-22
+Release 2020-05-10
 Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 
 License: LPPL = LaTeX Project Public Licence

Modified: trunk/Master/texmf-dist/source/latex/caption/caption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-05-11 20:46:30 UTC (rev 55098)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-05-11 20:46:52 UTC (rev 55099)
@@ -28,7 +28,7 @@
 %   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 % 
 % \fi
-% \CheckSum{3044}
+% \CheckSum{2977}
 %
 % \iffalse
 %<*driver>
@@ -218,13 +218,13 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/01/03 v3.4h Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/05/10 v3.4j Customizing captions (AR)]
 %    \end{macrocode}
 %
 % \section{Loading the kernel}
 %
 %    \begin{macrocode}
-\RequirePackage{caption3}[2020/01/03] % needs v1.8h or newer
+\RequirePackage{caption3}[2020/05/10] % needs v1.10 or newer
 %    \end{macrocode}
 %
 % \section{Check against unknown document classes}
@@ -282,123 +282,6 @@
 %
 % \section{Declaration of options}
 %
-% \subsection{Options for figure and table}
-%
-% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
-%    \begin{macrocode}
-\DeclareCaptionOption{figureposition}{%
-  \captionsetup*[figure]{position=#1}}
-\@onlypreamble at key{caption}{figureposition}
-%    \end{macrocode}
-%    \begin{macrocode}
-\DeclareCaptionOption{tableposition}{%
-  \captionsetup*[table]{position=#1}}
-\@onlypreamble at key{caption}{tableposition}
-%    \end{macrocode}
-%
-% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
-% \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
-% \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
-%    \begin{macrocode}
-\DeclareCaptionOption{figurename}{\caption at SetName{figure}{#1}}
-\@onlypreamble at key{caption}{figurename}
-\DeclareCaptionOption{tablename}{\caption at SetName{table}{#1}}
-\@onlypreamble at key{caption}{tablename}
-%    \end{macrocode}
-%
-% \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
-%    \begin{macrocode}
-\DeclareCaptionOption{listfigurename}{\caption at SetName{listfigure}{#1}}
-\@onlypreamble at key{caption}{listfigurename}
-\DeclareCaptionOption{listtablename}{\caption at SetName{listtable}{#1}}
-\@onlypreamble at key{caption}{listtablename}
-%    \end{macrocode}
-%
-% \begin{macro}{\caption at SetName}
-% \changes{v3.1}{2007/07/04}{This macro added}
-% \changes{v3.1f}{2007/11/18}{After-preamble variant added}
-% \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption at SetFloatName} to \cs{caption at SetName}}
-% \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
-% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
-% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption at NewFloat} now}
-%  |\caption at SetName|\marg{float}\marg{name}
-%    \begin{macrocode}
-\newcommand*\caption at SetName[2]{%
-  \caption at NewFloat{\newfloat at setname{#1}{#2}}}
-\@onlypreamble\caption at SetName
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-\DeclareCaptionOption{name}{\caption at setname\@captype{#1}}
-%    \end{macrocode}
-% \begin{macro}{\caption at setname}
-%  |\caption at setname|\marg{float}\marg{name}
-%    \begin{macrocode}
-\newcommand*\caption at setname[2]{%
-  \@namedef{#1name}{#2}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
-% \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
-% \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
-% \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined
-%                             floats declared with \cs{DeclareCaptionType}, too}
-%
-% \begin{macro}{\caption at DeclareWithinOption}
-% \changes{v3.1l}{2010/01/09}{This macro and its usage added}
-% |\caption at DeclareWithinOption|\marg{float}
-% declares the options \meta{float}\texttt{within} and \meta{float}\texttt{without},
-% e.g. \texttt{figurewithin} and \texttt{figurewithout}.
-%    \begin{macrocode}
-\newcommand*\caption at DeclareWithinOption[1]{%
-  \DeclareCaptionOption{#1within}{\caption at Within{#1}{##1}}%
-  \DeclareCaptionOptionNoValue{#1without}{\caption at Within{#1}{none}}}
-\@onlypreamble\caption at DeclareWithinOption
-%    \end{macrocode}
-% \end{macro}
-%    \begin{macrocode}
-\caption at DeclareWithinOption{figure}
-\caption at DeclareWithinOption{table}
-%    \end{macrocode}
-%    \begin{macrocode}
-\DeclareCaptionOption{within}{%
-  \caption at NewFloat{\newfloatsetup{within=#1}}}
-\DeclareCaptionOptionNoValue{without}{%
-  \caption at NewFloat{\newfloatsetup{without}}}
-%    \end{macrocode}
-% \begin{macro}{\caption at Within}
-% \changes{v3.1}{2007/12/21}{This macro added}
-% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
-% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption at NewFloat} now}
-% |\caption at Within|\marg{float}\marg{value}
-%    \begin{macrocode}
-\newcommand*\caption at Within[2]{%
-  \caption at NewFloat{\newfloat at setwithin{#1}{#2}}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at NewFloat}
-% \changes{v3.2f}{2012/01/12}{This macro added}
-% \changes{v3.4h}{2020/01/03}{Usage of \cs{caption at ifpackageloaded} replaced by \cs{RequirePackage}}
-% |\caption at NewFloat|\marg{code}
-% loads the \package{newfloat} package and executes the given code afterwards.
-% Note: Since the \package{newfloat} package uses the crappy \package{keyval}
-% package, too, we need to save \& restore some macros here, otherwise this
-% recursion won't work properly.
-% {\itshape (TODO: Re-write \package{newfloat} so it uses \package{kvoptions} instead.)}
-%    \begin{macrocode}
-\newcommand*\caption at NewFloat[1]{%
-  \let\KV at prefix@ORI\KV at prefix
-  \let\@tempc at ORI\@tempc
-  \caption at ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
-  #1%
-  \let\@tempc\@tempc at ORI
-  \let\KV at prefix\KV at prefix@ORI}
-%    \end{macrocode}
-% \end{macro}
-%
 % \subsection{Miscellaneous options}
 %
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-05-11 20:46:30 UTC (rev 55098)
+++ trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-05-11 20:46:52 UTC (rev 55099)
@@ -28,7 +28,7 @@
 %   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 % 
 % \fi
-% \CheckSum{3476}
+% \CheckSum{3573}
 %
 % \iffalse
 %<*driver>
@@ -191,7 +191,7 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/01/03 v1.8h caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/05/10 v1.11 caption3 kernel (AR)]
 %    \end{macrocode}
 %
 % \section{Workaround for bug in package \package{arabtex}}
@@ -773,7 +773,6 @@
 % \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.
-% (This way the \package{ragged2e} package check will be done for these options, too.)
 %    \begin{macrocode}
 \newcommand*\caption at checkoptions[1]{%
   \begingroup
@@ -781,14 +780,24 @@
     \caption at setup{#1}%
   \endgroup}
 %    \end{macrocode}
-% Some caption options depend on the definition of |\@captype|,
-% so we set it to |figure| before executing them.
 %    \begin{macrocode}
-\newcommand*\caption at prepare@optioncheck{%
-  \def\@captype{figure}}
+\providecommand*\caption at prepare@optioncheck{}
 %    \end{macrocode}
 % \end{macro}
 %
+% \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.
+%    \begin{macrocode}
+\let\IfCaptionOptionCheck\@secondoftwo
+%    \end{macrocode}
+%    \begin{macrocode}
+\g at addto@macro\caption at prepare@optioncheck{%
+  \let\IfCaptionOptionCheck\@firstoftwo}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\clearcaptionsetup}
 % \changes{v1.1}{2007/07/29}{Optional argument added}
 % \changes{v1.1}{2007/08/17}{Starred variant added}
@@ -1078,17 +1087,17 @@
 %  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 packagelist{}
-\@onlypreamble\caption at packagelist
-%    \end{macrocode}
-%    \begin{macrocode}
 \newcommand\caption at SetupOptions[2]{%
   \@namedef{caption at setkeys@#1}##1##2{#2}%
   \expandafter\@onlypreamble\csname caption at setkeys@#1\endcsname
-  \@cons\caption at packagelist{{#1}}}
+  \@cons\caption at SetupOptions@list{{#1}}}
 \@onlypreamble\caption at SetupOptions
 %    \end{macrocode}
 %    \begin{macrocode}
+\newcommand*\caption at SetupOptions@list{}
+\@onlypreamble\caption at SetupOptions@list
+%    \end{macrocode}
+%    \begin{macrocode}
 \let\caption at onefilewithoptions\@onefilewithoptions
 \def\@onefilewithoptions#1[#2]{%
   \begingroup
@@ -1104,7 +1113,7 @@
         \caption at ExecuteOptions{#1}{#2}%
         \caption at onefilewithoptions{#1}[]}%
     \fi}
-  \caption at packagelist
+  \caption at SetupOptions@list
   \@tempa}
 \@onlypreamble\caption at onefilewithoptions
 %    \end{macrocode}
@@ -1891,17 +1900,45 @@
 % \changes{v1.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
 % \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}
-%  |\DeclareCaptionFont|\marg{name}\marg{code}
+% \changes{v1.10}{2020/05/10}{Optional argument \opt{package} added}
+%  |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
 %    \begin{macrocode}
-\newcommand*\DeclareCaptionFont[2]{%
-  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#2}}}
+\newcommand*\DeclareCaptionFont{%
+  \@ifnextchar[%]
+    \caption at declare@font
+    \caption at declarefont}
 \@onlypreamble\DeclareCaptionFont
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand*\caption at addto@fnt[1]{%
-  \caption at check@ragged{#1}%
-  \l at addto@macro\caption at fnt{#1}}
+\def\caption at declare@font[#1]#2{%
+  \global\@namedef{caption at fnt@#2 at package}{#1}%
+  \caption@@declarefont{#2}}
+\@onlypreamble\caption at declare@font
 %    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at declarefont[1]{%
+  \global\@nameundef{caption at fnt@#1 at package}%
+  \caption@@declarefont{#1}}
+\@onlypreamble\caption at declarefont
+%    \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
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
+\@onlypreamble\caption@@@declarefont
+%    \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}}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\DeclareCaptionDefaultFont}
@@ -2078,29 +2115,11 @@
 \DeclareCaptionFont{larger}{\caption at larger}
 %    \end{macrocode}
 %
-% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
 %    \begin{macrocode}
-\DeclareCaptionFont{sansmath}{\sansmath}
+\DeclareCaptionFont{singlespacing}{}
 %    \end{macrocode}
 %
-% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
-% \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised}
 %    \begin{macrocode}
-\DeclareCaptionFont{singlespacing}{%
-  \caption at ifdefined\setspace at singlespace{%
-    \setstretch\setspace at singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{%
-  \caption at setspace{onehalfspacing}\onehalfspacing\relax}
-\DeclareCaptionFont{doublespacing}{%
-  \caption at setspace{doublespacing}\doublespacing\relax}
-\DeclareCaptionFont{stretch}{%
-  \caption at setspace{stretch}\setstretch\@gobble{#1}}
-%    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at setspace{\caption at ifpackageloaded{setspace}}
-%    \end{macrocode}
-%
-%    \begin{macrocode}
 %\DeclareCaptionFont{normal}{%
 %  \caption at font{normalcolor,normalfont,normalsize,singlespacing}
 \DeclareCaptionFont{normal}{%
@@ -2128,9 +2147,11 @@
 % \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
 %  |\DeclareCaptionJustification|\marg{name}\marg{code}
 %    \begin{macrocode}
-\newcommand*\DeclareCaptionJustification[2]{%
-  \global\@namedef{caption at hj@#1}{#2}% for compatibility to v1.0
-  \DeclareCaptionFont{#1}{#2}}
+\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
 %    \end{macrocode}
 % \end{macro}
@@ -2203,119 +2224,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsection{The ragged2e package}
-% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
-% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
-%
-% We also support the upper-case commands offered by the \package{ragged2e}
-% package.
-% Note that these just map to their lower-case variants if the
-% \package{ragged2e} package is not available.
-%    \begin{macrocode}
-\DeclareCaptionJustification{Centering}{\caption at Centering}
-\DeclareCaptionJustification{RaggedLeft}{\caption at RaggedLeft}
-\DeclareCaptionJustification{RaggedRight}{\caption at RaggedRight}
-%    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at Centering{%
-  \caption at ragged{Centering}\Centering\centering}
-\newcommand*\caption at RaggedLeft{%
-  \caption at ragged{RaggedLeft}\RaggedLeft\raggedleft}
-\newcommand*\caption at RaggedRight{%
-  \caption at ragged{RaggedRight}\RaggedRight\raggedright}
-%    \end{macrocode}
-%
-% \begin{macro}{\caption at ragged}
-% \changes{v1.0n}{2007/04/07}{The `ragged2e' package will now only been loaded when needed}
-% \changes{v1.0o}{2007/04/11}{Bugfix: Usage of \cs{caption at Info} replaced by \cs{caption at Debug}}
-% \changes{v1.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
-% \changes{v1.4f}{2012/01/12}{Uses \cs{caption at ifpackageloaded} now}
-% |\caption at ragged|\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if the \package{ragged2e} package is loaded and \meta{no-code} if not.
-%    \begin{macrocode}
-\newcommand*\caption at ragged{\caption at ifpackageloaded{ragged2e}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at ifpackageloaded}
-% \changes{v1.4f}{2012/01/12}{This macro added}
-% \changes{v1.8h}{2020/01/03}{Does not load the package anymore but issue an error message instead}
-% |\caption at ifpackageloaded|\marg{package}\marg{option}\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if the given package is loaded and \meta{no-code} if not.
-%    \begin{macrocode}
-\newcommand*\caption at ifpackageloaded[4]{%
-  \caption at ifdefined#3#3{%
-    \caption at Error{Option `#2' requires the `#1' package\MessageBreak
-      (or an alternative definition of \string#3)}%
-    #4}}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at pkg@list}
-% \changes{v1.4f}{2012/01/12}{This macro added}
-% We use this 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{}
-%    \end{macrocode}
-%    \begin{macrocode}
-\caption at AtBeginDocument{%
-  \def\caption at tempa{\endgroup}%
-  \begingroup
-  \def\@elt#1{%
-    \g at addto@macro\caption at tempa{%
-      \caption at InfoNoLine{Load package `#1'}%
-      \RequirePackage{#1}\relax}}%
-  \caption at pkg@list
-  \caption at tempa}
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption at check@ragged}
-% \changes{v1.4h}{2020/01/03}{This macro added}
-% In the past we tried to load the \package{ragged2e} package automatically if needed.
-% But since we have dropped this unreliable code users will get an error message instead.
-% To compensate for this change we try to detect the usage of the \package{ragged2e}
-% at least within the preamble of the document.
-% (Note: Checking the name of the option is not sufficient here since it could have
-%  been re-defined by the user. So we have to check the option code instead.)
-%    \begin{macrocode}
-\@ifpackageloaded{ragged2e}{\let\caption at check@ragged\@gobble}{%
-%    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\caption at check@ragged[1]{%
-    \begingroup
-      \def\caption at tempa{#1}%
-      \caption at check@ragged@{Centering}%
-      \caption at check@ragged@{RaggedLeft}%
-      \caption at check@ragged@{RaggedRight}%
-    \endgroup}%
-%    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\caption at check@ragged@[1]{%
-    \expandafter\def\expandafter\caption at tempb\expandafter{\csname caption@#1\endcsname}%
-    \ifx\caption at tempa\caption at tempb % our definition of `ragged2e' option?
-      \@ifundefined{#1}{%
-        \caption at Info{Usage of `ragged2e' command \expandafter\string\csname #1\endcsname\space detected}%
-        \@cons\caption at pkg@list{{ragged2e}}% load `ragged2e' package later on
-        \global\let\caption at check@ragged\@gobble}{}%
-    \fi
-  }%
-%    \end{macrocode}
-%    \begin{macrocode}
-  \caption at AtBeginDocument{%
-    \let\caption at check@ragged\@gobble
-    \let\caption at check@ragged@\@undefined}}
-%    \end{macrocode}
-% Make the \package{subfig} package documentation compile.
-%    \begin{macrocode}
-%%\@ifl at aded{dtx}{subfig}{\RequirePackage{ragged2e}\relax}{} % 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}
-% \end{macro}
-%
 % \section{Vertical spaces before and after captions}
 %
 % \begin{macro}{\abovecaptionskip}
@@ -2369,6 +2277,17 @@
 %    \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}}
+\@onlypreamble at key{caption}{figureposition}
+%    \end{macrocode}
+%    \begin{macrocode}
+\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},
@@ -3067,6 +2986,312 @@
 %
 % 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{macrocode}
+\newcommand*\caption at xpackage[2]{%
+  \expandafter\ifx\csname ver@#2.\caption at pkgextension\endcsname\relax
+    \expandafter\@firstofone
+  \else
+    \expandafter\@gobbletwo
+  \fi
+  {#1{#2}}}
+%    \end{macrocode}
+%    \begin{macrocode}
+\let\caption at pkgextension\@pkgextension
+%    \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{macrocode}
+\newcommand*\caption at loadpackage{%
+  \caption at xpackage\caption@@loadpackage}
+%    \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.
+%    \begin{macrocode}
+\newcommand*\caption at requirepackage{%
+  \caption at xpackage\caption@@requirepackage}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption@@requirepackage[2]{%
+  \@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{}
+%    \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|.
+%    \begin{macrocode}
+\newcommand*\caption at packagelist{}
+\@onlypreamble\caption at packagelist
+%    \end{macrocode}
+%    \begin{macrocode}
+\caption at AtBeginDocument{%
+  \def\caption at tempa{\endgroup}%
+  \begingroup
+  \def\@elt#1#2{%
+    \g at addto@macro\caption at tempa{%
+      \caption at loadpackage{#1}{#2}}}%
+  \caption at packagelist
+  \caption at tempa
+%    \end{macrocode}
+%    \begin{macrocode}
+  \renewcommand*\caption@@loadpackage[2]{%
+    \caption at Error{Option `#2' requires the `#1' package}}%
+  \let\caption@@requirepackage\caption@@loadpackage
+  }
+%    \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.)
+%    \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}}
+% \end{macro}
+%
+% \subsection{The newfloat package}
+%
+% \begin{macro}{\caption at newfloat}
+% \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.
+%    \begin{macrocode}
+\newcommand*\caption at newfloat{\caption at usepackage{newfloat}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v1.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v1.2}{2007/11/18}{Option \opt{name} added}
+%    \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption at SetName{figure}{#1}}
+\@onlypreamble at key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption at SetName{table}{#1}}
+\@onlypreamble at key{caption}{tablename}
+%    \end{macrocode}
+%
+% \changes{v1.2a}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+%    \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption at SetName{listfigure}{#1}}
+\@onlypreamble at key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption at SetName{listtable}{#1}}
+\@onlypreamble at key{caption}{listtablename}
+%    \end{macrocode}
+%
+% \begin{macro}{\caption at SetName}
+% \changes{v1.1}{2007/07/04}{This macro added}
+% \changes{v1.2}{2007/11/18}{After-preamble variant added}
+% \changes{v1.2a}{2008/02/28}{Renamed from \cs{caption at SetFloatName} to \cs{caption at SetName}}
+% \changes{v1.2b}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption at newfloat} now}
+%  |\caption at SetName|\marg{float}\marg{name}
+%    \begin{macrocode}
+\newcommand*\caption at SetName[2]{%
+  \caption at newfloat{#1name}{\newfloat at setname{#1}{#2}}}
+\@onlypreamble\caption at SetName
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\DeclareCaptionOption{name}{%
+  \IfCaptionOptionCheck{}{\caption at setname\@captype{#1}}}
+%    \end{macrocode}
+%
+% \begin{macro}{\caption at setname}
+%  |\caption at setname|\marg{float}\marg{name}
+%    \begin{macrocode}
+\newcommand*\caption at setname[2]{%
+  \@namedef{#1name}{#2}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v1.2e}{2010/01/09}{The \opt{within} options are now available within the document, too}
+%
+%    \begin{macrocode}
+\DeclareCaptionOption{figurewithin}{\caption at within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption at within{figure}{none}}
+\DeclareCaptionOption{tablewithin}{\caption at within{table}{#1}}
+\DeclareCaptionOptionNoValue{tablewithout}{\caption at within{table}{none}}
+%    \end{macrocode}
+%
+% \begin{macro}{\caption at within}
+% \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}
+%    \begin{macrocode}
+\newcommand*\caption at within[2]{%
+  \caption at newfloat{#1within}{\newfloat at setwithin{#1}{#2}}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/04/13}{Option \opt{within} added}
+% \changes{v1.2e}{2010/01/09}{The global \opt{within} option will now affect user-defined floats declared with \cs{DeclareCaptionType}, too}
+%
+%    \begin{macrocode}
+\DeclareCaptionOption{within}{%
+  \caption at newfloat{within}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+  \caption at newfloat{without}{\newfloatsetup{without}}}
+%    \end{macrocode}
+%
+% \subsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
+% \changes{v1.9}{2020/05/05}{Enhanced \package{ragged2e} package support}
+% \changes{v1.10}{2020/05/10}{Revised \package{ragged2e} package support}
+%
+% We support the upper-case commands offered by the \package{ragged2e}
+% package.
+%    \begin{macrocode}
+\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
+\DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
+\DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
+\DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
+%    \end{macrocode}
+%
+% \subsection{The sansmath package}
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \changes{v1.10}{2020/05/10}{\package{sansmath} package support revised}
+%
+%    \begin{macrocode}
+\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
+%    \end{macrocode}
+%
+% \subsection{The setspace package}
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
+%
+%    \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+  \caption at ifdefined\setspace at singlespace{%
+    \setstretch\setspace at singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+%    \end{macrocode}
+%
+% \subsection{The subfig package}
+% \changes{v1.1}{2007/07/07}{Several 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
+% versions are expected to be adapted.
+%    \begin{macrocode}
+\caption at AtBeginDocument{%
+  \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+  \expandafter\ifx\csname ver at subfig.sty\endcsname\@tempa
+    \caption at InfoNoLine{subfig package v1.3 is loaded}%
+%    \end{macrocode}
+%    \begin{macrocode}
+    \let\caption at setfloattype\@gobble
+    \let\@dottedxxxline\sf at NEW@dottedxxxline
+    \let\sf at subfloat\sf at NEW@subfloat
+%    \end{macrocode}
+%    \begin{macrocode}
+  \fi
+  \let\sf at NEW@dottedxxxline\@undefined
+  \let\sf at NEW@subfloat\@undefined}
+%    \end{macrocode}
+%
+% \begin{macro}{\@dottedxxxline}
+% New version of |\@dottedxxxline|
+%    \begin{macrocode}
+\def\sf at NEW@dottedxxxline#1#2#3#4#5#6#7{%
+  \begingroup
+    \caption at setfloattype{#1}%
+    \caption at setoptions{subfloat}%
+    \caption at setoptions{sub#1}%
+    \ifnum #3>\@nameuse{c@#2depth}\else
+      \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+    \fi
+  \endgroup}
+%    \end{macrocode}
+% \end{macro}
+%
+% \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|
+%    \begin{macrocode}
+\def\sf at NEW@subfloat{%
+  \begingroup
+    \@nameuse{caption at warmup}%
+    \caption at setfloattype\@captype
+    \sf at ifpositiontop{%
+      \maincaptiontoptrue
+    }{%
+      \maincaptiontopfalse
+    }%
+    \caption at setoptions{subfloat}%
+    \caption at setoptions{sub\@captype}%
+    \let\sf at oldlabel=\label
+    \let\label=\subfloat at label
+    \ifmaincaptiontop\else
+      \advance\@nameuse{c@\@captype}\@ne
+    \fi
+    \refstepcounter{sub\@captype}%
+    \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+    \@ifnextchar [%  %] match left bracket
+      {\sf@@subfloat}%
+      {\sf@@subfloat[\@empty]}}
+%    \end{macrocode}
+% \end{macro}
+%
+% 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}
@@ -3644,7 +3869,7 @@
 %  |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionType{%
-  \RequirePackage{newfloat}%
+  \caption at loadpackage{newfloat}{}%
   \DeclareFloatingEnvironment}
 \@onlypreamble\DeclareCaptionType
 %    \end{macrocode}
@@ -3882,75 +4107,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \section{subfig package adaptions}
-% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
-% \changes{v1.4a}{2011/11/01}{Bugfix 11-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
-% versions are expected to be adapted.
-%    \begin{macrocode}
-\caption at AtBeginDocument{%
-  \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
-  \expandafter\ifx\csname ver at subfig.sty\endcsname\@tempa
-    \caption at InfoNoLine{subfig package v1.3 is loaded}%
-%    \end{macrocode}
-%    \begin{macrocode}
-    \let\caption at setfloattype\@gobble
-    \let\@dottedxxxline\sf at NEW@dottedxxxline
-    \let\sf at subfloat\sf at NEW@subfloat
-%    \end{macrocode}
-%    \begin{macrocode}
-  \fi
-  \let\sf at NEW@dottedxxxline\@undefined
-  \let\sf at NEW@subfloat\@undefined}
-%    \end{macrocode}
-%
-% \begin{macro}{\@dottedxxxline}
-% New version of |\@dottedxxxline|
-%    \begin{macrocode}
-\def\sf at NEW@dottedxxxline#1#2#3#4#5#6#7{%
-  \begingroup
-    \caption at setfloattype{#1}%
-    \caption at setoptions{subfloat}%
-    \caption at setoptions{sub#1}%
-    \ifnum #3>\@nameuse{c@#2depth}\else
-      \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
-    \fi
-  \endgroup}
-%    \end{macrocode}
-% \end{macro}
-%
-% \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|
-%    \begin{macrocode}
-\def\sf at NEW@subfloat{%
-  \begingroup
-    \@nameuse{caption at warmup}%
-    \caption at setfloattype\@captype
-    \sf at ifpositiontop{%
-      \maincaptiontoptrue
-    }{%
-      \maincaptiontopfalse
-    }%
-    \caption at setoptions{subfloat}%
-    \caption at setoptions{sub\@captype}%
-    \let\sf at oldlabel=\label
-    \let\label=\subfloat at label
-    \ifmaincaptiontop\else
-      \advance\@nameuse{c@\@captype}\@ne
-    \fi
-    \refstepcounter{sub\@captype}%
-    \setcounter{sub\@captype @save}{\value{sub\@captype}}%
-    \@ifnextchar [%  %] match left bracket
-      {\sf@@subfloat}%
-      {\sf@@subfloat[\@empty]}}
-%    \end{macrocode}
-% \end{macro}
-%
 % \iffalse
 %</package>
 % \fi

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-05-11 20:46:30 UTC (rev 55098)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-05-11 20:46:52 UTC (rev 55099)
@@ -34,8 +34,8 @@
 %%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/01/03 v3.4h Customizing captions (AR)]
-\RequirePackage{caption3}[2020/01/03] % needs v1.8h or newer
+\ProvidesPackage{caption}[2020/05/10 v3.4j Customizing captions (AR)]
+\RequirePackage{caption3}[2020/05/10] % needs v1.10 or newer
 \caption at ifbool{documentclass}{}{%
   \caption at WarningNoLine{%
     Unknown document class (or package),\MessageBreak
@@ -58,45 +58,6 @@
     \caption at Error{Usage of the `position' option is incompatible\MessageBreak
       to the `#1' package}}}
 \@onlypreamble\caption at DisablePositionOption
-\DeclareCaptionOption{figureposition}{%
-  \captionsetup*[figure]{position=#1}}
-\@onlypreamble at key{caption}{figureposition}
-\DeclareCaptionOption{tableposition}{%
-  \captionsetup*[table]{position=#1}}
-\@onlypreamble at key{caption}{tableposition}
-\DeclareCaptionOption{figurename}{\caption at SetName{figure}{#1}}
-\@onlypreamble at key{caption}{figurename}
-\DeclareCaptionOption{tablename}{\caption at SetName{table}{#1}}
-\@onlypreamble at key{caption}{tablename}
-\DeclareCaptionOption{listfigurename}{\caption at SetName{listfigure}{#1}}
-\@onlypreamble at key{caption}{listfigurename}
-\DeclareCaptionOption{listtablename}{\caption at SetName{listtable}{#1}}
-\@onlypreamble at key{caption}{listtablename}
-\newcommand*\caption at SetName[2]{%
-  \caption at NewFloat{\newfloat at setname{#1}{#2}}}
-\@onlypreamble\caption at SetName
-\DeclareCaptionOption{name}{\caption at setname\@captype{#1}}
-\newcommand*\caption at setname[2]{%
-  \@namedef{#1name}{#2}}
-\newcommand*\caption at DeclareWithinOption[1]{%
-  \DeclareCaptionOption{#1within}{\caption at Within{#1}{##1}}%
-  \DeclareCaptionOptionNoValue{#1without}{\caption at Within{#1}{none}}}
-\@onlypreamble\caption at DeclareWithinOption
-\caption at DeclareWithinOption{figure}
-\caption at DeclareWithinOption{table}
-\DeclareCaptionOption{within}{%
-  \caption at NewFloat{\newfloatsetup{within=#1}}}
-\DeclareCaptionOptionNoValue{without}{%
-  \caption at NewFloat{\newfloatsetup{without}}}
-\newcommand*\caption at Within[2]{%
-  \caption at NewFloat{\newfloat at setwithin{#1}{#2}}}
-\newcommand*\caption at NewFloat[1]{%
-  \let\KV at prefix@ORI\KV at prefix
-  \let\@tempc at ORI\@tempc
-  \caption at ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
-  #1%
-  \let\@tempc\@tempc at ORI
-  \let\KV at prefix\KV at prefix@ORI}
 \DeclareCaptionOption*{config}[caption]{%
    \InputIfFileExists{#1.cfg}%
      {\typeout{*** Local configuration file #1.cfg used ***}}%

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-05-11 20:46:30 UTC (rev 55098)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-05-11 20:46:52 UTC (rev 55099)
@@ -34,7 +34,7 @@
 %%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/01/03 v1.8h caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/05/10 v1.11 caption3 kernel (AR)]
 \providecommand\caption at FixArabTeX{%
   \def\caption at tempa##1{}%
   \ifx\caption at tempa\@gobble
@@ -265,8 +265,10 @@
     \caption at prepare@optioncheck
     \caption at setup{#1}%
   \endgroup}
-\newcommand*\caption at prepare@optioncheck{%
-  \def\@captype{figure}}
+\providecommand*\caption at prepare@optioncheck{}
+\let\IfCaptionOptionCheck\@secondoftwo
+\g at addto@macro\caption at prepare@optioncheck{%
+  \let\IfCaptionOptionCheck\@firstoftwo}
 \newcommand*\clearcaptionsetup{%
   \caption at teststar@\@clearcaptionsetup\@gobble\@firstofone}
 \newcommand*\@clearcaptionsetup[1]{%
@@ -394,13 +396,13 @@
   \caption at ExecuteOptions{#2}{\caption at tempa\@ptionlist{\@currname.\@currext}}%
   \AtEndOfPackage{\let\@unprocessedoptions\relax}}
 \@onlypreamble\caption@@ProcessOptions
-\newcommand*\caption at packagelist{}
-\@onlypreamble\caption at packagelist
 \newcommand\caption at SetupOptions[2]{%
   \@namedef{caption at setkeys@#1}##1##2{#2}%
   \expandafter\@onlypreamble\csname caption at setkeys@#1\endcsname
-  \@cons\caption at packagelist{{#1}}}
+  \@cons\caption at SetupOptions@list{{#1}}}
 \@onlypreamble\caption at SetupOptions
+\newcommand*\caption at SetupOptions@list{}
+\@onlypreamble\caption at SetupOptions@list
 \let\caption at onefilewithoptions\@onefilewithoptions
 \def\@onefilewithoptions#1[#2]{%
   \begingroup
@@ -416,7 +418,7 @@
         \caption at ExecuteOptions{#1}{#2}%
         \caption at onefilewithoptions{#1}[]}%
     \fi}
-  \caption at packagelist
+  \caption at SetupOptions@list
   \@tempa}
 \@onlypreamble\caption at onefilewithoptions
 \newdimen\captionmargin
@@ -719,12 +721,31 @@
   \l at addto@macro\caption at thelabel{[{#1}]}%
   \caption@@getlabel#2\@nil}
 \let\caption at thelabel\relax
-\newcommand*\DeclareCaptionFont[2]{%
-  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#2}}}
+\newcommand*\DeclareCaptionFont{%
+  \@ifnextchar[%]
+    \caption at declare@font
+    \caption at declarefont}
 \@onlypreamble\DeclareCaptionFont
-\newcommand*\caption at addto@fnt[1]{%
-  \caption at check@ragged{#1}%
-  \l at addto@macro\caption at fnt{#1}}
+\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}}
+\@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
@@ -833,17 +854,7 @@
       Try setting it with `size=' explicitly}%
   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
 \DeclareCaptionFont{larger}{\caption at larger}
-\DeclareCaptionFont{sansmath}{\sansmath}
-\DeclareCaptionFont{singlespacing}{%
-  \caption at ifdefined\setspace at singlespace{%
-    \setstretch\setspace at singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{%
-  \caption at setspace{onehalfspacing}\onehalfspacing\relax}
-\DeclareCaptionFont{doublespacing}{%
-  \caption at setspace{doublespacing}\doublespacing\relax}
-\DeclareCaptionFont{stretch}{%
-  \caption at setspace{stretch}\setstretch\@gobble{#1}}
-\newcommand*\caption at setspace{\caption at ifpackageloaded{setspace}}
+\DeclareCaptionFont{singlespacing}{}
 \DeclareCaptionFont{normal}{%
   \caption at font*{%
     \KV at caption@fnt at normalcolor\@unused
@@ -852,9 +863,11 @@
     \KV at caption@fnt at singlespacing\@unused}}
 \DeclareCaptionOption{size}{\caption at setfont{size}{#1}}
 \DeclareCaptionDefaultFont{size}{}
-\newcommand*\DeclareCaptionJustification[2]{%
-  \global\@namedef{caption at hj@#1}{#2}% for compatibility to v1.0
-  \DeclareCaptionFont{#1}{#2}}
+\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
 \newcommand*\DeclareCaptionDefaultJustification[1]{%
   \global\@namedef{caption at hj@default}{#1}% for compatibility to v1.0
@@ -885,54 +898,6 @@
   \leftskip\z@\@plus 1fil%
   \rightskip\z@\@plus -1fil%
   \parfillskip\z@\@plus 2fil\relax}
-\DeclareCaptionJustification{Centering}{\caption at Centering}
-\DeclareCaptionJustification{RaggedLeft}{\caption at RaggedLeft}
-\DeclareCaptionJustification{RaggedRight}{\caption at RaggedRight}
-\newcommand*\caption at Centering{%
-  \caption at ragged{Centering}\Centering\centering}
-\newcommand*\caption at RaggedLeft{%
-  \caption at ragged{RaggedLeft}\RaggedLeft\raggedleft}
-\newcommand*\caption at RaggedRight{%
-  \caption at ragged{RaggedRight}\RaggedRight\raggedright}
-\newcommand*\caption at ragged{\caption at ifpackageloaded{ragged2e}}
-\newcommand*\caption at ifpackageloaded[4]{%
-  \caption at ifdefined#3#3{%
-    \caption at Error{Option `#2' requires the `#1' package\MessageBreak
-      (or an alternative definition of \string#3)}%
-    #4}}
-\newcommand*\caption at pkg@list{}
-\caption at AtBeginDocument{%
-  \def\caption at tempa{\endgroup}%
-  \begingroup
-  \def\@elt#1{%
-    \g at addto@macro\caption at tempa{%
-      \caption at InfoNoLine{Load package `#1'}%
-      \RequirePackage{#1}\relax}}%
-  \caption at pkg@list
-  \caption at tempa}
-\@ifpackageloaded{ragged2e}{\let\caption at check@ragged\@gobble}{%
-  \newcommand*\caption at check@ragged[1]{%
-    \begingroup
-      \def\caption at tempa{#1}%
-      \caption at check@ragged@{Centering}%
-      \caption at check@ragged@{RaggedLeft}%
-      \caption at check@ragged@{RaggedRight}%
-    \endgroup}%
-  \newcommand*\caption at check@ragged@[1]{%
-    \expandafter\def\expandafter\caption at tempb\expandafter{\csname caption@#1\endcsname}%
-    \ifx\caption at tempa\caption at tempb % our definition of `ragged2e' option?
-      \@ifundefined{#1}{%
-        \caption at Info{Usage of `ragged2e' command \expandafter\string\csname #1\endcsname\space detected}%
-        \@cons\caption at pkg@list{{ragged2e}}% load `ragged2e' package later on
-        \global\let\caption at check@ragged\@gobble}{}%
-    \fi
-  }%
-  \caption at AtBeginDocument{%
-    \let\caption at check@ragged\@gobble
-    \let\caption at check@ragged@\@undefined}}
-%%\@ifl at aded{dtx}{subfig}{\RequirePackage{ragged2e}\relax}{} % 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}}{}}
 \caption at ifundefined\abovecaptionskip{%
   \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
 \caption at ifundefined\belowcaptionskip{%
@@ -944,6 +909,12 @@
 \newcommand*\caption at hrule{\hrule\@height\z@}
 \DeclareCaptionOption{rule}[1]{\caption at set@bool\caption at ifrule{#1}}
 \DeclareCaptionOption{position}{\caption at setposition{#1}}
+\DeclareCaptionOption{figureposition}{%
+  \captionsetup*[figure]{position=#1}}
+\@onlypreamble at key{caption}{figureposition}
+\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
@@ -1246,6 +1217,127 @@
   }{}}
 \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
+  \else
+    \expandafter\@gobbletwo
+  \fi
+  {#1{#2}}}
+\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@@requirepackage[2]{%
+  \@cons\caption at packagelist{{#1}{#2}}}% load package later on
+\newcommand*\caption at pkg@list{}
+\newcommand*\caption at packagelist{}
+\@onlypreamble\caption at packagelist
+\caption at AtBeginDocument{%
+  \def\caption at tempa{\endgroup}%
+  \begingroup
+  \def\@elt#1#2{%
+    \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]{%
+  \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}}
+\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}}
+\@onlypreamble at key{caption}{tablename}
+\DeclareCaptionOption{listfigurename}{\caption at SetName{listfigure}{#1}}
+\@onlypreamble at key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption at SetName{listtable}{#1}}
+\@onlypreamble at key{caption}{listtablename}
+\newcommand*\caption at SetName[2]{%
+  \caption at newfloat{#1name}{\newfloat at setname{#1}{#2}}}
+\@onlypreamble\caption at SetName
+\DeclareCaptionOption{name}{%
+  \IfCaptionOptionCheck{}{\caption at setname\@captype{#1}}}
+\newcommand*\caption at setname[2]{%
+  \@namedef{#1name}{#2}}
+\DeclareCaptionOption{figurewithin}{\caption at within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption at within{figure}{none}}
+\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}}}
+\DeclareCaptionOption{within}{%
+  \caption at newfloat{within}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+  \caption at newfloat{without}{\newfloatsetup{without}}}
+\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
+\DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
+\DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
+\DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
+\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
+\DeclareCaptionFont{singlespacing}{%
+  \caption at ifdefined\setspace at singlespace{%
+    \setstretch\setspace at singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+\caption at AtBeginDocument{%
+  \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+  \expandafter\ifx\csname ver at subfig.sty\endcsname\@tempa
+    \caption at InfoNoLine{subfig package v1.3 is loaded}%
+    \let\caption at setfloattype\@gobble
+    \let\@dottedxxxline\sf at NEW@dottedxxxline
+    \let\sf at subfloat\sf at NEW@subfloat
+  \fi
+  \let\sf at NEW@dottedxxxline\@undefined
+  \let\sf at NEW@subfloat\@undefined}
+\def\sf at NEW@dottedxxxline#1#2#3#4#5#6#7{%
+  \begingroup
+    \caption at setfloattype{#1}%
+    \caption at setoptions{subfloat}%
+    \caption at setoptions{sub#1}%
+    \ifnum #3>\@nameuse{c@#2depth}\else
+      \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+    \fi
+  \endgroup}
+\def\sf at NEW@subfloat{%
+  \begingroup
+    \@nameuse{caption at warmup}%
+    \caption at setfloattype\@captype
+    \sf at ifpositiontop{%
+      \maincaptiontoptrue
+    }{%
+      \maincaptiontopfalse
+    }%
+    \caption at setoptions{subfloat}%
+    \caption at setoptions{sub\@captype}%
+    \let\sf at oldlabel=\label
+    \let\label=\subfloat at label
+    \ifmaincaptiontop\else
+      \advance\@nameuse{c@\@captype}\@ne
+    \fi
+    \refstepcounter{sub\@captype}%
+    \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+    \@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*
@@ -1493,7 +1585,7 @@
 \newcommand*\caption@@par{%
   \parindent\caption at parindent\hangindent\caption at hangindent}%
 \newcommand*\DeclareCaptionType{%
-  \RequirePackage{newfloat}%
+  \caption at loadpackage{newfloat}{}%
   \DeclareFloatingEnvironment}
 \@onlypreamble\DeclareCaptionType
 \newcommand\caption at ForEachType[1]{%
@@ -1613,46 +1705,6 @@
     \def\@elt##1{#3}%
     \@nameuse{caption@#2}%
     \let\@elt\relax}}%
-\caption at AtBeginDocument{%
-  \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
-  \expandafter\ifx\csname ver at subfig.sty\endcsname\@tempa
-    \caption at InfoNoLine{subfig package v1.3 is loaded}%
-    \let\caption at setfloattype\@gobble
-    \let\@dottedxxxline\sf at NEW@dottedxxxline
-    \let\sf at subfloat\sf at NEW@subfloat
-  \fi
-  \let\sf at NEW@dottedxxxline\@undefined
-  \let\sf at NEW@subfloat\@undefined}
-\def\sf at NEW@dottedxxxline#1#2#3#4#5#6#7{%
-  \begingroup
-    \caption at setfloattype{#1}%
-    \caption at setoptions{subfloat}%
-    \caption at setoptions{sub#1}%
-    \ifnum #3>\@nameuse{c@#2depth}\else
-      \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
-    \fi
-  \endgroup}
-\def\sf at NEW@subfloat{%
-  \begingroup
-    \@nameuse{caption at warmup}%
-    \caption at setfloattype\@captype
-    \sf at ifpositiontop{%
-      \maincaptiontoptrue
-    }{%
-      \maincaptiontopfalse
-    }%
-    \caption at setoptions{subfloat}%
-    \caption at setoptions{sub\@captype}%
-    \let\sf at oldlabel=\label
-    \let\label=\subfloat at label
-    \ifmaincaptiontop\else
-      \advance\@nameuse{c@\@captype}\@ne
-    \fi
-    \refstepcounter{sub\@captype}%
-    \setcounter{sub\@captype @save}{\value{sub\@captype}}%
-    \@ifnextchar [%  %] match left bracket
-      {\sf@@subfloat}%
-      {\sf@@subfloat[\@empty]}}
 \endinput
 %%
 %% End of file `caption3.sty'.



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