summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/caption/subcaption.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-05 03:00:30 +0000
committerNorbert Preining <norbert@preining.info>2020-01-05 03:00:30 +0000
commitd703bc2777b69363e791c0ec50045947b1a399da (patch)
tree518c616bdf53da2c5dccf1bbd0a17ba14d4b7c7a /macros/latex/contrib/caption/subcaption.dtx
parent46d85b2b8e0282e241f8a41c6c0cd190c495eab0 (diff)
CTAN sync 202001050300
Diffstat (limited to 'macros/latex/contrib/caption/subcaption.dtx')
-rw-r--r--macros/latex/contrib/caption/subcaption.dtx69
1 files changed, 33 insertions, 36 deletions
diff --git a/macros/latex/contrib/caption/subcaption.dtx b/macros/latex/contrib/caption/subcaption.dtx
index 2571963bfe..3b58669d79 100644
--- a/macros/latex/contrib/caption/subcaption.dtx
+++ b/macros/latex/contrib/caption/subcaption.dtx
@@ -2,7 +2,7 @@
%
% This is file `subcaption.dtx'.
%
-% Copyright (C) 2007-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2007-2020 Axel Sommerfeldt (axel.sommerfeldt@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,48 +1214,42 @@
% \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}.
% 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@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@getlabel#3\label{}\@nil
+ #1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
+ \global\let\caption@thelabel\relax
+ \ignorespaces}
% \end{macrocode}
% \begin{macrocode}
- \newcommand\@@@subfloat[3]{%
- \caption@getlabel#3\label{}\@nil
- #1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
- \global\let\caption@thelabel\relax
- \ignorespaces}
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\subfloat@[1]{%
- \setbox\@tempboxa\hbox{#1}%
- \caption@iiiibox\setcaptionsubtype
- {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
- {}% no optional arguments for \caption
- {}% no sub-caption
- [\wd\@tempboxa][\caption@hj@default]%
- {\unhbox\@tempboxa}%
- \ignorespaces}
-% \end{macrocode}
-% \begin{macrocode}
-}{%
- \PackageInfo{subcaption}{\protect\subfloat\space is already defined\@gobble}
-}
+\def\subfloat@#1{%
+ \setbox\@tempboxa\hbox{#1}%
+ \caption@iiiibox\setcaptionsubtype
+ {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
+ {}% no optional arguments for \caption
+ {}% no sub-caption
+ [\wd\@tempboxa][\caption@hj@default]%
+ {\unhbox\@tempboxa}%
+ \ignorespaces}
% \end{macrocode}
% \end{macro}
%