From 743d65ddc6fa01add37aa1136fba86d3adddb577 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 1 Sep 2019 21:35:52 +0000 Subject: caption (1sep19) git-svn-id: svn://tug.org/texlive/trunk@52008 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/caption/caption.sty | 44 +++--- Master/texmf-dist/tex/latex/caption/caption3.sty | 8 +- Master/texmf-dist/tex/latex/caption/newfloat.sty | 152 +++++++++++++++++---- Master/texmf-dist/tex/latex/caption/subcaption.sty | 29 +++- 4 files changed, 179 insertions(+), 54 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty index e667b34e08c..fe21decf4e4 100644 --- a/Master/texmf-dist/tex/latex/caption/caption.sty +++ b/Master/texmf-dist/tex/latex/caption/caption.sty @@ -37,8 +37,8 @@ %% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2019/08/29 v3.3b Customizing captions (AR)] -\RequirePackage{caption3}[2018/09/12] % needs v1.8c or newer +\ProvidesPackage{caption}[2019/09/01 v3.3d Customizing captions (AR)] +\RequirePackage{caption3}[2019/09/01] % needs v1.8d or newer \caption@ifbool{documentclass}{}{% \caption@WarningNoLine{% Unsupported document class (or package) detected,\MessageBreak @@ -886,31 +886,33 @@ {\caption@iibox{#1}{#2}{#3}}% {\caption@iibox@{#1}{#2}{#3}}} \long\def\caption@iibox#1#2#3[#4]{% - \@testopt{\caption@iiibox{#1}{#2}{#3}{#4}}\captionbox@hj@default} + \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@hj@default} \long\def\caption@iibox@#1#2#3#4{% \setbox\@tempboxa\hbox{#4}% - \caption@iiibox{#1}{#2}{#3}{\wd\@tempboxa}[\captionbox@hj@default]{\unhbox\@tempboxa}} -\long\def\caption@iiibox#1#2#3#4[#5]#6{% + \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@hj@default]{\unhbox\@tempboxa}} +\long\def\caption@iiibox#1{% + \caption@iiiibox{#1}\vbox\vtop} +\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{% \begingroup #1*% set \caption@position \caption@iftop{% \endgroup - \parbox[t]{#4}{% + \parbox[t]{#6}{% #1\relax \caption@setposition t% - \vbox{\caption#2{#3}}% + #2{\caption#4{#5}}% \captionbox@hrule - \csname caption@hj@#5\endcsname - #6}% + \csname caption@hj@#7\endcsname + #8}% }{% \endgroup - \parbox[b]{#4}{% + \parbox[b]{#6}{% #1\relax \caption@setposition b% - \csname caption@hj@#5\endcsname - #6% + \csname caption@hj@#7\endcsname + #8% \captionbox@hrule - \vtop{\caption#2{#3}}}% + #3{\caption#4{#5}}}% }} \newcommand*\captionbox@hj@default{c} \newcommand*\captionbox@hrule{\hrule\@height\z@\relax} @@ -1163,16 +1165,10 @@ \caption@ifundefined\smf@makecaption{}{\let\smf@makecaption\@makecaption} \@ifclassloaded{beamer}{% \caption@InfoNoLine{beamer document class}% - \expandafter\let\expandafter\caption@ORI@figure - \csname\string\figure\endcsname - \@namedef{\string\figure}[#1]{% - \caption@ORI@figure[#1]% - \caption@settype{figure}} - \expandafter\let\expandafter\caption@ORI@table - \csname\string\table\endcsname - \@namedef{\string\table}[#1]{% - \caption@ORI@table[#1]% - \caption@settype{table}} + \let\caption@ORI@figure\figure + \def\figure{\caption@settype{figure}\caption@ORI@figure} + \let\caption@ORI@table\figure + \def\table{\caption@settype{table}\caption@ORI@table} }{} \caption@ifundefined\scr@caption{}{% \caption@AtBeginDocument{\let\scr@caption\caption}} @@ -1700,7 +1696,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}% }{% \let\piccaptiontype\@undefined diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty index 8639d49fc8a..dc0897cf9f0 100644 --- a/Master/texmf-dist/tex/latex/caption/caption3.sty +++ b/Master/texmf-dist/tex/latex/caption/caption3.sty @@ -6,7 +6,7 @@ %% %% caption3.dtx (with options: `package') %% -%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +%% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% https://gitlab.com/axelsommerfeldt/caption %% @@ -37,7 +37,7 @@ %% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2018/09/12 v1.8c caption3 kernel (AR)] +\ProvidesPackage{caption3}[2019/09/01 v1.8d caption3 kernel (AR)] \providecommand\caption@FixArabTeX{% \def\caption@tempa##1{}% \ifx\caption@tempa\@gobble @@ -707,7 +707,8 @@ {\expandafter\let\expandafter\caption@tfmt\csname caption@tfmt@#1\endcsname}} \DeclareCaptionTextFormat{empty}{% \caption@get@label#1\caption@makeanchor{}\@nil - \caption@thelabel} + \caption@thelabel + \global\let\caption@thelabel\relax} \long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{% \def\caption@tempa{#2}% \ifx\caption@tempa\@empty @@ -743,6 +744,7 @@ \long\def\caption@@@getlabel[#1]#2\@nil{% \l@addto@macro\caption@thelabel{[{#1}]}% \caption@@getlabel#2\@nil} +\let\caption@thelabel\relax \newcommand*\DeclareCaptionFont[2]{% \define@key{caption@fnt}{#1}[]{\l@addto@macro\caption@fnt{#2}}} \@onlypreamble\DeclareCaptionFont diff --git a/Master/texmf-dist/tex/latex/caption/newfloat.sty b/Master/texmf-dist/tex/latex/caption/newfloat.sty index 259ad4f685c..a561c956c48 100644 --- a/Master/texmf-dist/tex/latex/caption/newfloat.sty +++ b/Master/texmf-dist/tex/latex/caption/newfloat.sty @@ -37,11 +37,15 @@ %% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{newfloat}[2019/08/28 v1.1g Defining new floating environments (AR)] +\ProvidesPackage{newfloat}[2019/09/01 v1.1k Defining new floating environments (AR)] \newcommand*\newfloat@Info[1]{% \PackageInfo{newfloat}{#1}} \newcommand*\newfloat@InfoNoLine[1]{% \newfloat@Info{#1\@gobble}} +\newcommand*\newfloat@Warning[1]{% + \PackageWarning{newfloat}{#1}} +\newcommand*\newfloat@WarningNoLine[1]{% + \newfloat@Warning{#1\@gobble}} \newcommand*\newfloat@Error[1]{% \PackageError{newfloat}{#1}\newfloat@eh} \newcommand*\newfloat@eh{% @@ -92,8 +96,12 @@ {\begin{@tufte@float}[{##1}]{#2}{star}}% {\end{@tufte@float}}% \else - \newenvironment{#2}{\@float{#2}}{\end@float}% - \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% + \@ifclassloaded{beamer}{% + \newenvironment{#2}[1][]{\beamer@float{#2}}{\end@beamer@float}% + }{% + \newenvironment{#2}{\@float{#2}}{\end@float}% + \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% + }% \fi \newfloat@def{listof#2}{\newfloat@listof{#2}}% \newfloat@def{listof#2s}{\@nameuse{listof#2}}% @@ -332,6 +340,7 @@ \fi \ifcsname @chapter\endcsname \providecommand*\@chapterlistsgap{10\p@}% + \@ifpackageloaded{dgruyter}{\renewcommand*\@chapterlistsgap{13\p@}}{}% \providecommand*\@addchapterlistsgap[2]{% \@nameuse{@ifchapterlistsgap@#1}{% if switched on \@@addchapterlistsgap{#1}{#2}}} @@ -397,7 +406,6 @@ \define@key{newfloat}{planb-fileext}{% \newfloat@Info{Setting Plan B file extension to `#1'} \xdef\newfloat@addtocontents@ext{#1}} - \let\@tempc\relax \@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}% \AtEndOfPackage{\let\@unprocessedoptions\relax} @@ -407,6 +415,7 @@ \let\if@twocolumn\iffalse \let\if@mainmatter\iffalse \let\if@thema\iffalse + \let\if@chapnum\iffalse \def\@tempa[##1]##2{#2}% \ifx\@tempa\@chapter \newfloat@InfoNoLine{Document class `#1' detected}% @@ -564,7 +573,6 @@ \@makechapterhead{#2}% \@afterheading \fi} - % boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class] \newfloat@replace@chapter{boek}{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter @@ -694,7 +702,8 @@ \else \@makechapterhead{#2}% \@afterheading - \fi}{% + \fi +}{% \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne \refstepcounter{chapter}% \if@mainmatter @@ -715,6 +724,73 @@ \@makechapterhead{#2}% \@afterheading \fi} +\newfloat@replace@chapter{dgruyter}{% + \let\thesection\theinchapsection + \let\theequation\theinchapequation + \let\thefigure\theinchapfigure + \let\thetable\theinchaptable + \ifx\bookDOI\@undefined + \else + \@tempcnta\numexpr\componentd@i+\@ne\relax + \xdef\componentd@i{\the\@tempcnta}% + \xdef\@DOI{% + https://doi.org/\bookDOI + -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi + \ifnum\@tempcnta<10 0\fi\componentd@i}% + \fi + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{13\p@}}% + \addtocontents{lot}{\protect\addvspace{13\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \let\thesection\theinchapsection + \let\theequation\theinchapequation + \let\thefigure\theinchapfigure + \let\thetable\theinchaptable + \ifx\bookDOI\@undefined + \else + \@tempcnta\numexpr\componentd@i+\@ne\relax + \xdef\componentd@i{\the\@tempcnta}% + \xdef\@DOI{% + https://doi.org/\bookDOI + -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi + \ifnum\@tempcnta<10 0\fi\componentd@i}% + \fi + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} \ifx\newfloat@replace@chapter\newfloat@dont@replace@chapter \else \newfloat@InfoNoLine{% Unsupported document class, or \noexpand\@chapter\MessageBreak @@ -744,28 +820,59 @@ \fi \fi}}} \fi -\newcommand\newfloat@ForEachNew[2]{% - \ifcsname#1\endcsname - \ForEachFloatingEnvironment{#2}% - \else +\ifcsname beamer@float\endcsname \else + \def\beamer@float#1{% + \ifcsname caption@settype\endcsname + \caption@settype{#1}% + \else + \def\@captype{#1}% + \fi + \par\nobreak\begin{center}\nobreak} + \def\end@beamer@float{% + \par\nobreak\end{center}} +\fi +\newcommand\newfloat@IfPackageLoaded[3]{% + \@ifpackageloaded{#1}{% + \newfloat@@IfPackageLoaded{#1}{#2}{#3}% + }{% \AtBeginDocument{% - \ifcsname#1\endcsname - \ForEachFloatingEnvironment{#2}% - \fi}% - \fi}% -\@onlypreamble\newfloat@ForEachNew -%% \begin{macrocode} -\newfloat@ForEachNew{float@exts}{% + \@ifpackageloaded{#1}{% + \newfloat@@IfPackageLoaded{#1}{#2}{#3}% + }{}}% + }} +\@onlypreamble\newfloat@IfPackageLoaded +\newcommand\newfloat@@IfPackageLoaded[3]{% + \newfloat@InfoNoLine{`#1' package detected}% + % Execute code for every previous \DeclareFloatingEnvironment + \def\@elt##1{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}% + \newfloat@@list + \let\@elt\relax + % Execute code for every future \DeclareFloatingEnvironment + \newfloat@addtohook{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}} +\@onlypreamble\newfloat@@IfPackageLoaded +\newcommand\newfloat@@@IfPackageLoaded[3]{% + \ifcsname#2\endcsname + \newfloat@WarningNoLine{% + Command \@backslashchar#2 already defined.\MessageBreak + (`#1' package support)}% + \else + #3% + \fi} +\@onlypreamble\newfloat@@@IfPackageLoaded +\newfloat@IfPackageLoaded{dgruyter}{plist@#1}{% + \expandafter\newcommand\csname plist@#1\endcsname{% + \@nameuse{#1name}\space}} +\newfloat@IfPackageLoaded{float}{newfloat@undefined}{% \@nameuse{@ifchapterlistsgap@#1}{% if switched on \let\float@do=\relax \edef\@tempa{% \noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#1}}}}% \@tempa}} -\newfloat@ForEachNew{FP@floatBegin}{% +\newfloat@IfPackageLoaded{fltpage}{FP#1}{% \newcounter{FP@#1C}% \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}} \providecommand*\ext@lstlisting{lol}% -\newfloat@ForEachNew{@rotfloat}{% +\newfloat@IfPackageLoaded{rotating}{sideways#1}{% \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}% \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}} \newcommand*\newfloat@For@SC[2]{% @@ -775,13 +882,10 @@ \newenvironment{SC#2*}% {\SC@dblfloat[{#1}]{#2}}{\endSC@dblfloat}} \@onlypreamble\newfloat@For@SC -\newfloat@ForEachNew{SC@float}{% +\newfloat@IfPackageLoaded{sidecap}{SC#1}{% \expandafter\newfloat@For@SC\csname SC@#1@vpos\endcsname{#1}} -\newfloat@ForEachNew{wrapfloat}{% +\newfloat@IfPackageLoaded{wrapfig}{wrap#1}{% \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}} -\newfloat@ForEachNew{plist@figure}{% - \expandafter\newcommand\csname plist@#1\endcsname{% - \@nameuse{#1name}\space}} \endinput %% %% End of file `newfloat.sty'. diff --git a/Master/texmf-dist/tex/latex/caption/subcaption.sty b/Master/texmf-dist/tex/latex/caption/subcaption.sty index 72d1c2e4768..0f03f498edd 100644 --- a/Master/texmf-dist/tex/latex/caption/subcaption.sty +++ b/Master/texmf-dist/tex/latex/caption/subcaption.sty @@ -6,7 +6,7 @@ %% %% subcaption.dtx (with options: `package') %% -%% Copyright (C) 1994-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +%% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% https://gitlab.com/axelsommerfeldt/caption %% @@ -37,8 +37,8 @@ %% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{subcaption}[2018/05/13 v1.2 Sub-captions (AR)] -\RequirePackage{caption}[2018/05/11] % needs v3.4 or newer +\ProvidesPackage{subcaption}[2019/09/01 v1.3a Sub-captions (AR)] +\RequirePackage{caption}[2019/09/01] % needs v3.3c or newer \newcommand\subcaption@CheckCompatibility{% \@ifundefined{caption@ifcompatibility}{}{% \caption@ifcompatibility{% @@ -145,6 +145,29 @@ {\caption@Error{Undefined label format `#1'}}% {\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}} \subcaption@setrefformat{simple} +\caption@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@getlabel#3\label{}\@nil + #1{#2\caption@thelabel}{\let\label\caption@gobble#3}% + \global\let\caption@thelabel\relax + \ignorespaces} + \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} +}{% + \PackageInfo{subcaption}{\protect\subfloat\space is already defined\@gobble} +} \endinput %% %% End of file `subcaption.sty'. -- cgit v1.2.3