texlive[53318] Master/texmf-dist: caption (4jan20)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 4 23:04:42 CET 2020


Revision: 53318
          http://tug.org/svn/texlive?view=revision&revision=53318
Author:   karl
Date:     2020-01-04 23:04:42 +0100 (Sat, 04 Jan 2020)
Log Message:
-----------
caption (4jan20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/caption/README
    trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx
    trunk/Master/texmf-dist/source/latex/caption/caption.dtx
    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
    trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty

Modified: trunk/Master/texmf-dist/doc/latex/caption/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/README	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/doc/latex/caption/README	2020-01-04 22:04:42 UTC (rev 53318)
@@ -1,7 +1,7 @@
 ==========================================================================
 
 The `caption' package bundle
-Release 2020-01-01
+Release 2020-01-03
 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/bicaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -18,11 +18,14 @@
 % 
 % 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, 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.
 % 
 % \fi
 % \CheckSum{427}

Modified: trunk/Master/texmf-dist/source/latex/caption/caption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -18,14 +18,17 @@
 % 
 % 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, 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.
 % 
 % \fi
-% \CheckSum{3006}
+% \CheckSum{3044}
 %
 % \iffalse
 %<*driver>
@@ -215,13 +218,13 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/01/01 v3.4c Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/01/03 v3.4h Customizing captions (AR)]
 %    \end{macrocode}
 %
 % \section{Loading the kernel}
 %
 %    \begin{macrocode}
-\RequirePackage{caption3}[2019/12/31] % needs v1.8f or newer
+\RequirePackage{caption3}[2020/01/03] % needs v1.8h or newer
 %    \end{macrocode}
 %
 % \section{Check against unknown document classes}
@@ -378,6 +381,7 @@
 %
 % \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}
@@ -388,7 +392,8 @@
 \newcommand*\caption at NewFloat[1]{%
   \let\KV at prefix@ORI\KV at prefix
   \let\@tempc at ORI\@tempc
-  \caption at ifpackageloaded{newfloat}{#1}{}%
+  \caption at ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
+  #1%
   \let\@tempc\@tempc at ORI
   \let\KV at prefix\KV at prefix@ORI}
 %    \end{macrocode}
@@ -1212,6 +1217,7 @@
 %
 % \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}
 %  Like |\captionsetup{type=xxx}|, but also works if \cs{captionsetup} was redefined.
 %    \begin{macrocode}
 \newcommand\setcaptiontype{%
@@ -1246,6 +1252,7 @@
 % \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup at star} added}
 % \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption at refstepcounter}}
 % \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption at caption} and \cs{ifcaption at subcaption} added}
+% \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
 %  |\caption at settype*|\marg{type}\par
 %  sets |\@captype| and executes the options associated with it
 %  (using |\caption at set|\-|options|).
@@ -1273,41 +1280,42 @@
 \newcommand*\caption@@@settype[3]{%
 % #1 = "" or "sub"
 % #2 = \@firstoftwo in star form, \@secondoftwo otherwise
-% #3 = <type>, e.g. "figure" or "table"
+% #3 = <type>, e.g. "figure" or "subfigure"
   \caption at Debug{#1type=#3}%
-  \caption at checkgrouplevel{#1}{%
-    \captionsetup{#1type#2*\@empty=...}#2{ or
-                  \@backslashchar#1captionof}{}}%
+  \@nameuse{caption at check#1type}{#3}%
+    {\caption at checkgrouplevel{#1}{%
+       \captionsetup{#1type#2*\@empty=...}#2{ or
+                     \@backslashchar#1captionof}{}}%
 %    \end{macrocode}
 %    \begin{macrocode}
-  \edef\caption at tempa{#3}%
-  \expandafter\ifx\csname @#1captype\endcsname\caption at tempa \else
-    \ifcaptionsetup at star\else\@nameuse{caption@#1type at warning}\fi
-  \fi
-  \expandafter\let\csname @#1captype\endcsname\caption at tempa
+     \edef\caption at tempa{#3}%
+     \expandafter\ifx\csname @#1captype\endcsname\caption at tempa \else
+       \ifcaptionsetup at star\else\@nameuse{caption@#1type at warning}\fi
+     \fi
+     \expandafter\let\csname @#1captype\endcsname\caption at tempa
 %    \end{macrocode}
 %    \begin{macrocode}
-  \@nameuse{caption@#1typehook}%
+     \@nameuse{caption@#1typehook}%
 %    \end{macrocode}
 %    \begin{macrocode}
-  \caption at setoptions{#3}%
-  \ifx\caption at opt\relax
-    \@nameundef{caption@#1type at warning}%
-  \else
-    \@namedef{caption@#1type at warning}{\caption at Warning{%
-      The #1caption type was already set to
-      `\csname @#1captype\endcsname'\MessageBreak}}%
-  \fi
+     \caption at setoptions{#3}%
+     \ifx\caption at opt\relax
+       \@nameundef{caption@#1type at warning}%
+     \else
+       \@namedef{caption@#1type at warning}{\caption at Warning{%
+         The #1type was already set to
+         `\csname @#1captype\endcsname'\MessageBreak}}%
+     \fi
 %    \end{macrocode}
 %    \begin{macrocode}
-  #2{}{%
-    \let\@currentlabel\caption at undefinedlabel
-%   \let\@currentHlabel\@undefined
-    \ifx\caption at x@label\@undefined
-      \let\caption at x@label\label
-      \let\label\caption at xlabel
-    \fi
-    \caption at start}}
+     #2{}{%
+       \let\@currentlabel\caption at undefinedlabel
+%      \let\@currentHlabel\@undefined
+       \ifx\caption at x@label\@undefined
+         \let\caption at x@label\label
+         \let\label\caption at xlabel
+       \fi
+       \caption at start}}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1320,6 +1328,26 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \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.
+%    \begin{macrocode}
+\newcommand*\caption at checktype[1]{%
+  \caption at ifsubtype{#1}%
+     {\caption at Error{Should not be used with subtype `#1'}%
+      \@gobble}%
+     \@firstofone}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand*\caption at checksubtype[1]{%
+  \caption at ifsubtype{#1}%
+     \@firstofone
+     {\caption at Error{Undefined subtype `#1'}%
+      \@gobble}}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\caption at checkgrouplevel}
 % \changes{v3.1}{2007/07/15}{This macro and its usage added}
 % \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
@@ -1983,6 +2011,7 @@
 % \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption at settype} added}
 % \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}
 %  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.)
@@ -2033,6 +2062,7 @@
 %    \begin{macrocode}
 % redefine \caption
     \let\caption\caption at subcaption
+    \let\@caption\caption@@caption
     \let\phantomcaption\caption at subphantom
     \let\captionlistentry\caption at sublistentry
 %   \let\@captype\@subcaptype
@@ -3321,6 +3351,7 @@
 % \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
 % \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
 % \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
 %  |\caption at begin| and |\caption at end| etc.\par
@@ -3327,8 +3358,8 @@
 %  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 reason why the caption is mis-aligned when using one of the options |linewidth=|, |xleftmargin=|, |yleftmargin=|, or |resetmargins=|,
-%   even the \package{caption} package isn't used. This needs to be fixed within the \package{listings} package, for example by using
+%  (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|.
@@ -3335,8 +3366,8 @@
 % 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).
 %    \begin{macrocode}
-%%  \caption at setbool{lst at Init}{0}%
-%%  \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
+  \caption at setbool{lst at Init}{0}%
+  \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
 %    \end{macrocode}
 %    \begin{macrocode}
   \let\caption at ORI@lst at MakeCaption\lst at MakeCaption
@@ -3348,38 +3379,34 @@
     \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}%
+%%    \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 here.
+% If |\linewidth| isn't adapted by the \package{listings} package yet, do the adaption now.
 %    \begin{macrocode}
-%%      \caption at iflst@Init{}{%\lsthk at PreInit\lsthk at Init => has unwanted side-effects (like an extra horizontal line)
-%%        \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{}{%
+%%      \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
-% This does not result in correct justification of the caption, but captions inside listings inside
-% lists are not justified correctly anyway. (Again, this needs to be fixed by the \package{listings} package.)\par
-% Note: We cannot use |\@totalleftmargin| here since it was usually resetted by the \package{listings} package.
-% So we have to calculate the total left margin on our own which makes this code even more dirty.
+% Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
 %    \begin{macrocode}
-      \l at addto@macro\caption at beginhook{%
-        \@tempdima\leftmargin
-        \multiply\@tempdima\@listdepth
-        \hskip-\@tempdima\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}%
 %    \end{macrocode}
-% First of all, we set |position=#1| and if it was set to `top',
+% We set |position=#1| and if it was set to `top',
 % we swap the skips so the default behavior of the \package{listings} package
 % will not be changed. (Note that the \package{listings} package has set its
 % own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
@@ -3391,7 +3418,7 @@
         \belowcaptionskip\abovecaptionskip
         \abovecaptionskip\@tempdima}{}%
 %    \end{macrocode}
-% Workaround for issue with wrong skips (FIXME: should be examined further)
+% Workaround for issue with wrong skips (FIXME: This should be examined further)
 %    \begin{macrocode}
       \caption at setup{rule=0}%
 %    \end{macrocode}
@@ -3698,7 +3725,28 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\flrow at setlist}
+% \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
+% The \package{floatrow} package uses |\flrow at setlist{{table}{longtable}}| inside its redefinition of |\LT at array| without setting |\@captype| first,
+% and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
+% Unfortunately we cannot easily patch |\LT at array| again to fix this bug in \package{floatrow} since it will be patched |\AtBeginDocument|.
+% Therefore we patch |\flrow at setlist| instead to catch and fix the bug on-the-fly.
 %    \begin{macrocode}
+  \caption at AtBeginDocument{\caption at ifdefined\flrow at setlist@{%
+    \caption at InfoNoLine{Fixing longtable code of `floatrow' package}%
+    \let\caption at flrow@setlist@\flrow at setlist@
+    \renewcommand\flrow at setlist@[1]{%
+      \def\caption at tempa{{table}{longtable}}%
+      \def\caption at tempb{#1}%
+      \ifx\caption at tempa\caption at tempb
+        \def\@captype{table}%
+      \fi
+      \caption at flrow@setlist@{#1}}%
+  }{}}%
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 }{}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex/caption/caption2.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption2.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/caption2.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -2,7 +2,7 @@
 % 
 % This is file `caption2.dtx'.
 % 
-% Copyright (C) 1994-2015 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 % 
 % --------------------------------------------------------------------------
 % 
@@ -18,14 +18,17 @@
 % 
 % 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, 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.
 % 
 % \fi
-% \CheckSum{853}
+% \CheckSum{868}
 %
 % \iffalse
 %<*driver>
@@ -204,7 +207,7 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption2}[2015/09/15 v2.2d Customising captions (AR)]
+\ProvidesPackage{caption2}[2020/01/02 v2.2e Customising captions (AR)]
 %    \end{macrocode}
 %
 % \changes{v2.2b}{2007/06/15}{Made obsolete warning even more annoying}
@@ -223,8 +226,17 @@
 % \subsection{Loading the caption3 kernel}
 %
 %    \begin{macrocode}
-\RequirePackage{caption3}[2007/09/01] % needs v3.1 or newer
+\RequirePackage{caption3}[2019/12/31] % should be used with v1.8f or newer
 %    \end{macrocode}
+% We undefine user commands offered by \package{caption} but not by \package{caption2}
+% since they should not be used together with \package{caption2}.
+%    \begin{macrocode}
+\let\captionsetup\@undefined
+\let\clearcaptionsetup\@undefined
+\let\showcaptionsetup\@undefined
+\let\DeclareCaptionType\@undefined
+\let\DeclareCaptionSubType\@undefined
+%    \end{macrocode}
 %
 % \subsection{Check against the regular caption package}
 % \changes{v2.2}{2007/04/06}{Check against regular \package{caption} package added}
@@ -694,7 +706,7 @@
 % \begin{macro}{debug}
 % This option will put additional debug information in the log file.
 %    \begin{macrocode}
-\DeclareOption{debug}{\captionsetup{debug}}
+\DeclareOption{debug}{\caption at setup{debug}}
 %    \end{macrocode}
 % \end{macro}
 %

Modified: trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/caption3.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -2,7 +2,7 @@
 % 
 % This is file `caption3.dtx'.
 % 
-% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 % 
 % --------------------------------------------------------------------------
 % 
@@ -18,14 +18,17 @@
 % 
 % 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, 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.
 % 
 % \fi
-% \CheckSum{3405}
+% \CheckSum{3476}
 %
 % \iffalse
 %<*driver>
@@ -188,7 +191,7 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2019/12/31 v1.8f caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/01/03 v1.8h caption3 kernel (AR)]
 %    \end{macrocode}
 %
 % \section{Workaround for bug in package \package{arabtex}}
@@ -724,6 +727,7 @@
 % \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
 % \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
@@ -753,18 +757,38 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption at setup@options at i[4]{%
-  \caption at setup@options@{#1}{#2}%
-  \caption at declare@option{#2}[]{\captionsetup#3{#4}}}
+  \caption at declare@option{#2}[]{\captionsetup#3{#4}}%
+  \caption at setup@options@{#1}{#2}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \newcommand*\caption at setup@options@[2]{%
   \@bsphack
     \ifcaptionsetup at star\captionsetup at starfalse\else\caption at addtooptlist{#1}\fi
+    \caption at checkoptions{#2}%
     \expandafter\caption at l@addto at list\csname caption at opt@#1\endcsname{#2}%
   \@esphack}
 %    \end{macrocode}
 % \end{macro}
 %
+% \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
+    \caption at prepare@optioncheck
+    \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}}
+%    \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}
@@ -1864,16 +1888,20 @@
 % \section{Fonts}
 %
 % \begin{macro}{\DeclareCaptionFont}
-% \changes{v1.0a}{2004/01/22}{%
-%         Bugfix: Multi token arguments are allowed now}
-% \changes{v1.1}{2007/05/07}{%
-%         Internal: Uses \cs{caption at fnt} instead of \cs{caption at temp} now}
+% \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}
 %    \begin{macrocode}
 \newcommand*\DeclareCaptionFont[2]{%
-  \define at key{caption at fnt}{#1}[]{\l at addto@macro\caption at fnt{#2}}}
+  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#2}}}
 \@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}}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\DeclareCaptionDefaultFont}
@@ -2061,10 +2089,16 @@
 \DeclareCaptionFont{singlespacing}{%
   \caption at ifdefined\setspace at singlespace{%
     \setstretch\setspace at singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
-\DeclareCaptionFont{doublespacing}{\doublespacing}
-\DeclareCaptionFont{stretch}{\setstretch{#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}{%
@@ -2171,6 +2205,7 @@
 %
 % \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.
@@ -2177,25 +2212,26 @@
 % Note that these just map to their lower-case variants if the
 % \package{ragged2e} package is not available.
 %    \begin{macrocode}
-\DeclareCaptionJustification{Centering}{%
-  \caption at ragged\Centering\centering}
-\DeclareCaptionJustification{RaggedLeft}{%
-  \caption at ragged\RaggedLeft\raggedleft}
-\DeclareCaptionJustification{RaggedRight}{%
-  \caption at ragged\RaggedRight\raggedright}
+\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.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}
+% \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. Additionally it tries to load the \package{ragged2e}
-% package.
+% 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}
@@ -2203,62 +2239,81 @@
 %
 % \begin{macro}{\caption at ifpackageloaded}
 % \changes{v1.4f}{2012/01/12}{This macro added}
-% |\caption at ifpackageloaded|\marg{package}\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if the given package is loaded
-% and \meta{no-code} if not. Additionally it tries to load the package.
+% \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[1]{%
-  \@ifundefined{caption at ifpkg@#1}%
-    {\caption at RequirePackage{#1}%
-     \caption at pkg@true{#1}}%
-    {}%
-  \caption at ifpkg{#1}}
+\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}
-\AtBeginDocument{\renewcommand*\caption at ifpackageloaded[1]{%
-  \@ifundefined{caption at ifpkg@#1}%
-    {\caption at addto@pkg at list{#1}%
-     \caption at pkg@false{#1}%
-     \caption at Warning{%
-       `#1' support has been changed.\MessageBreak
-       Rerun to get captions right}}%
-    {}%
-  \caption at ifpkg{#1}}}
-%    \end{macrocode}
-%    \begin{macrocode}
-\newcommand*\caption at ifpkg[1]{%
-  \csname caption at ifpkg@#1\endcsname}
-\newcommand*\caption at pkg@true[1]{%
-  \global\expandafter\let\csname caption at ifpkg@#1\endcsname\@firstoftwo}
-\newcommand*\caption at pkg@false[1]{%
-  \global\expandafter\let\csname caption at ifpkg@#1\endcsname\@secondoftwo}
-%    \end{macrocode}
-%    \begin{macrocode}
 \newcommand*\caption at pkg@list{}
-\newcommand*\caption at addto@pkg at list[1]{%
-  \protected at write\@auxout{}{%
-    \string\@cons\string\caption at pkg@list{{#1}}}}
 %    \end{macrocode}
 %    \begin{macrocode}
-\AtBeginDocument{%
+\caption at AtBeginDocument{%
   \def\caption at tempa{\endgroup}%
   \begingroup
   \def\@elt#1{%
     \g at addto@macro\caption at tempa{%
-      \caption at RequirePackage{#1}%
-      \@namedef{caption at ifpkg@#1}{%
-        \caption at addto@pkg at list{#1}%
-        \caption at pkg@true{#1}%
-        \caption at ifpkg{#1}}}}%
+      \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}
-\newcommand*\caption at RequirePackage[1]{%
-  \caption at Info{We need package `#1'}%
-  \RequirePackage{#1}}
-\@onlypreamble\caption at RequirePackage
+\@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}
@@ -3604,10 +3659,10 @@
   \caption at ifdefined\ForEachFloatingEnvironment
     {\ForEachFloatingEnvironment{#1}}%
     {\def\@elt##1{#1}%
-      \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}}}
+     \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}}}
 %    \end{macrocode}
 %    \begin{macrocode}
 \providecommand\newfloat at addtohook[1]{%
@@ -3629,6 +3684,7 @@
 % \changes{v1.5}{2011/12/29}{Usage of \cs{caption at addtoreset} replaced by \cs{@addtoreset}}
 % \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
@@ -3649,15 +3705,19 @@
   \@ifundefined{c@#3}%
     {\caption at Error{No float type '#3' defined}}%
 %    \end{macrocode}
+% Check if the sub-type was already defined by |\Declare|\-|Sub|\-|Type|.
+% If not, define the counter and list entry.
 %    \begin{macrocode}
-    {\@ifundefined{c at sub#3}%
-       {\caption at Debug{New subtype `sub#3'}%
-        \newcounter{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 Debug{Modify caption `sub#3'}}%
+    {\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}}}%
 %    \end{macrocode}
 % Support of \package{titletoc} package
 %    \begin{macrocode}
@@ -3745,6 +3805,25 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \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.
+%    \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}
+%    \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|.

Modified: trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/ltcaption.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -18,11 +18,14 @@
 % 
 % 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, 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.
 % 
 % \fi
 % \CheckSum{378}

Modified: trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx	2020-01-04 22:04:42 UTC (rev 53318)
@@ -2,7 +2,7 @@
 % 
 % This is file `subcaption.dtx'.
 % 
-% Copyright (C) 2007-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 % 
 % --------------------------------------------------------------------------
 % 
@@ -18,14 +18,17 @@
 % 
 % 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, 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.
 % 
 % \fi
-% \CheckSum{235}
+% \CheckSum{229}
 %
 % \iffalse
 %<*driver>
@@ -921,7 +924,7 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{subcaption}[2019/09/01 v1.3a Sub-captions (AR)]
+\ProvidesPackage{subcaption}[2020/01/03 v1.3b Sub-captions (AR)]
 %    \end{macrocode}
 %
 % \subsection{Initial code}
@@ -1211,7 +1214,8 @@
 % \changes{v0.4}{2008/03/01}{This macro added}
 % \changes{v1.0c}{2011/01/22}{This macro removed since it's too incompatible with the one from \package{subfig}}
 % \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.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}
 %  |\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}.
@@ -1218,42 +1222,35 @@
 %  If not, we do the same as |\sub|\-|caption|\-|box| does, but use |\phantom|\-|caption| instead of |\caption|.
 %  In both cases we do a |\ignore|\-|spaces| at the end since the original implementation of |\sub|\-|float| does this, too.
 %    \begin{macrocode}
-\caption at ifundefined\subfloat{%
+\def\subfloat{%
+  \@ifnextchar[\@subfloat\subfloat@}
 %    \end{macrocode}
 %    \begin{macrocode}
-  \newcommand*\subfloat{%
-    \@ifnextchar[\@subfloat\subfloat@}
+\long\def\@subfloat[#1]{%
+  \@ifnextchar[{\@@subfloat{#1}}{\@@@subfloat\subcaptionbox{#1}}}
 %    \end{macrocode}
 %    \begin{macrocode}
-  \long\def\@subfloat[#1]{%
-    \@ifnextchar[{\@@subfloat{#1}}{\@@@subfloat\subcaptionbox{#1}}}
+\long\def\@@subfloat#1[#2]{%
+  \@@@subfloat{\subcaptionbox[{#1}]}{#2}}
 %    \end{macrocode}
 %    \begin{macrocode}
-  \long\def\@@subfloat#1[#2]{\@@@subfloat{\subcaptionbox[{#1}]}{#2}}
+\long\def\@@@subfloat#1#2#3{%
+  \caption at getlabel#3\label{}\@nil
+  #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
+  \global\let\caption at thelabel\relax
+  \ignorespaces}
 %    \end{macrocode}
 %    \begin{macrocode}
-  \newcommand\@@@subfloat[3]{%
-    \caption at getlabel#3\label{}\@nil
-    #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
-    \global\let\caption at thelabel\relax
-    \ignorespaces}
+\def\subfloat@#1{%
+  \setbox\@tempboxa\hbox{#1}%
+  \caption at iiiibox\setcaptionsubtype
+    {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
+    {}% no optional arguments for \caption
+    {}% no sub-caption
+    [\wd\@tempboxa][\caption at hj@default]%
+    {\unhbox\@tempboxa}%
+  \ignorespaces}
 %    \end{macrocode}
-%    \begin{macrocode}
-  \newcommand*\subfloat@[1]{%
-    \setbox\@tempboxa\hbox{#1}%
-    \caption at iiiibox\setcaptionsubtype
-      {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
-      {}% no optional arguments for \caption
-      {}% no sub-caption
-      [\wd\@tempboxa][\caption at hj@default]%
-      {\unhbox\@tempboxa}%
-    \ignorespaces}
-%    \end{macrocode}
-%    \begin{macrocode}
-}{%
-  \PackageInfo{subcaption}{\protect\subfloat\space is already defined\@gobble}
-}
-%    \end{macrocode}
 % \end{macro}
 %
 % \iffalse

Modified: trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/bicaption.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% bicaption.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -25,16 +25,13 @@
 %% This Current Maintainer of this work is Axel Sommerfeldt.
 %% 
 %% This work consists of the files
-%%   CHANGELOG, README, SUMMARY, caption.ins,
-%%   caption.dtx, caption2.dtx, caption3.dtx,
-%%   bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%%   newfloat.dtx, and totalcount.dtx
+%%   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,
-%%   newfloat.sty, and totalcount.sty
+%%   bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
 %% and the user manuals
-%%   caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
 \ProvidesPackage{bicaption}[2016/03/27 v1.2 Bilingual Captions (AR)]

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -34,8 +34,8 @@
 %%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/01/01 v3.4c Customizing captions (AR)]
-\RequirePackage{caption3}[2019/12/31] % needs v1.8f or newer
+\ProvidesPackage{caption}[2020/01/03 v3.4h Customizing captions (AR)]
+\RequirePackage{caption3}[2020/01/03] % needs v1.8h or newer
 \caption at ifbool{documentclass}{}{%
   \caption at WarningNoLine{%
     Unknown document class (or package),\MessageBreak
@@ -93,7 +93,8 @@
 \newcommand*\caption at NewFloat[1]{%
   \let\KV at prefix@ORI\KV at prefix
   \let\@tempc at ORI\@tempc
-  \caption at ifpackageloaded{newfloat}{#1}{}%
+  \caption at ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
+  #1%
   \let\@tempc\@tempc at ORI
   \let\KV at prefix\KV at prefix@ORI}
 \DeclareCaptionOption*{config}[caption]{%
@@ -433,31 +434,42 @@
   \caption at teststar{\caption@@@settype{#1}}\@firstoftwo\@secondoftwo}
 \newcommand*\caption@@@settype[3]{%
   \caption at Debug{#1type=#3}%
-  \caption at checkgrouplevel{#1}{%
-    \captionsetup{#1type#2*\@empty=...}#2{ or
-                  \@backslashchar#1captionof}{}}%
-  \edef\caption at tempa{#3}%
-  \expandafter\ifx\csname @#1captype\endcsname\caption at tempa \else
-    \ifcaptionsetup at star\else\@nameuse{caption@#1type at warning}\fi
-  \fi
-  \expandafter\let\csname @#1captype\endcsname\caption at tempa
-  \@nameuse{caption@#1typehook}%
-  \caption at setoptions{#3}%
-  \ifx\caption at opt\relax
-    \@nameundef{caption@#1type at warning}%
-  \else
-    \@namedef{caption@#1type at warning}{\caption at Warning{%
-      The #1caption type was already set to
-      `\csname @#1captype\endcsname'\MessageBreak}}%
-  \fi
-  #2{}{%
-    \let\@currentlabel\caption at undefinedlabel
-    \ifx\caption at x@label\@undefined
-      \let\caption at x@label\label
-      \let\label\caption at xlabel
-    \fi
-    \caption at start}}
+  \@nameuse{caption at check#1type}{#3}%
+    {\caption at checkgrouplevel{#1}{%
+       \captionsetup{#1type#2*\@empty=...}#2{ or
+                     \@backslashchar#1captionof}{}}%
+     \edef\caption at tempa{#3}%
+     \expandafter\ifx\csname @#1captype\endcsname\caption at tempa \else
+       \ifcaptionsetup at star\else\@nameuse{caption@#1type at warning}\fi
+     \fi
+     \expandafter\let\csname @#1captype\endcsname\caption at tempa
+     \@nameuse{caption@#1typehook}%
+     \caption at setoptions{#3}%
+     \ifx\caption at opt\relax
+       \@nameundef{caption@#1type at warning}%
+     \else
+       \@namedef{caption@#1type at warning}{\caption at Warning{%
+         The #1type was already set to
+         `\csname @#1captype\endcsname'\MessageBreak}}%
+     \fi
+     #2{}{%
+       \let\@currentlabel\caption at undefinedlabel
+       \ifx\caption at x@label\@undefined
+         \let\caption at x@label\label
+         \let\label\caption at xlabel
+       \fi
+       \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}
+\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}{%
@@ -727,6 +739,7 @@
         \caption at Error{##2 inside \@subcaptype}%
       \fi}%
     \let\caption\caption at subcaption
+    \let\@caption\caption@@caption
     \let\phantomcaption\caption at subphantom
     \let\captionlistentry\caption at sublistentry
     \let\caption at refstepcounter\caption@@@refstepcounter
@@ -1175,30 +1188,29 @@
     \renewcommand*\caption at hypcapspace{\hypcapspace}%
   \fi}{}
 \caption at IfPackageLoaded{listings}[2004/02/13 v1.2]{%
-%%  \caption at setbool{lst at Init}{0}%
-%%  \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
+  \caption at setbool{lst at Init}{0}%
+  \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
   \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{}{%\lsthk at PreInit\lsthk at Init => has unwanted side-effects (like an extra horizontal line)
-%%        \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}%
-      \l at addto@macro\caption at beginhook{%
-        \@tempdima\leftmargin
-        \multiply\@tempdima\@listdepth
-        \hskip-\@tempdima\relax}%
+%%    \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}%
       \caption at setposition{#1}%
       \caption at iftop{%
         \@tempdima\belowcaptionskip
@@ -1274,6 +1286,17 @@
     \fi
     \caption at setoptions{longtable}%
     \caption at setoptions{@longtable}}%
+  \caption at AtBeginDocument{\caption at ifdefined\flrow at setlist@{%
+    \caption at InfoNoLine{Fixing longtable code of `floatrow' package}%
+    \let\caption at flrow@setlist@\flrow at setlist@
+    \renewcommand\flrow at setlist@[1]{%
+      \def\caption at tempa{{table}{longtable}}%
+      \def\caption at tempb{#1}%
+      \ifx\caption at tempa\caption at tempb
+        \def\@captype{table}%
+      \fi
+      \caption at flrow@setlist@{#1}}%
+  }{}}%
 }{}
 \providecommand*\caption at LT@setup{}
 \caption at IfPackageLoaded{picinpar}{%

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption2.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption2.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% caption2.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -25,19 +25,16 @@
 %% This Current Maintainer of this work is Axel Sommerfeldt.
 %% 
 %% This work consists of the files
-%%   CHANGELOG, README, SUMMARY, caption.ins,
-%%   caption.dtx, caption2.dtx, caption3.dtx,
-%%   bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%%   newfloat.dtx, and totalcount.dtx
+%%   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,
-%%   newfloat.sty, and totalcount.sty
+%%   bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
 %% and the user manuals
-%%   caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption2}[2015/09/15 v2.2d Customising captions (AR)]
+\ProvidesPackage{caption2}[2020/01/02 v2.2e Customising captions (AR)]
 \PackageWarning{caption2}{%
   ****************************************************\MessageBreak
   THIS PACKAGE IS OBSOLETE:\MessageBreak
@@ -47,7 +44,12 @@
   NOT be used for NEW documents! New documents should\MessageBreak
   use the regular `caption' package v3.x instead.\MessageBreak
   ****************************************************\@gobbletwo}%
-\RequirePackage{caption3}[2007/09/01] % needs v3.1 or newer
+\RequirePackage{caption3}[2019/12/31] % should be used with v1.8f or newer
+\let\captionsetup\@undefined
+\let\clearcaptionsetup\@undefined
+\let\showcaptionsetup\@undefined
+\let\DeclareCaptionType\@undefined
+\let\DeclareCaptionSubType\@undefined
 \@ifpackageloaded{caption}{%
   \PackageError{caption2}{%
     You can't use both, the (current) caption *and*\MessageBreak
@@ -208,7 +210,7 @@
 \DeclareOption{ruled}{\caption at ruledtrue}
 \DeclareOption{boxed}{}
 \DeclareOption{ignoreLTcapwidth}{\ignoreLTcapwidthtrue}
-\DeclareOption{debug}{\captionsetup{debug}}
+\DeclareOption{debug}{\caption at setup{debug}}
 \newif\ifcaption at twozero
 \normalcaptionparams
 \ExecuteOptions{none,normal}

Modified: trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption3.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% caption3.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -34,7 +34,7 @@
 %%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2019/12/31 v1.8f caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/01/03 v1.8h caption3 kernel (AR)]
 \providecommand\caption at FixArabTeX{%
   \def\caption at tempa##1{}%
   \ifx\caption at tempa\@gobble
@@ -252,13 +252,21 @@
        \caption at setup@options at i{#1}{@\caption at thecounter}}}%
     {\caption at setup@options@{#1}}}
 \newcommand*\caption at setup@options at i[4]{%
-  \caption at setup@options@{#1}{#2}%
-  \caption at declare@option{#2}[]{\captionsetup#3{#4}}}
+  \caption at declare@option{#2}[]{\captionsetup#3{#4}}%
+  \caption at setup@options@{#1}{#2}}
 \newcommand*\caption at setup@options@[2]{%
   \@bsphack
     \ifcaptionsetup at star\captionsetup at starfalse\else\caption at addtooptlist{#1}\fi
+    \caption at checkoptions{#2}%
     \expandafter\caption at l@addto at list\csname caption at opt@#1\endcsname{#2}%
   \@esphack}
+\newcommand*\caption at checkoptions[1]{%
+  \begingroup
+    \caption at prepare@optioncheck
+    \caption at setup{#1}%
+  \endgroup}
+\newcommand*\caption at prepare@optioncheck{%
+  \def\@captype{figure}}
 \newcommand*\clearcaptionsetup{%
   \caption at teststar@\@clearcaptionsetup\@gobble\@firstofone}
 \newcommand*\@clearcaptionsetup[1]{%
@@ -712,8 +720,11 @@
   \caption@@getlabel#2\@nil}
 \let\caption at thelabel\relax
 \newcommand*\DeclareCaptionFont[2]{%
-  \define at key{caption at fnt}{#1}[]{\l at addto@macro\caption at fnt{#2}}}
+  \define at key{caption at fnt}{#1}[]{\caption at addto@fnt{#2}}}
 \@onlypreamble\DeclareCaptionFont
+\newcommand*\caption at addto@fnt[1]{%
+  \caption at check@ragged{#1}%
+  \l at addto@macro\caption at fnt{#1}}
 \newcommand*\DeclareCaptionDefaultFont[2]{%
   \global\@namedef{caption#1 at default}{#2}}
 \@onlypreamble\DeclareCaptionDefaultFont
@@ -826,9 +837,13 @@
 \DeclareCaptionFont{singlespacing}{%
   \caption at ifdefined\setspace at singlespace{%
     \setstretch\setspace at singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
-\DeclareCaptionFont{doublespacing}{\doublespacing}
-\DeclareCaptionFont{stretch}{\setstretch{#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{normal}{%
   \caption at font*{%
     \KV at caption@fnt at normalcolor\@unused
@@ -870,54 +885,54 @@
   \leftskip\z@\@plus 1fil%
   \rightskip\z@\@plus -1fil%
   \parfillskip\z@\@plus 2fil\relax}
-\DeclareCaptionJustification{Centering}{%
-  \caption at ragged\Centering\centering}
-\DeclareCaptionJustification{RaggedLeft}{%
-  \caption at ragged\RaggedLeft\raggedleft}
-\DeclareCaptionJustification{RaggedRight}{%
-  \caption at ragged\RaggedRight\raggedright}
+\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[1]{%
-  \@ifundefined{caption at ifpkg@#1}%
-    {\caption at RequirePackage{#1}%
-     \caption at pkg@true{#1}}%
-    {}%
-  \caption at ifpkg{#1}}
-\AtBeginDocument{\renewcommand*\caption at ifpackageloaded[1]{%
-  \@ifundefined{caption at ifpkg@#1}%
-    {\caption at addto@pkg at list{#1}%
-     \caption at pkg@false{#1}%
-     \caption at Warning{%
-       `#1' support has been changed.\MessageBreak
-       Rerun to get captions right}}%
-    {}%
-  \caption at ifpkg{#1}}}
-\newcommand*\caption at ifpkg[1]{%
-  \csname caption at ifpkg@#1\endcsname}
-\newcommand*\caption at pkg@true[1]{%
-  \global\expandafter\let\csname caption at ifpkg@#1\endcsname\@firstoftwo}
-\newcommand*\caption at pkg@false[1]{%
-  \global\expandafter\let\csname caption at ifpkg@#1\endcsname\@secondoftwo}
+\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{}
-\newcommand*\caption at addto@pkg at list[1]{%
-  \protected at write\@auxout{}{%
-    \string\@cons\string\caption at pkg@list{{#1}}}}
-\AtBeginDocument{%
+\caption at AtBeginDocument{%
   \def\caption at tempa{\endgroup}%
   \begingroup
   \def\@elt#1{%
     \g at addto@macro\caption at tempa{%
-      \caption at RequirePackage{#1}%
-      \@namedef{caption at ifpkg@#1}{%
-        \caption at addto@pkg at list{#1}%
-        \caption at pkg@true{#1}%
-        \caption at ifpkg{#1}}}}%
+      \caption at InfoNoLine{Load package `#1'}%
+      \RequirePackage{#1}\relax}}%
   \caption at pkg@list
   \caption at tempa}
-\newcommand*\caption at RequirePackage[1]{%
-  \caption at Info{We need package `#1'}%
-  \RequirePackage{#1}}
-\@onlypreamble\caption at RequirePackage
+\@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{%
@@ -1485,10 +1500,10 @@
   \caption at ifdefined\ForEachFloatingEnvironment
     {\ForEachFloatingEnvironment{#1}}%
     {\def\@elt##1{#1}%
-      \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}}}
+     \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}}}
 \providecommand\newfloat at addtohook[1]{%
   \toks@=\expandafter{\newfloat at hook{##1}#1}%
   \edef\@tempa{\def\noexpand\newfloat at hook####1{\the\toks@}}%
@@ -1503,14 +1518,16 @@
 \def\caption@@declaresubtype#1[#2]#3{%
   \@ifundefined{c@#3}%
     {\caption at Error{No float type '#3' defined}}%
-    {\@ifundefined{c at sub#3}%
-       {\caption at Debug{New subtype `sub#3'}%
-        \newcounter{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 Debug{Modify caption `sub#3'}}%
+    {\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}{}%
@@ -1566,6 +1583,17 @@
   \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}

Modified: trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/ltcaption.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% ltcaption.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -25,16 +25,13 @@
 %% This Current Maintainer of this work is Axel Sommerfeldt.
 %% 
 %% This work consists of the files
-%%   CHANGELOG, README, SUMMARY, caption.ins,
-%%   caption.dtx, caption2.dtx, caption3.dtx,
-%%   bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%%   newfloat.dtx, and totalcount.dtx
+%%   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,
-%%   newfloat.sty, and totalcount.sty
+%%   bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
 %% and the user manuals
-%%   caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
 \ProvidesPackage{ltcaption}[2018/08/26 v1.4a longtable captions (AR)]

Modified: trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/subcaption.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% subcaption.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -25,19 +25,16 @@
 %% This Current Maintainer of this work is Axel Sommerfeldt.
 %% 
 %% This work consists of the files
-%%   CHANGELOG, README, SUMMARY, caption.ins,
-%%   caption.dtx, caption2.dtx, caption3.dtx,
-%%   bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%%   newfloat.dtx, and totalcount.dtx
+%%   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,
-%%   newfloat.sty, and totalcount.sty
+%%   bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
 %% and the user manuals
-%%   caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%%   caption-deu.tex, caption-eng.tex, caption-rus.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{subcaption}[2019/09/01 v1.3a Sub-captions (AR)]
+\ProvidesPackage{subcaption}[2020/01/03 v1.3b Sub-captions (AR)]
 \RequirePackage{caption}[2019/09/01] % needs v3.3c or newer
 \newcommand\subcaption at CheckCompatibility{%
   \@ifundefined{caption at ifcompatibility}{}{%
@@ -145,29 +142,26 @@
     {\caption at Error{Undefined label format `#1'}}%
     {\expandafter\let\expandafter\subcaption at reffmt\csname caption at lfmt@#1\endcsname}}
 \subcaption at setrefformat{simple}
-\caption at ifundefined\subfloat{%
-  \newcommand*\subfloat{%
-    \@ifnextchar[\@subfloat\subfloat@}
-  \long\def\@subfloat[#1]{%
-    \@ifnextchar[{\@@subfloat{#1}}{\@@@subfloat\subcaptionbox{#1}}}
-  \long\def\@@subfloat#1[#2]{\@@@subfloat{\subcaptionbox[{#1}]}{#2}}
-  \newcommand\@@@subfloat[3]{%
-    \caption at getlabel#3\label{}\@nil
-    #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
-    \global\let\caption at thelabel\relax
-    \ignorespaces}
-  \newcommand*\subfloat@[1]{%
-    \setbox\@tempboxa\hbox{#1}%
-    \caption at iiiibox\setcaptionsubtype
-      {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
-      {}% no optional arguments for \caption
-      {}% no sub-caption
-      [\wd\@tempboxa][\caption at hj@default]%
-      {\unhbox\@tempboxa}%
-    \ignorespaces}
-}{%
-  \PackageInfo{subcaption}{\protect\subfloat\space is already defined\@gobble}
-}
+\def\subfloat{%
+  \@ifnextchar[\@subfloat\subfloat@}
+\long\def\@subfloat[#1]{%
+  \@ifnextchar[{\@@subfloat{#1}}{\@@@subfloat\subcaptionbox{#1}}}
+\long\def\@@subfloat#1[#2]{%
+  \@@@subfloat{\subcaptionbox[{#1}]}{#2}}
+\long\def\@@@subfloat#1#2#3{%
+  \caption at getlabel#3\label{}\@nil
+  #1{#2\caption at thelabel}{\let\label\caption at gobble#3}%
+  \global\let\caption at thelabel\relax
+  \ignorespaces}
+\def\subfloat@#1{%
+  \setbox\@tempboxa\hbox{#1}%
+  \caption at iiiibox\setcaptionsubtype
+    {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
+    {}% no optional arguments for \caption
+    {}% no sub-caption
+    [\wd\@tempboxa][\caption at hj@default]%
+    {\unhbox\@tempboxa}%
+  \ignorespaces}
 \endinput
 %%
 %% End of file `subcaption.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty	2020-01-04 22:04:26 UTC (rev 53317)
+++ trunk/Master/texmf-dist/tex/latex/caption/totalcount.sty	2020-01-04 22:04:42 UTC (rev 53318)
@@ -6,7 +6,7 @@
 %%
 %% totalcount.dtx  (with options: `package')
 %% 
-%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
 %% 
 %% https://gitlab.com/axelsommerfeldt/caption
 %% 
@@ -25,16 +25,13 @@
 %% This Current Maintainer of this work is Axel Sommerfeldt.
 %% 
 %% This work consists of the files
-%%   CHANGELOG, README, SUMMARY, caption.ins,
-%%   caption.dtx, caption2.dtx, caption3.dtx,
-%%   bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%%   newfloat.dtx, and totalcount.dtx
+%%   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,
-%%   newfloat.sty, and totalcount.sty
+%%   bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
 %% and the user manuals
-%%   caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%%   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)]



More information about the tex-live-commits mailing list