summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/caption
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-11 20:46:52 +0000
committerKarl Berry <karl@freefriends.org>2020-05-11 20:46:52 +0000
commitc3e239f00a6acf27533100a75bf08fff3b5ea614 (patch)
tree21b4716b23b699a6e6a3cdf55abaa5288298c4a1 /Master/texmf-dist/tex/latex/caption
parent12456f7f152925d7e748ba6a29175ba5bb09927b (diff)
caption (11may20)
git-svn-id: svn://tug.org/texlive/trunk@55099 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption')
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption.sty43
-rw-r--r--Master/texmf-dist/tex/latex/caption/caption3.sty282
2 files changed, 169 insertions, 156 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty
index f905114ef8f..71899f9dcc6 100644
--- a/Master/texmf-dist/tex/latex/caption/caption.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption.sty
@@ -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@ifbool{documentclass}{}{%
\caption@WarningNoLine{%
Unknown document class (or package),\MessageBreak
@@ -58,45 +58,6 @@
\caption@Error{Usage of the `position' option is incompatible\MessageBreak
to the `#1' package}}}
\@onlypreamble\caption@DisablePositionOption
-\DeclareCaptionOption{figureposition}{%
- \captionsetup*[figure]{position=#1}}
-\@onlypreamble@key{caption}{figureposition}
-\DeclareCaptionOption{tableposition}{%
- \captionsetup*[table]{position=#1}}
-\@onlypreamble@key{caption}{tableposition}
-\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
-\@onlypreamble@key{caption}{figurename}
-\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
-\@onlypreamble@key{caption}{tablename}
-\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
-\@onlypreamble@key{caption}{listfigurename}
-\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
-\@onlypreamble@key{caption}{listtablename}
-\newcommand*\caption@SetName[2]{%
- \caption@NewFloat{\newfloat@setname{#1}{#2}}}
-\@onlypreamble\caption@SetName
-\DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
-\newcommand*\caption@setname[2]{%
- \@namedef{#1name}{#2}}
-\newcommand*\caption@DeclareWithinOption[1]{%
- \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
- \DeclareCaptionOptionNoValue{#1without}{\caption@Within{#1}{none}}}
-\@onlypreamble\caption@DeclareWithinOption
-\caption@DeclareWithinOption{figure}
-\caption@DeclareWithinOption{table}
-\DeclareCaptionOption{within}{%
- \caption@NewFloat{\newfloatsetup{within=#1}}}
-\DeclareCaptionOptionNoValue{without}{%
- \caption@NewFloat{\newfloatsetup{without}}}
-\newcommand*\caption@Within[2]{%
- \caption@NewFloat{\newfloat@setwithin{#1}{#2}}}
-\newcommand*\caption@NewFloat[1]{%
- \let\KV@prefix@ORI\KV@prefix
- \let\@tempc@ORI\@tempc
- \caption@ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
- #1%
- \let\@tempc\@tempc@ORI
- \let\KV@prefix\KV@prefix@ORI}
\DeclareCaptionOption*{config}[caption]{%
\InputIfFileExists{#1.cfg}%
{\typeout{*** Local configuration file #1.cfg used ***}}%
diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty
index efc38bb05d3..4bbf4307d66 100644
--- a/Master/texmf-dist/tex/latex/caption/caption3.sty
+++ b/Master/texmf-dist/tex/latex/caption/caption3.sty
@@ -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@FixArabTeX{%
\def\caption@tempa##1{}%
\ifx\caption@tempa\@gobble
@@ -265,8 +265,10 @@
\caption@prepare@optioncheck
\caption@setup{#1}%
\endgroup}
-\newcommand*\caption@prepare@optioncheck{%
- \def\@captype{figure}}
+\providecommand*\caption@prepare@optioncheck{}
+\let\IfCaptionOptionCheck\@secondoftwo
+\g@addto@macro\caption@prepare@optioncheck{%
+ \let\IfCaptionOptionCheck\@firstoftwo}
\newcommand*\clearcaptionsetup{%
\caption@teststar@\@clearcaptionsetup\@gobble\@firstofone}
\newcommand*\@clearcaptionsetup[1]{%
@@ -394,13 +396,13 @@
\caption@ExecuteOptions{#2}{\caption@tempa\@ptionlist{\@currname.\@currext}}%
\AtEndOfPackage{\let\@unprocessedoptions\relax}}
\@onlypreamble\caption@@ProcessOptions
-\newcommand*\caption@packagelist{}
-\@onlypreamble\caption@packagelist
\newcommand\caption@SetupOptions[2]{%
\@namedef{caption@setkeys@#1}##1##2{#2}%
\expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
- \@cons\caption@packagelist{{#1}}}
+ \@cons\caption@SetupOptions@list{{#1}}}
\@onlypreamble\caption@SetupOptions
+\newcommand*\caption@SetupOptions@list{}
+\@onlypreamble\caption@SetupOptions@list
\let\caption@onefilewithoptions\@onefilewithoptions
\def\@onefilewithoptions#1[#2]{%
\begingroup
@@ -416,7 +418,7 @@
\caption@ExecuteOptions{#1}{#2}%
\caption@onefilewithoptions{#1}[]}%
\fi}
- \caption@packagelist
+ \caption@SetupOptions@list
\@tempa}
\@onlypreamble\caption@onefilewithoptions
\newdimen\captionmargin
@@ -719,12 +721,31 @@
\l@addto@macro\caption@thelabel{[{#1}]}%
\caption@@getlabel#2\@nil}
\let\caption@thelabel\relax
-\newcommand*\DeclareCaptionFont[2]{%
- \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#2}}}
+\newcommand*\DeclareCaptionFont{%
+ \@ifnextchar[%]
+ \caption@declare@font
+ \caption@declarefont}
\@onlypreamble\DeclareCaptionFont
-\newcommand*\caption@addto@fnt[1]{%
- \caption@check@ragged{#1}%
- \l@addto@macro\caption@fnt{#1}}
+\def\caption@declare@font[#1]#2{%
+ \global\@namedef{caption@fnt@#2@package}{#1}%
+ \caption@@declarefont{#2}}
+\@onlypreamble\caption@declare@font
+\newcommand*\caption@declarefont[1]{%
+ \global\@nameundef{caption@fnt@#1@package}%
+ \caption@@declarefont{#1}}
+\@onlypreamble\caption@declarefont
+\newcommand*\caption@@declarefont[2]{%
+ \define@key{caption@fnt}{#1}[]{\caption@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@addto@fnt[2]{%
+ \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
+ \caption@ifdefined\caption@package
+ {\caption@requirepackage\caption@package{#1}}% load package, if necessary
+ {}%
+ \l@addto@macro\caption@fnt{#2}}
\newcommand*\DeclareCaptionDefaultFont[2]{%
\global\@namedef{caption#1@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@larger}
-\DeclareCaptionFont{sansmath}{\sansmath}
-\DeclareCaptionFont{singlespacing}{%
- \caption@ifdefined\setspace@singlespace{%
- \setstretch\setspace@singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{%
- \caption@setspace{onehalfspacing}\onehalfspacing\relax}
-\DeclareCaptionFont{doublespacing}{%
- \caption@setspace{doublespacing}\doublespacing\relax}
-\DeclareCaptionFont{stretch}{%
- \caption@setspace{stretch}\setstretch\@gobble{#1}}
-\newcommand*\caption@setspace{\caption@ifpackageloaded{setspace}}
+\DeclareCaptionFont{singlespacing}{}
\DeclareCaptionFont{normal}{%
\caption@font*{%
\KV@caption@fnt@normalcolor\@unused
@@ -852,9 +863,11 @@
\KV@caption@fnt@singlespacing\@unused}}
\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}
\DeclareCaptionDefaultFont{size}{}
-\newcommand*\DeclareCaptionJustification[2]{%
- \global\@namedef{caption@hj@#1}{#2}% for compatibility to v1.0
- \DeclareCaptionFont{#1}{#2}}
+\newcommand*\DeclareCaptionJustification{%
+ \def\caption@@@declarefont##1##2{%
+ \global\@namedef{caption@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@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@Centering}
-\DeclareCaptionJustification{RaggedLeft}{\caption@RaggedLeft}
-\DeclareCaptionJustification{RaggedRight}{\caption@RaggedRight}
-\newcommand*\caption@Centering{%
- \caption@ragged{Centering}\Centering\centering}
-\newcommand*\caption@RaggedLeft{%
- \caption@ragged{RaggedLeft}\RaggedLeft\raggedleft}
-\newcommand*\caption@RaggedRight{%
- \caption@ragged{RaggedRight}\RaggedRight\raggedright}
-\newcommand*\caption@ragged{\caption@ifpackageloaded{ragged2e}}
-\newcommand*\caption@ifpackageloaded[4]{%
- \caption@ifdefined#3#3{%
- \caption@Error{Option `#2' requires the `#1' package\MessageBreak
- (or an alternative definition of \string#3)}%
- #4}}
-\newcommand*\caption@pkg@list{}
-\caption@AtBeginDocument{%
- \def\caption@tempa{\endgroup}%
- \begingroup
- \def\@elt#1{%
- \g@addto@macro\caption@tempa{%
- \caption@InfoNoLine{Load package `#1'}%
- \RequirePackage{#1}\relax}}%
- \caption@pkg@list
- \caption@tempa}
-\@ifpackageloaded{ragged2e}{\let\caption@check@ragged\@gobble}{%
- \newcommand*\caption@check@ragged[1]{%
- \begingroup
- \def\caption@tempa{#1}%
- \caption@check@ragged@{Centering}%
- \caption@check@ragged@{RaggedLeft}%
- \caption@check@ragged@{RaggedRight}%
- \endgroup}%
- \newcommand*\caption@check@ragged@[1]{%
- \expandafter\def\expandafter\caption@tempb\expandafter{\csname caption@#1\endcsname}%
- \ifx\caption@tempa\caption@tempb % our definition of `ragged2e' option?
- \@ifundefined{#1}{%
- \caption@Info{Usage of `ragged2e' command \expandafter\string\csname #1\endcsname\space detected}%
- \@cons\caption@pkg@list{{ragged2e}}% load `ragged2e' package later on
- \global\let\caption@check@ragged\@gobble}{}%
- \fi
- }%
- \caption@AtBeginDocument{%
- \let\caption@check@ragged\@gobble
- \let\caption@check@ragged@\@undefined}}
-%%\@ifl@aded{dtx}{subfig}{\RequirePackage{ragged2e}\relax}{} % not needed
-\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
-\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
\caption@ifundefined\abovecaptionskip{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
\caption@ifundefined\belowcaptionskip{%
@@ -944,6 +909,12 @@
\newcommand*\caption@hrule{\hrule\@height\z@}
\DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}}
\DeclareCaptionOption{position}{\caption@setposition{#1}}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
\newcommand*\caption@setposition[1]{%
\caption@ifinlist{#1}{d,default}{%
\let\caption@position\caption@defaultpos
@@ -1246,6 +1217,127 @@
}{}}
\caption@tempa{hungarian}
\caption@tempa{magyar}
+\newcommand*\caption@xpackage[2]{%
+ \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobbletwo
+ \fi
+ {#1{#2}}}
+\let\caption@pkgextension\@pkgextension
+\newcommand*\caption@loadpackage{%
+ \caption@xpackage\caption@@loadpackage}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
+\newcommand*\caption@requirepackage{%
+ \caption@xpackage\caption@@requirepackage}
+\newcommand*\caption@@requirepackage[2]{%
+ \@cons\caption@packagelist{{#1}{#2}}}% load package later on
+\newcommand*\caption@pkg@list{}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+\caption@AtBeginDocument{%
+ \def\caption@tempa{\endgroup}%
+ \begingroup
+ \def\@elt#1#2{%
+ \g@addto@macro\caption@tempa{%
+ \caption@loadpackage{#1}{#2}}}%
+ \caption@packagelist
+ \caption@tempa
+ \renewcommand*\caption@@loadpackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}%
+ \let\caption@@requirepackage\caption@@loadpackage
+ }
+\newcommand*\caption@usepackage[3]{%
+ \IfCaptionOptionCheck
+ {\caption@requirepackage{#1}{#2}}%
+ {\let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@loadpackage{#1}{#2}%
+ #3%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}}
+\newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\@onlypreamble@key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\@onlypreamble@key{caption}{tablename}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\@onlypreamble@key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+\@onlypreamble@key{caption}{listtablename}
+\newcommand*\caption@SetName[2]{%
+ \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
+\@onlypreamble\caption@SetName
+\DeclareCaptionOption{name}{%
+ \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
+\newcommand*\caption@setname[2]{%
+ \@namedef{#1name}{#2}}
+\DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
+\DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
+\DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
+\newcommand*\caption@within[2]{%
+ \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
+\DeclareCaptionOption{within}{%
+ \caption@newfloat{within}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+ \caption@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@ifdefined\setspace@singlespace{%
+ \setstretch\setspace@singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \@nameuse{caption@warmup}%
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@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@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
+\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
+\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
\captionsetup{style=default,position=default,%
list,listformat=default,twoside=\if@twoside 1\else 0\fi}
\ProcessOptions*
@@ -1493,7 +1585,7 @@
\newcommand*\caption@@par{%
\parindent\caption@parindent\hangindent\caption@hangindent}%
\newcommand*\DeclareCaptionType{%
- \RequirePackage{newfloat}%
+ \caption@loadpackage{newfloat}{}%
\DeclareFloatingEnvironment}
\@onlypreamble\DeclareCaptionType
\newcommand\caption@ForEachType[1]{%
@@ -1613,46 +1705,6 @@
\def\@elt##1{#3}%
\@nameuse{caption@#2}%
\let\@elt\relax}}%
-\caption@AtBeginDocument{%
- \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
- \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
- \caption@InfoNoLine{subfig package v1.3 is loaded}%
- \let\caption@setfloattype\@gobble
- \let\@dottedxxxline\sf@NEW@dottedxxxline
- \let\sf@subfloat\sf@NEW@subfloat
- \fi
- \let\sf@NEW@dottedxxxline\@undefined
- \let\sf@NEW@subfloat\@undefined}
-\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
- \begingroup
- \caption@setfloattype{#1}%
- \caption@setoptions{subfloat}%
- \caption@setoptions{sub#1}%
- \ifnum #3>\@nameuse{c@#2depth}\else
- \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
- \fi
- \endgroup}
-\def\sf@NEW@subfloat{%
- \begingroup
- \@nameuse{caption@warmup}%
- \caption@setfloattype\@captype
- \sf@ifpositiontop{%
- \maincaptiontoptrue
- }{%
- \maincaptiontopfalse
- }%
- \caption@setoptions{subfloat}%
- \caption@setoptions{sub\@captype}%
- \let\sf@oldlabel=\label
- \let\label=\subfloat@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'.