summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/caption.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.dtx101
1 files changed, 78 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx
index d528950165b..c33e91239fb 100644
--- a/Master/texmf-dist/source/latex/caption/caption.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption.dtx
@@ -25,7 +25,7 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{3695}
+% \CheckSum{3702}
%
% \iffalse
%<*driver>
@@ -87,6 +87,8 @@
% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
% \newcommand*\version[2][]{\textit{v#2}}
%
+% \newcommand*\issue[1]{GitLab~\##1}
+%
% \GetFileInfo{caption.drv}
% \let\docdate\filedate
% \GetFileInfo{caption.sty}
@@ -218,7 +220,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2018/10/06 v3.3-154 Customizing captions (AR)]
+\ProvidesPackage{caption}[2019/04/01 v3.3a Customizing captions (AR)]
% \end{macrocode}
%
% \subsection{Loading the kernel}
@@ -733,6 +735,7 @@
% \end{macrocode}
%
% \begin{macro}{\setcapwidth}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% \Note{The optional argument of \cs{setcapwidth} if not supported (yet),
% so we issue a warning if used.
% (Since this does not seem to have an negative effect when used
@@ -741,7 +744,7 @@
\expandafter\let\expandafter\caption@KOMA@setcapwidth
\csname\string\setcapwidth\endcsname
\@namedef{\string\setcapwidth}[#1]#2{%
- \caption@KOMA@setcapwidth[#1]{#2}\caption@setcapwidth{#1}}
+ \caption@KOMA@setcapwidth[{#1}]{#2}\caption@setcapwidth{#1}}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@setcapwidth[1]{%
@@ -768,13 +771,13 @@
\expandafter\let\expandafter\caption@KOMA@setcapmargin
\csname\string\@setcapmargin\endcsname
\@namedef{\string\@setcapmargin}[#1]#2{%
- \caption@KOMA@setcapmargin[#1]{#2}\caption@setcapmargin}
+ \caption@KOMA@setcapmargin[{#1}]{#2}\caption@setcapmargin}
% \end{macrocode}
% \begin{macrocode}
\expandafter\let\expandafter\caption@KOMA@@setcapmargin
\csname\string\@@setcapmargin\endcsname
\@namedef{\string\@@setcapmargin}[#1]#2{%
- \caption@KOMA@@setcapmargin[#1]{#2}\caption@setcapmargin}
+ \caption@KOMA@@setcapmargin[{#1}]{#2}\caption@setcapmargin}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@setcapmargin{%
@@ -982,15 +985,49 @@
% typeset the caption.
% \begin{macrocode}
\long\def\caption@makecaption#1#2{%
- \caption@iftop
- {\vskip\belowcaptionskip}%
- {\caption@rule\vskip\abovecaptionskip}%
+ \caption@make@above
\caption@@make{#1}{#2}%
+ \caption@make@below}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@make@above}
+% \begin{macro}{\caption@make@below}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@make@above|\\
+% |\caption@make@below|\par
+% Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
+% \begin{macrocode}
+\newcommand*\caption@make@above{%
\caption@iftop
- {\vskip\abovecaptionskip\caption@rule}%
- {\vskip\belowcaptionskip}}
+ \caption@belowskip
+ {\caption@rule\caption@aboveskip}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@make@below{%
+ \caption@iftop
+ {\caption@aboveskip\caption@rule}%
+ \caption@belowskip}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\caption@aboveskip}
+% \begin{macro}{\caption@belowskip}
+% \changes{v3.3a}{2019/04/02}{This macro added}
+% |\caption@aboveskip|\\
+% |\caption@belowskip|\par
+% Typesets the skip above resp.~below the caption.
+% \begin{macrocode}
+\newcommand*\caption@aboveskip{%
+ \vskip\abovecaptionskip}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@belowskip{%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\caption@redefine}
% \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now}
@@ -1461,7 +1498,7 @@
% \begin{macrocode}
\caption@CheckCommand\@caption{%
% chkfloat.sty [20??/??/?? v0.? chkfloat: check for moved floats]
- \def\@caption#1[#2]#3{\chkfloat@caption{#1}[#2]{#3}%
+ \def\@caption#1[#2]#3{\chkfloat@caption{#1}[{#2}]{#3}%
\chkfloat@addcontentsline{#1}{#2}%
}}%
% \end{macrocode}
@@ -1556,13 +1593,14 @@
% \begin{macro}{\@xfloat}
% \changes{v3.1}{2007/05/09}{This re-definition added}
% \changes{v3.1b}{2007/09/22}{Will now be redefined in compatibility mode, too}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% We redefine |\@xfloat| so inside floating environments our
% type-specific options will be used, a \package{hyperref}
% anchor will be set etc.
% \begin{macrocode}
\let\caption@ORI@xfloat\@xfloat
\def\@xfloat#1[#2]{%
- \caption@ORI@xfloat{#1}[#2]%
+ \caption@ORI@xfloat{#1}[{#2}]%
\caption@settype{#1}}%
% \end{macrocode}
% \end{macro}
@@ -2607,19 +2645,20 @@
% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
% \begin{macro}{\table}
% \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% We redefine |figure| \& |table| so our type-specific options will be used etc.
% \begin{macrocode}
\expandafter\let\expandafter\caption@ORI@figure
\csname\string\figure\endcsname
\@namedef{\string\figure}[#1]{%
- \caption@ORI@figure[#1]%
+ \caption@ORI@figure[{#1}]%
\caption@settype{figure}}
% \end{macrocode}
% \begin{macrocode}
\expandafter\let\expandafter\caption@ORI@table
\csname\string\table\endcsname
\@namedef{\string\table}[#1]{%
- \caption@ORI@table[#1]%
+ \caption@ORI@table[{#1}]%
\caption@settype{table}}
% \end{macrocode}
% \end{macro}
@@ -2761,6 +2800,7 @@
% so no extra check is needed}
% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage}
% to \cs{caption@IfPackageLoaded}}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
% Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
% If the \meta{package} is not loaded yet, the check will be (re-)done
@@ -2775,7 +2815,7 @@
\@ifpackageloaded{#1}\@firstofone{%
\caption@Debug{#1 package is not loaded (yet)\@gobble}%
\caption@AtBeginDocument}{%
- \caption@If@Package@Loaded{#1}[#2]{#3}{#4}}}
+ \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
\@onlypreamble\caption@@IfPackageLoaded
% \end{macrocode}
% \begin{macrocode}
@@ -3930,6 +3970,7 @@
% Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
+% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
% |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
% \smallskip
% The original definition:
@@ -4002,24 +4043,34 @@
\vskip-\ht\strutbox
% \end{macrocode}
%
+% Work-around for problem with \package{floatrow}:
+% The |\belowcaptionskip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
+% so we supress this skip if the \package{floatrow} package is loaded.
+% (This fixes \issue{50})
+% \begin{macrocode}
+ \caption@ifundefined\FBifcaptop{}{%
+ \let\caption@belowskip\@empty}%
+% \end{macrocode}
+%
% The following code should look familiar. We do our skips and use
% |\caption@@make| to typeset the caption itself.
% \begin{macrocode}
- \caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
+ \caption@make@above
\caption@@make{#2}{#3}\endgraf
- \caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}%
+ \caption@make@below
\caption@end}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LT@listentry}
% \changes{v3.3}{2018/08/26}{This macro added}
-% \changes{v3.3}{2018/10/05}{\cs{ignorespaces} added}
+% \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% \begin{macrocode}
\renewcommand*\LT@listentry[2]{%
\begingroup
\caption@LT@settype{#1}%
- \caption@listentry\@firstoftwo[#1]{#2}%
+ \caption@listentry\@firstoftwo[{#1}]{#2}%
\endgroup\ignorespaces}%
% \end{macrocode}
% \end{macro}
@@ -4260,6 +4311,7 @@
%
% \begin{macro}{\ivparpic}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% We need to set our \package{hyperref} anchor here.
% Not bullet-proof since we have to redefine |\noindent| here!
% \begin{macrocode}
@@ -4270,7 +4322,7 @@
\caption@defrostHref
\let\noindent\caption@ORI@noindent
\noindent}%
- \caption@ORI@ivparpic(#1,#2)(#3,#4)[#5][#6]{#7}%
+ \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
\let\noindent\caption@ORI@noindent}%
% \end{macrocode}
% \end{macro}
@@ -4358,6 +4410,7 @@
% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% This macro will be called at the start of the environment, here is a good
% opportunity to do some adaptations to |\caption| and |\captionsetup|.
% \begin{macrocode}
@@ -4367,7 +4420,7 @@
% First we use the original definition, but restore \cs{caption} and \cs{label}
% so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
% \begin{macrocode}
- \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
+ \caption@ORI@SC@zfloat{#1}{#2}{#3}[{#4}]%
\SC@RestoreCommands
% \end{macrocode}
% Since the sidecap package uses our |\caption| code outside the
@@ -4503,12 +4556,13 @@
% \begin{macro}{\@xtablecaption}
% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% Make |\nameref| and |\autoref| work.
% \begin{macrocode}
\let\caption@ORI@xtablecaption\@xtablecaption
\long\def\@xtablecaption[#1]#2{%
\caption@gettitle{#2}%
- \caption@ORI@xtablecaption[#1]{#2}}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
% \end{macrocode}
% \end{macro}
%
@@ -4571,12 +4625,13 @@
%
% \begin{macro}{\@xtablecaption}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
+% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% Make |\nameref| and |\autoref| work.
% \begin{macrocode}
\let\caption@ORI@xtablecaption\@xtablecaption
\long\def\@xtablecaption[#1]#2{%
\caption@gettitle{#2}%
- \caption@ORI@xtablecaption[#1]{#2}}%
+ \caption@ORI@xtablecaption[{#1}]{#2}}%
% \end{macrocode}
% \end{macro}
%