From 662cda48313c1615e5b117f827f245bd4a4fc22a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 11 Oct 2011 22:51:57 +0000 Subject: caption (11oct11) git-svn-id: svn://tug.org/texlive/trunk@24268 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/caption/bicaption.dtx | 435 ++++++++++++++++++--- Master/texmf-dist/source/latex/caption/caption.dtx | 395 ++++++++++--------- .../texmf-dist/source/latex/caption/caption2.dtx | 26 +- .../texmf-dist/source/latex/caption/caption3.dtx | 224 ++++++++--- .../texmf-dist/source/latex/caption/ltcaption.dtx | 19 +- .../texmf-dist/source/latex/caption/subcaption.dtx | 60 +-- 6 files changed, 825 insertions(+), 334 deletions(-) (limited to 'Master/texmf-dist/source/latex/caption') diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx index 3f0e989df9f..be0f7d433d7 100644 --- a/Master/texmf-dist/source/latex/caption/bicaption.dtx +++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx @@ -14,7 +14,7 @@ % and version 1.3 or later is part of all distributions of LaTeX % version 2003/12/01 or later. % -% This work has the LPPL maintenance status "maintained". +% This work has the LPPL maintenance status "maintained".F % % This Current Maintainer of this work is Axel Sommerfeldt. % @@ -25,12 +25,12 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{190} +% \CheckSum{366} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{bicaption.drv}[2010/09/19 v1.0 Adds a bilingual caption feature to the caption package] +\ProvidesFile{bicaption.drv}[2011/09/03 v1.0 Adds a bilingual caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -263,20 +263,41 @@ % \DescribeMacro\bicaption % Bilingual captions will be typeset by % \begin{quote} -% |\bicaption|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\ +% |\bicaption|\oarg{list entry \#1}\marg{heading \#1}\\ +% | |\oarg{list entry \#2}\marg{heading \#2}\\ % |\bicaption*|\marg{heading \#1}\marg{heading \#2} % \end{quote} % The |\label| should be placed either after this command, or inside the first heading. % +% \DescribeMacro\bicaptionbox +% Bilingual caption boxes will be typeset by +% \begin{quote} +% |\bicaptionbox|\oarg{list entry \#1}\marg{heading \#1}\\ +% | |\oarg{list entry \#2}\marg{heading \#2}\\ +% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\ +% |\bicaptionbox*|\marg{heading \#1}\marg{heading \#2}\\ +% | |\oarg{width}\oarg{inner-pos}\marg{contents} +% \end{quote} +% The |\label| should be placed inside the first heading. +% +% \begingroup\small +% (For a description of the optional parameters \meta{width} and \meta{inner-pos} +% please take a look at the \package{caption} package documentation, +% \cs{captionbox}.) +% \endgroup +% % \bigskip % % If the \package{subcaption} package is loaded, these commands are available % additionally: % +% \smallskip +% % \DescribeMacro\bisubcaption % Bilingual sub-captions will be typeset by % \begin{quote} -% |\bisubcaption|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\ +% |\bisubcaption|\oarg{list entry \#1}\marg{heading \#1}\\ +% | |\oarg{list entry \#2}\marg{heading \#2}\\ % |\bisubcaption*|\marg{heading \#1}\marg{heading \#2} % \end{quote} % The |\label| should be placed either after this command, or inside the first heading. @@ -284,14 +305,22 @@ % \DescribeMacro\bisubcaptionbox % Bilingual sub-caption boxes will be typeset by % \begin{quote} -% |\subcaptionbox|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\ -% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\ -% |\subcaptionbox*|\marg{heading \#1}\marg{heading \#2}\\ -% | |\oarg{width}\oarg{inner-pos}\marg{contents} +% |\bisubcaptionbox|\oarg{list entry \#1}\marg{heading \#1}\\ +% | |\oarg{list entry \#2}\marg{heading \#2}\\ +% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\ +% |\bisubcaptionbox*|\marg{heading \#1}\marg{heading \#2}\\ +% | |\oarg{width}\oarg{inner-pos}\marg{contents} % \end{quote} % The |\label| should be placed inside the first heading. % -% \subsection{An example code} +% \begingroup\small +% (For a description of the optional parameters \meta{width} and \meta{inner-pos} +% please take a look at the \package{subcaption} package documentation, +% \cs{subcaptionbox}.) +% \endgroup +% +% \PageBreak +% \subsection{A sample document} % % \begin{quote} % |\documentclass[english,ngerman]{article}|\\ @@ -300,14 +329,18 @@ % ||\\ % |\usepackage{babel}|\\ % |\usepackage[lang=english,font=it]{bicaption}|\\ +% \iffalse % |\usepackage[format=hang,list=on]{subcaption}|\\ +% \else +% |\usepackage[format=hang]{subcaption}|\\ +% \fi % ||\\ % |\begin{document}|\\ % ||\\ -% \iffalse +% \iffalse % |\listoffigures|\\ % ||\\ -% \fi +% \fi % |\begin{figure}[!htb]|\\ % | \centering|\\ % | \bisubcaptionbox|\\ @@ -321,7 +354,7 @@ % | \label{fig:test}|\\ % |\end{figure}|\\ % ||\\ -% \iffalse +% \iffalse % |\captionsetup{bi-lang=2nd}|\\ % ||\\ % |\begin{figure}[!htb]|\\ @@ -336,8 +369,8 @@ % | \bicaption{Deutscher Titel}{English Title}|\\ % | \label{fig:test2}|\\ % |\end{figure}|\\ -% \fi % ||\\ +% \fi % |\captionsetup{bi-lang=both}|\\ % ||\\ % |\begin{figure}[!htb]|\\ @@ -389,9 +422,10 @@ % | {Short English heading}|\\ % |\end{figure}|\\ % ||\\ -% |\end{document}|\\ +% |\end{document}| % \end{quote} % +% \PageBreak % \captionsetup[bi-first]{lang=german} % \captionsetup[bi-second]{lang=english,font=it} % \captionsetup[sub]{format=hang,list=on} @@ -482,6 +516,119 @@ % {Short English heading} % \end{figure} % +% \PageBreak +% \subsection{Customising lists} +% +% \DescribeMacro{list=} +% As default both caption texts will be insert into the List of Figures resp. List of Tables. +% To suppress the second entry just pass the option |list=off| to the \package{bicaption} +% package, e.g.: +% \begin{quote} +% |\usepackage[lang=english,|\ldots|,list=off]{bicaption}| +% \end{quote} +% +% \pagebreak[3] +% \DescribeMacro{listtype+=} +% Another option is separating the lists. For that purpose the option +% \begin{quote} +% |listtype+=|\meta{list type extension} +% \end{quote} +% can be used to tell the \package{bicaption} package to use a different list +% for the second caption text. +% The given value will be appended to the current environment type; +% for example with |listtype+=X| the list entries will be put into the list +% responsible for the types +% |figureX| ($=$ |figure| $+$ |X|), |tableX| ($=$ |table| $+$ |X|) etc. +% +% Such a \meta{list type} can be defined using |\Declare|\-|Caption|\-|Type| +% offered by the \package{caption} package, but some document classes +% or other packages offer macros for defining new floating environment types +% (and their corresponding lists) as well. +% +% A sample document: +% \begin{quote} +% |\documentclass[a4paper]{article}|\\ +% ||\\ +% |% Use "ngerman" as 1st language, "english" as 2nd one|\\ +% |\usepackage[english,ngerman]{babel}|\\ +% ||\\ +% |% Load the bicaption package with 2nd language set to|\\ +% |% "english", and list type "figureEng" resp. "tableEng"|\\ +% |\usepackage[lang=english,listtype+=Eng]{bicaption}|\\ +% ||\\ +% |% Define the new floating environment type "figureEng"|\\ +% |\DeclareCaptionType[fileext=lof2]{figureEng}|\\ +% | [Figure][List of Figures]|\\ +% |% Define the new floating environment type "tableEng"|\\ +% |\DeclareCaptionType[fileext=lot2]{tableEng}|\\ +% | [Table][List of Tables]|\\ +% ||\\ +% |\begin{document}|\\ +% |\listoffigures % typeset "Abbildungsverzeichnis"|\\ +% |\listoffigureEnges % typeset "List of Figures"|\\ +% ||\\ +% |\begin{figure}|\\ +% | \centering|\\ +% | A placeholder for an image or whatever|\\ +% | \bicaption{Deutscher Text}{English text}|\\ +% |\end{figure}|\\ +% ||\\ +% |\end{document}| +% \end{quote} +% +% \pagebreak[3] +% A different approach is using one list for both languages, but with different formatting. +% Since the \package{caption} package does not offer options and commands for +% customising the format of the lists, one need an additional package for this purpose, +% for example the \package{titletoc} package: +% +% \begin{quote} +% |\documentclass[a4paper]{article}|\\ +% ||\\ +% |% Use "ngerman" as 1st language, "english" as 2nd one|\\ +% |\usepackage[english,ngerman]{babel}|\\ +% ||\\ +% |% Load the bicaption package with 2nd language set to|\\ +% |% "english", and list type "figure2" resp. "table2"|\\ +% |\usepackage[lang=english,listtype+=2]{bicaption}|\\ +% ||\\ +% |% We load the titletoc package for customizing lists|\\ +% |% Note: Loading titletoc should be done prior defining|\\ +% |% additional floating environments with \DeclareCaptionType|\\ +% |\usepackage{titletoc}|\\ +% ||\\ +% |% Define the new floating environment type "figure2"|\\ +% |% Use the same file extension as for "figure" (.lof) here|\\ +% |\DeclareCaptionType[fileext=lof]{figure2}|\\ +% |% Define the new floating environment type "table2"|\\ +% |% Use the same file extension as for "table" (.lot) here|\\ +% |\DeclareCaptionType[fileext=lot]{table2}|\\ +% ||\\ +% |% We use the titletoc package for customizing "figure2"|\\ +% |% which is appropriate for the second language captions|\\ +% \iffalse +% |\contentsuse{figure2}{lof}|\\ +% \fi +% |\titlecontents{figure2}[3.8em]|\\ +% | {} % no above code|\\ +% | {} % empty numbered entry format|\\ +% | {} % empty numberless entry format|\\ +% | {} % empty filler page format|\\ +% ||\\ +% |\begin{document}|\\ +% |\renewcommand\listfigurename|\\ +% | {Abbildungsverzeichnis / List of Figures}|\\ +% |\listoffigures|\\ +% ||\\ +% |\begin{figure}|\\ +% | \centering|\\ +% | A placeholder for an image or whatever|\\ +% | \bicaption{Deutscher Text}{English text}|\\ +% |\end{figure}|\\ +% ||\\ +% |\end{document}| +% \end{quote} +% % \iffalse % --------------------------------------------------------------------------- % % \fi @@ -567,9 +714,19 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{bicaption}[2011/08/12 v0.9b Bilingual Captions (AR)] -\RequirePackage{caption}[2011/08/12] % needs v3.2a or newer +\ProvidesPackage{bicaption}[2011/09/03 v1.0 Bilingual Captions (AR)] +% \end{macrocode} +% \begin{macrocode} +\RequirePackage{caption}[2011/08/28] % needs v3.2c or newer % \end{macrocode} +% \changes{v1.0}{2011/09/01}{Compatibility error added} +% \begin{macrocode} +\caption@AtBeginDocument{\caption@ifcompatibility{% + \caption@Error{% + The `bicaption' package does not work correctly\MessageBreak + in compatibility mode}}{}} +% \end{macrocode} +% % \bigskip % % \pagebreak[3] @@ -650,17 +807,24 @@ % \end{macrocode} % % \begin{macro}{\bicaption@selectlanguage} +% \changes{v1.0}{2011/08/31}{Starred variant added} % Set the language via \cs{selectlanguage}. % \begin{macrocode} \newcommand*\bicaption@selectlanguage{% + \@ifstar + {\bicaption@select@language\select@language} + {\bicaption@select@language\selectlanguage}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\bicaption@select@language[1]{% \caption@ifundefined\bicaption@language{}{% - \expandafter\selectlanguage\expandafter{\bicaption@language}}} + \expandafter#1\expandafter{\bicaption@language}}} % \end{macrocode} % |\caption@applyfont| (of the \package{caption} package kernel) will be extended here % so the language setting will actually take effect. % \begin{macrocode} \g@addto@macro\caption@applyfont{% - \bicaption@selectlanguage} + \bicaption@selectlanguage*} % \end{macrocode} % \begin{macrocode} \g@addto@macro\caption@prepareslc{% @@ -695,6 +859,61 @@ % \pagebreak[3] % \subsection{Main code} % +% \begin{macro}{\caption@kernel@addcontentsline} +% \changes{v1.0}{2011/08/31}{Redefinition of \cs{caption@kernel@addcontentsline} added} +% We patch \cs{caption@kernel@addcontentsline} (of the \package{caption} package kernel) +% so \cs{bicaption@addcontentsline} will be used for bilingual captions instead. +% \begin{macrocode} +\let\caption@kernel@addcontentsline@ORI\caption@kernel@addcontentsline +\renewcommand*\caption@kernel@addcontentsline[2]{% + \caption@ifundefined\bicaption@lentry + {\caption@kernel@addcontentsline@ORI{#1}{#2}}% + {\expandafter\bicaption@addcontentsline\expandafter{\bicaption@lentry}{#1}{#2}% + \global\let\bicaption@lentry\@undefined}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bicaption@addcontentsline} +% \changes{v1.0}{2011/08/31}{This macro added} +% |\bicaption@addcontentsline|\marg{list entry \#2}\marg{type}\marg{list entry \#1}\par +% Typeset both captions using the original version of \cs{caption@addcontentsline}. +% \begin{macrocode} +\newcommand\bicaption@addcontentsline[3]{% + \begingroup +% \end{macrocode} +% Execute the options setup with |\captionsetup[bi]{|\ldots|}|. +% \begin{macrocode} + \caption@setoptions{bi}% +% \end{macrocode} +% Do the first list entry, if requested. +% \begin{macrocode} + \ifnum\bicaption@lang=2\relax \else + \begingroup + \caption@setoptions{bi-first}% + \bicaption@@addcontentsline{#2}{#3}% + \endgroup + \fi +% \end{macrocode} +% Do the second list entry, if requested. +% \begin{macrocode} + \ifnum\bicaption@lang=1\relax \else + \begingroup + \caption@setoptions{bi-second}% + \bicaption@@addcontentsline{#2}{#1}% + \endgroup + \fi +% \end{macrocode} +% \begin{macrocode} + \endgroup} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\bicaption@@addcontentsline[2]{% + \caption@ifcontentsline{#2}{% + \bicaption@selectlanguage\relax + \caption@kernel@addcontentsline@ORI{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\caption@@make} % We patch \cs{caption@@make} (of the \package{caption} package kernel) % so \cs{bicaption@@make} will be used for bilingual captions instead. @@ -703,14 +922,13 @@ \renewcommand\caption@@make[2]{% \caption@ifundefined\bicaption@text {\caption@@make@ORI{#1}{#2}}% - {\bicaption@@make{#1}{#2}{\bicaption@text}% - \global\let\bicaption@label\@undefined + {\expandafter\bicaption@@make\expandafter{\bicaption@text}{#1}{#2}% \global\let\bicaption@text\@undefined}} % \end{macrocode} % \end{macro} % % \begin{macro}{\bicaption@@make} -% |\bicaption@@make|\marg{label}\marg{text \#1}\marg{text \#2}\par +% |\bicaption@@make|\marg{text \#2}\marg{label}\marg{text \#1}\par % Typeset both captions using the original version of \cs{caption@@make}. % \begin{macrocode} \newcommand\bicaption@@make[3]{% @@ -723,9 +941,9 @@ % \begin{macrocode} \ifnum\bicaption@lang=0\relax \bicaption@ifslc - {\caption@@slc{#1}{#2}{\captionwidth}{}% + {\caption@@slc{#2}{#3}{\captionwidth}{}% {\caption@set@bool\caption@ifslc0}% - \caption@@slc{#1}{#3}{\captionwidth}{}% + \caption@@slc{#2}{#1}{\captionwidth}{}% {\caption@set@bool\caption@ifslc0}}% {}% \fi @@ -734,13 +952,12 @@ % (Otherwise we only apply the label of it.) % \begin{macrocode} \ifnum\bicaption@lang=2\relax - \ifx\bicaption@label\@empty\else - \expandafter\label\expandafter{\bicaption@label}% - \fi + \bicaption@label + \global\let\bicaption@label\relax \else \begingroup \caption@setoptions{bi-first}% - \caption@@make@ORI{#1}{#2}% + \caption@@make@ORI{#2}{#3}% \endgroup \fi % \end{macrocode} @@ -750,61 +967,165 @@ \else \begingroup \caption@setoptions{bi-second}% - \caption@@make@ORI{#1}{#3}% + \caption@@make@ORI{#2}{#1}% \endgroup \fi} % \end{macrocode} % \end{macro} % -% \begin{macro}{\bicaption@setup} -% |\bicaption@setup|\marg{text \#1}\marg{text \#2}\par -% Initiates the bilingual caption typesetting by extracting the |\label| -% of the first text and storing the second text into |\bicaption@text|. -% \begin{macrocode} -\newcommand\bicaption@setup[2]{% - \bicaption@getlabel#1\label{}\@nil - \global\long\def\bicaption@text{\ignorespaces#2}} -\long\def\bicaption@getlabel#1\label#2#3\@nil{% - \global\def\bicaption@label{#2}} -% \end{macrocode} -% \end{macro} -% % \pagebreak[3] % \subsubsection{The \cs{bicaption} commands} % -% \begin{macro}{\@bicaption} +% \begin{macro}{\bicaption} +% |\bicaption*|\oarg{list entry \#1}\marg{text \#1}\oarg{list entry \#2}\marg{text \#2} % \begin{macrocode} -\newcommand*\@bicaption[1]{% - \let\bicaption@cmd#1% - \caption@withoptargs\@@bicaption} -\newcommand\@@bicaption[3]{% - \bicaption@ifswap - {\bicaption@setup{#2}{#2}% - \bicaption@cmd#1{#3}}% - {\bicaption@setup{#2}{#3}% - \bicaption@cmd#1{#2}}} +\newcommand\bicaption{\@bicaption\caption} % \end{macrocode} % \end{macro} % -% \begin{macro}{\bicaption} -% |\bicaption*|\oarg{list entry}\marg{text \#1}\marg{text \#2} +% \begin{macro}{\bicaptionbox} +% \changes{v1.0}{2011/08/31}{This macro added} +% |\bicaptionbox*|\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}% +% \oarg{\ldots}\marg{\ldots} % \begin{macrocode} -\newcommand\bicaption{\@bicaption\caption} +\newcommand\bicaptionbox{\@bicaption\captionbox} % \end{macrocode} % \end{macro} % % \begin{macro}{\bisubcaption} -% |\bisubcaption*|\oarg{list entry}\marg{text \#1}\marg{text \#2} +% |\bisubcaption*|\oarg{list entry \#1}\marg{text \#1}\oarg{list entry \#2}\marg{text \#2} % \begin{macrocode} \newcommand\bisubcaption{\@bicaption\subcaption} +\let\subbicaption\bisubcaption % \end{macrocode} % \end{macro} % % \begin{macro}{\bisubcaptionbox} -% |\bisubcaptionbox*|\oarg{list entry}\marg{text \#1}\marg{text \#2}% +% |\bisubcaptionbox*|\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}% % \oarg{\ldots}\marg{\ldots} % \begin{macrocode} \newcommand\bisubcaptionbox{\@bicaption\subcaptionbox} +\let\subbicaptionbox\bisubcaptionbox +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@bicaption} +% \changes{v1.0}{2011/08/31}{Optional parameter \meta{list entry \#2} added} +% |\@bicaption|\marg{cmd}*\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}\ldots +% \begin{macrocode} +\newcommand*\@bicaption[1]{% + \def\bicaption@cmd{#1}% + \@ifstar + {\l@addto@macro\bicaption@cmd*% + \@@bicaption}% + {\caption@dblarg\@@@bicaption}} +% \end{macrocode} +% \begin{macrocode} +\newcommand\@@bicaption[1]{% + \@@@@bicaption{}{#1}[]} +% \end{macrocode} +% \begin{macrocode} +\long\def\@@@bicaption[#1]#2{% + \caption@dblarg{\@@@@bicaption{#1}{#2}}} +% \end{macrocode} +% \begin{macrocode} +\long\def\@@@@bicaption#1#2[#3]#4{% + \bicaption@getlabel#2\label{}\@nil + \bicaption@ifswap + {\bicaption@setup{#1}{#2}% + \bicaption@cmd[{#3}]{#4}}% + {\bicaption@setup{#3}{#4}% + \bicaption@cmd[{#1}]{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bicaption@getlabel} +% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now} +% Gets the label command out of the (first) caption text and stores it to |\bicaption@label|. +% \begin{macrocode} +\long\def\bicaption@getlabel#1\label#2#3\@nil{% + \def\@tempa{#2}% + \ifx\@tempa\@empty + \let\bicaption@label\relax + \else + \def\@tempb{*}% + \ifx\@tempa\@tempb + \def\bicaption@label{\label*}% + \bicaption@@getlabel#3\@nil + \else + \def\bicaption@label{\label}% + \bicaption@@getlabel{#2}#3\@nil + \fi + \fi} +% \end{macrocode} +% \begin{macrocode} +\long\def\bicaption@@getlabel#1#2\@nil{% + \def\@tempa{#1}% + \def\@tempb{[}% + \ifx\@tempa\@tempb + \bicaption@@@getlabel#1#2\@nil + \else + \l@addto@macro\bicaption@label{{#1}}% + \fi} +% \end{macrocode} +% \begin{macrocode} +\long\def\bicaption@@@getlabel[#1]#2\@nil{% + \l@addto@macro\bicaption@label{[{#1}]}% + \bicaption@@getlabel#2\@nil} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bicaption@setup} +% |\bicaption@setup|\marg{list-entry}\marg{text}\par +% Initiates the bilingual caption typesetting by storing the extra texts into +% |\bi|\-|caption@l|\-|entry| and |\bi|\-|caption@text|. +% \begin{macrocode} +\newcommand\bicaption@setup[2]{% + \def\bicaption@lentry{#1}% + \def\bicaption@text{\ignorespaces#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\caption@freeze} +% \changes{v1.0}{2011/08/31}{Redefinition of \cs{caption@freeze} added} +% To make |\bicaption| work inside |SCfigure| and |FPfigure| environments we need to add +% |\bi|\-|caption| to |\caption@freeze|. +% \begin{macrocode} +\AtBeginDocument{% + \ifx\caption@freeze\@undefined \else + \g@addto@macro\caption@freeze{% + \let\caption@frozen@bicaption\bicaption + \def\bicaption{% + \caption@withoptargs\caption@SC@bicaption}% + \long\def\caption@SC@bicaption#1#2{% + \@ifnextchar[%] + {\caption@SC@bi@caption{#1}{#2}}% + {\caption@SC@bi@caption@{#1}{#2}}}% + \long\def\caption@SC@bi@caption#1#2[#3]#4{% + \caption@@freeze{\bicaption#1{#2}[{#3}]{#4}}% + \ignorespaces}% + \long\def\caption@SC@bi@caption@#1#2#3{% + \caption@@freeze{\bicaption#1{#2}{#3}}% + \ignorespaces}% + \l@addto@macro\caption@warmup{% + \let\bicaption\caption@frozen@bicaption}}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bicaption@listof} +% Make commands like |\listoffigure2s| work. +% \begin{macrocode} +\def\bicaption@declarelist#1{\@namedef{listof#1}{\bicaption@listof#1}} +\@onlypreamble\bicaption@declarelist +\def\bicaption@listof#1 {\@nameuse{listof#1}} +% \end{macrocode} +% \begin{macrocode} +\caption@ifundefined\c@figure{}{\bicaption@declarelist{figure}} +\caption@ifundefined\c@table{}{\bicaption@declarelist{table}} +\caption@For{typelist}{\bicaption@declarelist{#1}} +% \end{macrocode} +% \begin{macrocode} % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx index b45b87679d7..f29890615e5 100644 --- a/Master/texmf-dist/source/latex/caption/caption.dtx +++ b/Master/texmf-dist/source/latex/caption/caption.dtx @@ -25,7 +25,7 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{3655} +% \CheckSum{3663} % % \iffalse %<*driver> @@ -220,14 +220,14 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2011/08/18 v3.2b Customizing captions (AR)] +\ProvidesPackage{caption}[2011/09/30 v3.2c Customizing captions (AR)] %\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}} % \end{macrocode} % % \subsection{Loading the kernel} % % \begin{macrocode} -\RequirePackage{caption3}[2011/08/01] % needs v1.3 or newer +\RequirePackage{caption3}[2011/08/30] % needs v1.4 or newer % \end{macrocode} % % \subsection{Check against incompatible document classes} @@ -368,7 +368,7 @@ \def\caption@within@default{#1}} \DeclareCaptionOptionNoValue{without}{\KV@caption@within{none}} % \end{macrocode} -% \begin{macro}{\caption@within} +% \begin{macro}{\caption@Within} % \changes{v3.1}{2007/12/21}{This macro added} % \begin{macrocode} \newcommand*\caption@Within[1]{\def\caption@type{#1}\KV@caption@DCT@within} @@ -384,6 +384,37 @@ {\caption@Warning{Configuration file #1.cfg not found}}} % \end{macrocode} % +% \begin{macro}{\caption@setparboxrestore} +% \changes{v3.2}{2010/11/07}{This macro added} +% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}} +% \begin{macrocode} +\newcommand*\caption@setparboxrestore[1]{% + \caption@ifinlist{#1}{full}{% + \caption@setfullparboxrestore + }{\caption@ifinlist{#1}{default,light,partial}{% + \let\caption@parboxrestore\@secondoftwo + }{% + \caption@Error{Undefined parboxrestore `#1'}% + }}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\caption@setfullparboxrestore} +% \changes{v3.2}{2010/11/07}{This macro added} +% |\caption@setfullparboxrestore|\par +% This is an abbreviation for |\caption@setparboxrestore{full}|. +% \begin{macrocode} +\newcommand*\caption@setfullparboxrestore{% + \let\caption@parboxrestore\@firstoftwo} +% \end{macrocode} +% \end{macro} +% +% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added} +% \begin{macrocode} +\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}} +\captionsetup{parboxrestore=default} +% \end{macrocode} +% % \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added} % \begin{macrocode} \DeclareCaptionOption{@minipage}{% @@ -729,6 +760,7 @@ % \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed} % \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added} % \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore} +% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} added} % Here comes our definition of |\caption| and |\caption*|. % Beside the support of the starred variant this code was adapted to the % various packages we support. @@ -740,21 +772,21 @@ \caption@iftype {\caption@checkgrouplevel\@empty\caption \caption@star - {\caption@refstepcounter\@captype}% + {\@nameuse{donemaincaptiontrue}% + \caption@refstepcounter\@captype}% {\caption@dblarg{\@caption\@captype}}}% {\caption@Error{\noexpand\caption outside float}% - \caption@withoptargs\@gobbletwo}} + \caption@gobble}} % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@star} % \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}} +% \changes{v3.2c}{2011/08/21}{\cs{global} removed} % A helper macro which processes the optional |*| after |\caption|. -% \Note{We set \cs{caption@startrue} globally so it works with the -% \package{sidecap} package, too.} % \begin{macrocode} \newcommand*\caption@star[2]{% - \@ifstar{\global\caption@startrue#2[]}{#1#2}} + \@ifstar{\caption@startrue#2[]}{#1#2}} % \end{macrocode} % \end{macro} % @@ -934,7 +966,12 @@ {\@dblarg{\Hy@tempa\@captype}}% }}% % \end{macrocode} -% +% \begin{macrocode} + \caption@CheckCommand\caption{% + % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class] + % \let\m@moldhypcaption\caption + \renewcommand{\caption}{\donemaincaptiontrue\m@moldhypcaption}}% +% \end{macrocode} % \begin{macrocode} \caption@IfCheckCommand{}{% \caption@InfoNoLine{% @@ -1510,6 +1547,7 @@ % \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}} % \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)} % \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now} +% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'} % This label will be used for |\currentlabel| inside (floating) environments % as default. (see above) % \iffalse\Note{All commands used have to be robust here.}\fi @@ -1519,7 +1557,7 @@ % \end{macrocode} % \begin{macrocode} \DeclareRobustCommand*\caption@xref[2]{% - \caption@WarningNoLine{\noexpand\label before \string\caption#2}% + \caption@WarningNoLine{\noexpand\label without proper \string\caption#2}% \@setref\relax\@undefined{#1}} % \end{macrocode} % \begin{macrocode} @@ -1530,19 +1568,24 @@ % \changes{v3.1b}{2007/09/22}{This macro and its usage added} % \changes{v3.1f}{2007/11/11}{Revised} % \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now} +% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too} % The new code of |\label| inside floating environments. % |\label| will be redefined using |\caption@withoptargs|, so % |#1| are the optional arguments (if any), and % |#2| is the mandatory argument here. % \begin{macrocode} -\newcommand*\caption@xlabel[1]{% - \caption@@xlabel - \def\caption@labelname{#1}% - \caption@x@label{#1}} +\newcommand*\caption@xlabel{% + \caption@withoptargs\caption@@xlabel} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@@xlabel{% - \global\let\caption@@xlabel\@empty +\newcommand*\caption@@xlabel[2]{% + \caption@@@xlabel + \def\caption@labelname{#2}% + \caption@x@label#1{#2}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@@xlabel{% + \global\let\caption@@@xlabel\@empty \@bsphack \protected@write\@auxout{}% {\string\providecommand*\string\caption@xref[2]{% @@ -1882,37 +1925,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\caption@setparboxrestore} -% \changes{v3.2}{2010/11/07}{This macro added} -% |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}} -% \begin{macrocode} -\newcommand*\caption@setparboxrestore[1]{% - \caption@ifinlist{#1}{full}{% - \let\caption@parboxrestore\@firstoftwo - }{\caption@ifinlist{#1}{default,light,partial}{% - \let\caption@parboxrestore\@secondoftwo - }{% - \caption@Error{Undefined parboxrestore `#1'}% - }}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@setfullparboxrestore} -% \changes{v3.2}{2010/11/07}{This macro added} -% |\caption@setfullparboxrestore|\par -% This is an abbreviation for |\caption@setparboxrestore{full}|. -% \begin{macrocode} -\newcommand*\caption@setfullparboxrestore{% - \let\caption@parboxrestore\@firstoftwo} -% \end{macrocode} -% \end{macro} -% -% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added} -% \begin{macrocode} -\DeclareCaptionOption{parboxrestore}{\caption@setparboxrestore{#1}} -\caption@setparboxrestore{default} -% \end{macrocode} -% % \begin{macro}{\caption@boxrestore} % \changes{v3.1}{2007/03/03}{This macro and its usage added} % \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added} @@ -1959,7 +1971,8 @@ % % \begin{macro}{\caption@boxrestore@mini} % \changes{v3.2}{2010/10/24}{This macro added} -% Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments. Will be used by \cs{setcaptiontype}. +% Resets \cs{par} so the very first \cs{par} in \cs{@caption} behaves quite the same as in floating environments. +% Will be used by \cs{setcaptiontype}. % \begin{macrocode} \newcommand\caption@boxrestore@mini{% \let\par\@@par @@ -2059,7 +2072,10 @@ % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now} % \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added} % \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added} -% Hook, will be used inside \cs{caption@setsubtype}. +% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added} +% Hook, will be used inside \cs{caption@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.) % \begin{macrocode} \newcommand*\caption@subtypehook{% \ifx\caption\caption@subcaption \else @@ -2070,7 +2086,7 @@ % no \caption or \subcaption in this (floating) environment yet \caption@Debug{Increment \@captype\ counter =\the\value\@captype}% \caption@l@stepcounter\@captype - \let\caption@@addcontentsline\caption@addsubcontentsline}% + \let\caption@@@addcontentsline\caption@addsubcontentsline}% % \end{macrocode} % \begin{macrocode} \ifnum\csname caption@c@\@captype\endcsname=\value\@captype \else @@ -2095,11 +2111,31 @@ % \begin{macrocode} \let\caption\caption@subcaption \let\phantomcaption\caption@subphantom - \let\@makecaption\caption@makecaption + \if@subfloatrow + \caption@Debug{Keeping \string\@makecaption}% + \else + \let\@makecaption\caption@makecaption + \fi \fi}% % \end{macrocode} % \end{macro} % +% \begin{macro}{\if@subfloatrow} +% \changes{v3.2c}{2011/09/30}{This macro added} +% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment. +% \begin{macrocode} +\caption@AtBeginDocument{% + \caption@ifundefined\@subfloatrowtrue + {\newif\if@subfloatrow + \caption@ifundefined\subfloatrow{}% + {\caption@Debug{Patching subfloatrow environment}% + \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}% + \g@addto@macro\killfloatstyle{% + \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}% + {\caption@Debug{\string\if@subfloatrow is already defined}}}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\caption@subcaption} % Makes a sub-caption. % \begin{macrocode} @@ -2129,7 +2165,7 @@ % \package{subfigure} \& \package{subfig} packages.} % \begin{macrocode} \let\caption@kernel@addcontentsline\caption@addcontentsline -\renewcommand*\caption@addcontentsline[2]{% +\renewcommand\caption@addcontentsline[2]{% \sf@ifpositiontop{\@listsubcaptions{#1}}{}% \caption@kernel@addcontentsline{#1}{#2}% \sf@ifpositiontop{}{\@listsubcaptions{#1}}% @@ -2148,18 +2184,19 @@ % \changes{v3.1i}{2008/08/02}{Bugfix 08-07-28: % \cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now} % \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now} +% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now} % Add a pending sub-caption list entry. % \begin{macrocode} \newcommand*\caption@addsubcontentsline[4]{% \begingroup - \let\label\@gobble \let\index\@gobble \let\glossary\@gobble + \let\label\caption@gobble \let\index\caption@gobble \let\glossary\caption@gobble \protected@edef\@tempa{\endgroup \noexpand\g@addto@macro\noexpand\caption@subcontentslines{% \noexpand\@namedef{the#2}{\csname the#2\endcsname}% \ifx\@currentHref\@undefined \else \noexpand\def\noexpand\@currentHref{\@currentHref}% \fi - \protect\caption@@addcontentsline{#1}{#2}{#3}{#4}}}% + \protect\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}% \@tempa} % \end{macrocode} % \end{macro} @@ -2434,113 +2471,111 @@ % \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed} % \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now} % \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised} +% \changes{v3.2c}{2011/08/21}{Revised} % |\caption@freeze|\par % Used by the \package{fltpage} \& \package{sidecap} package support. % \begin{macrocode} \newcommand*\caption@freeze{% - \global\let\caption@SCcontinued\relax - \global\let\caption@SCsetup\@undefined - \global\let\caption@SClentry\@undefined - \global\let\caption@SCtext\@undefined - \global\let\caption@SClabel\@undefined % \end{macrocode} % \begin{macrocode} \let\caption@frozen@ContinuedFloat\ContinuedFloat \def\ContinuedFloat{% \caption@withoptargs\caption@SC@ContinuedFloat}% \def\caption@SC@ContinuedFloat##1{% + \caption@@freeze{\ContinuedFloat##1}% \let\caption@frozen@setcounter\setcounter \let\caption@frozen@addtocounter\addtocounter \def\setcounter####1####2{\csname c@####1\endcsname####2\relax}% \def\addtocounter####1####2{\advance\csname c@####1\endcsname ####2\relax}% \caption@frozen@ContinuedFloat##1% - \global\let\caption@SCcontinued\caption@frozen@ContinuedFloat \let\setcounter\caption@frozen@setcounter \let\addtocounter\caption@frozen@addtocounter}% +% \end{macrocode} +% \begin{macrocode} \let\caption@frozen@setup\caption@setup \def\caption@setup##1{% - \caption@g@addto@list\caption@SCsetup{##1}% + \caption@@freeze{\caption@setup{##1}}% \caption@frozen@setup{##1}}% - \let\caption@frozen\caption +% \end{macrocode} +% \begin{macrocode} + \let\caption@frozen@caption\caption \def\caption{% - \def\caption{\caption@Error{% - Only one \noexpand\caption can be placed in this environment}}% - \let\captionsetup\caption@setup - \let\caption@@refstepcounter\caption@l@stepcounter - \caption@frozen}% - \let\caption@frozen@\@caption - \long\def\@caption##1[##2]##3{% -% \@bsphack - \gdef\caption@SClentry{##2}% - \gdef\caption@SCtext{##3}% - \let\@currentlabel\caption@SCcurrentlabel -% \@esphack}% + \def\caption{% + \caption@Error{% + Only one \noexpand\caption can be placed in this environment}% + \caption@gobble}% + \@ifstar + {\caption@SC@caption*}% + {\let\caption@frozen@refstepcounter\caption@@refstepcounter + \let\caption@@refstepcounter\caption@l@stepcounter + \caption@refstepcounter\@captype + \let\caption@@refstepcounter\caption@frozen@refstepcounter + \let\@currentlabel\caption@SClabel + \caption@withoptargs\caption@SC@caption}}% + \long\def\caption@SC@caption##1##2{% + \caption@@freeze{\caption##1{##2}}% \ignorespaces}% +% \end{macrocode} +% \begin{macrocode} \let\caption@frozen@label\label - \def\label##1{% - \ifx\@currentlabel\caption@SCcurrentlabel - \@bsphack\gdef\caption@SClabel{##1}\@esphack + \def\label{% + \caption@withoptargs\caption@SC@label}% + \def\caption@SC@label##1##2{% + \ifx\@currentlabel\caption@SClabel + \@bsphack + \caption@freeze@label{##1}{##2}% + \@esphack \else - \caption@frozen@label{##1}% + \caption@frozen@label##1{##2}% \fi}% - \def\caption@SCcurrentlabel{???}% + \def\caption@SClabel{\caption@undefinedlabel}% + \def\caption@freeze@label##1##2{% + \caption@@freeze{\label##1{##2}}}% % \end{macrocode} % \begin{macrocode} - }% + \global\let\caption@frozen@content\@empty + \long\def\caption@@freeze{% + \g@addto@macro\caption@frozen@content}% % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@warmup} -% \changes{v3.2a}{2011/08/17}{This macro added} -% |\caption@warmup| % \begin{macrocode} - \newcommand*\caption@warmup{% - \ifx\caption@frozen\@undefined\else + \def\caption@warmup{% + \let\ContinuedFloat\caption@frozen@ContinuedFloat \let\caption@setup\caption@frozen@setup - \let\caption\caption@frozen - \let\@caption\caption@frozen@ - \let\label\caption@frozen@label - \fi} + \let\caption\caption@frozen@caption + \let\label\caption@frozen@label}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@defrost} % \changes{v3.1}{2007/07/22}{This macro added} % \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added} +% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}} +% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed} % |\caption@defrost| % \begin{macrocode} \newcommand*\caption@defrost{% - \ifx\caption@frozen\@undefined - \caption@defrost@setup - \ifx\caption@SCtext\@undefined \else - \expandafter\expandafter\expandafter\caption - \expandafter\expandafter\expandafter[% - \expandafter\expandafter\expandafter{% - \expandafter\caption@SClentry\expandafter}\expandafter]% - \expandafter{\caption@SCtext}% - \fi - \ifx\caption@SClabel\@undefined \else - \expandafter\label\expandafter{\caption@SClabel}% - \fi + \ifx\caption@frozen@caption\@undefined + \caption@frozen@content \else \caption@Error{Internal Error:\MessageBreak \noexpand\caption@defrost in same group as \string\caption@freeze}% \fi}% % \end{macrocode} -% \begin{macrocode} - \newcommand*\caption@defrost@setup{% - \caption@SCcontinued - \ifx\caption@SCsetup\@undefined \else - \expandafter\captionsetup\expandafter{\caption@SCsetup}% - \fi}% -% \end{macrocode} % \end{macro} % % \begin{macrocode} - }{\let\caption@warmup\relax}% + }{}% \caption@undefbool{needfreeze}} % \end{macrocode} % +% \begin{macro}{\caption@warmup} +% \changes{v3.2a}{2011/08/17}{This macro added} +% |\caption@warmup| +% \begin{macrocode} +\let\caption@warmup\relax +% \end{macrocode} +% \end{macro} +% % \subsubsection{The float package} % \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved} % \iffalse @@ -2835,12 +2870,12 @@ % \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added} % Here we do two things: % \begin{enumerate} -% \item We use |\caption@setoptions{floating|\meta{type}|}| so -% |\captionsetup[floating|\meta{type}|]{|\ldots|}| is supported. -% \item |\linewidth| must be set correctly. -% Usually this is done by |\@parboxrestore| inside |\@caption|, -% but since we use |\@caption@boxrestore| we have to map this to -% |\@parboxrestore| instead. +% \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so +% |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported. +% \item |\line|\-|width| must be set correctly. +% Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|, +% but since we use |\@caption@box|\-|restore| we have to map this to +% |\@par|\-|box|\-|restore| instead. % \end{enumerate} % \begin{macrocode} \newcommand*\caption@floatflt[1]{% @@ -2855,33 +2890,6 @@ }{} % \end{macrocode} % -% \iffalse -% \subsubsection{The floatrow package} -% \changes{v3.0f}{2005/06/01}{Support of the \package{floatrow} package added} -% -% \begin{macrocode} -%\caption@IfPackageLoaded{floatrow}[2007/07/01 v0.1p]{% -% \end{macrocode} -% -% The \package{floatrow} package is already adapted for usage with -% \thispackage. So the main work has already been done by -% Mrs.~Lapko, there is only one little thing we have to take care about: -% -% \begin{macro}{\caption@of} -% Captions typeset with |\captionof| should have the correct layout, -% therefore we have to `activate' this layout here with |\flrow@setlist|. -% \begin{macrocode} -% \renewcommand*\caption@of[2]{% -% \flrow@setlist{{#2}}% TODO: always do this? -% \caption@settype*{#2}#1}% -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -%}{} -% \end{macrocode} -% \fi -% % \subsubsection{The fltpage package} % \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added} % @@ -2890,6 +2898,19 @@ \caption@setbool{needfreeze}{1}% % \end{macrocode} % +% \begin{macro}{\FP@positionLabel} +% \changes{v3.2c}{2011/08/28}{This redefinition added} +% Original code: +% \begin{verbatim} +% \newcommand{\FP@positionLabel}{% +% FP\@captype-\number\value{FP@\@captype C}-pos} +% \end{verbatim}%^^A +% \begin{macrocode} + \renewcommand\FP@positionLabel{% + FP\FP@captype-\number\value{FP@\FP@captype C}-pos}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\FP@helpNote} % Original code: % \begin{verbatim} @@ -2908,6 +2929,7 @@ % \begin{macro}{\FP@floatBegin} % \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now} % \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added} +% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}} % Original code: % \begin{verbatim} % \newcommand{\FP@floatBegin}[1]{% @@ -2928,19 +2950,22 @@ % \end{verbatim}%^^A % \begin{macrocode} \renewcommand*\FP@floatBegin[1]{% - \def\@captype{#1}% - \let\FP@LabelText\@empty + \def\FP@captype{#1}% \begin{lrbox}{\FP@floatCorpusBOX}% + \caption@settype*{#1}% \caption@freeze + \global\let\FP@Label\@empty \caption@ifFPrefcap {}% - {\def\label##1{\@bsphack\gdef\FP@LabelText{##1}\@esphack}}% + {\def\caption@freeze@label##1##2{% + \g@addto@macro\FP@Label{\FP@label##1{##2}}}}% \ignorespaces}% % \end{macrocode} % \end{macro} % % \begin{macro}{\FP@floatEnd} % \changes{v3.1g}{2008/01/30}{Some minor bugfixes} +% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}} % Original code: % \begin{verbatim} % \newcommand{\FP@floatEnd}{% @@ -2978,35 +3003,40 @@ \end{lrbox}% % \end{macrocode} % \begin{macrocode} - \stepcounter{FP@\@captype C}% + \stepcounter{FP@\FP@captype C}% \caption@label\FP@positionLabel - \FP@helpNote\@captype\FP@positionLabel + \FP@helpNote\FP@captype\FP@positionLabel % \end{macrocode} % \begin{macrocode} \edef\FP@RestoreCounter{% - \noexpand\setcounter{\@captype}{\the\value\@captype}% + \noexpand\setcounter{\FP@captype}{\the\value\FP@captype}% \noexpand\setcounter{ContinuedFloat}{\the\value{ContinuedFloat}}}% % \end{macrocode} % \begin{macrocode} \FP@float {\FP@positionLabel}% location label test - {\begin\@captype[p!]% + {\begin\FP@captype[p!]% \usebox\FP@floatCorpusBOX - \caption@defrost@setup + \let\caption@SClentry\@empty + \def\caption{\caption@dblarg{\@caption\@captype}}% + \long\def\@caption##1[##2]##3{\def\caption@SClentry{##2}}% + \let\FP@label\label + \let\label\caption@gobble + \caption@defrost \caption@ifFPlistcap {\caption@refstepcounter\@captype \expandafter\caption@makecurrent\expandafter\@captype \expandafter{\caption@SClentry}}% - {\expandafter\captionlistentry\expandafter{\caption@SClentry}}% + {\ifx\caption@SClentry\@empty \else + \expandafter\captionlistentry\expandafter{\caption@SClentry}% + \fi}% \caption@makeanchor\relax - \ifx\FP@LabelText\@empty \else - \expandafter\label\expandafter{\FP@LabelText}% - \fi - \end\@captype}% + \FP@Label + \end\FP@captype}% {\FP@RestoreCounter - \@ifundefined{theH\@captype}{}{% - \expandafter\l@addto@macro\csname theH\@captype\endcsname{.FP}}}% - {\begin\@captype[b!]% + \@ifundefined{theH\FP@captype}{}{% + \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}% + {\begin\FP@captype[b!]% \let\FP@savedSetfnumCommand\caption@setfnum \def\caption@setfnum##1{% \FP@savedSetfnumCommand{##1}% @@ -3019,7 +3049,7 @@ \FP@separatorCaption \caption@ifFPlistcap{}{\let\caption@addcontentsline\@gobbletwo}% \caption@defrost - \end\@captype}% + \end\FP@captype}% }% % \end{macrocode} % \end{macro} @@ -3044,21 +3074,27 @@ % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of % \cs{theHfigure} as indicator for \package{hyperref} package} % \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised} +% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added} % % \begin{macrocode} \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{% % Test if hyperref has stopped early - \caption@ifundefined\ifhyp@stoppedearly{% - \newif\ifhyp@stoppedearly - \caption@ifundefined\H@refstepcounter\hyp@stoppedearlytrue{% - \caption@ifundefined\hyper@makecurrent\hyp@stoppedearlytrue{% - \caption@ifundefined\measuring@true\hyp@stoppedearlytrue{}}}}{}% - \ifhyp@stoppedearly % hyperref has stopped early + \caption@ifundefined\IfHyperBoolean{% + \caption@set@bool\caption@ifhyp@stoppedearly0% + \caption@ifundefined\H@refstepcounter + {\caption@set@bool\caption@ifhyp@stoppedearly1}{% + \caption@ifundefined\hyper@makecurrent + {\caption@set@bool\caption@ifhyp@stoppedearly1}{% + \caption@ifundefined\measuring@true + {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}% + }{% + \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}% + }% + \caption@ifhyp@stoppedearly{% hyperref has stopped early \caption@InfoNoLine{% Hyperref support is turned off\MessageBreak because hyperref has stopped early}% - \else - % + }{% \g@addto@macro\caption@prepareslc{\measuring@true}% % \end{macrocode} % @@ -3318,7 +3354,7 @@ % \end{macro} % % \begin{macrocode} - \fi}{} + }}{} % \end{macrocode} % % \subsubsection{The hypcap package} @@ -3970,22 +4006,10 @@ % \subsubsection{The sidecap package} % % \begin{macrocode} -\caption@IfPackageLoaded{sidecap}[1999/05/11 v1.4d]{% +\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{% \caption@setbool{needfreeze}{1}% % \end{macrocode} % -% \begin{macro}{\SC@caption} -% \changes{v3.0d}{2004/11/28}{Bugfix: Definition of \cs{@captype} added} -% \changes{v3.0e}{2005/05/05}{Bugfix: Empty captions are handled correctly now} -% \changes{v3.0e}{2005/05/05}{Priority of options fixed} -% \changes{v3.0h}{2005/10/03}{Bugfix: Always use \cs{AtBeginDocument} to set \cs{SC@caption}} -% First of all, we let \package{sidecap} use a current definition of |\caption|.\\ -% (This is only required for version 1.5d of the \package{sidecap} package.) -% \begin{macrocode} - \caption@AtBeginDocument{\let\SC@caption=\caption}% -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\SC@zfloat} % \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added} % \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed} @@ -4061,11 +4085,10 @@ % \begin{macrocode} \def\caption@setSC@justify{% \caption@clearmargin - \caption@ifundefined\SC@justify{}{% \ifx\SC@justify\@empty \else \let\caption@hj\SC@justify \let\SC@justify\@empty - \fi}}% + \fi}% % \end{macrocode} % Make the original definition of |\endSC@FLOAT| to use our caption % stuff instead of its own. diff --git a/Master/texmf-dist/source/latex/caption/caption2.dtx b/Master/texmf-dist/source/latex/caption/caption2.dtx index 4df70ba1cf4..946a41e7969 100644 --- a/Master/texmf-dist/source/latex/caption/caption2.dtx +++ b/Master/texmf-dist/source/latex/caption/caption2.dtx @@ -25,7 +25,7 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{848} +% \CheckSum{853} % % \iffalse %<*driver> @@ -96,7 +96,7 @@ % the regular \package{caption} package. It was made public as beta test version % without documentation in 1995 because of the strong demand for new features and % adaptations to other packages like the \package{longtable} and -% \package{subfigure} package. +% \package{subfigure} one. % % But within the next years I found no time to reintegrate some of the % well-tried features into the regular \package{caption} package. So I @@ -204,7 +204,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption2}[2008/07/01 v2.2c Customising captions (AS)] +\ProvidesPackage{caption2}[2011/08/12 v2.2d Customising captions (AR)] % \end{macrocode} % % \changes{v2.2b}{2007/06/15}{Made obsolete warning even more annoying} @@ -337,7 +337,8 @@ % \begin{macrocode} \newcommand*\defcaptionstyle[1]{% \@namedef{caption@@#1}} -% +% \end{macrocode} +% \begin{macrocode} \newcommand*\newcaptionstyle[1]{% \expandafter\ifx\csname caption@@#1\endcsname\relax \expandafter\defcaptionstyle @@ -346,7 +347,8 @@ \expandafter\@gobbletwo \fi {#1}} -% +% \end{macrocode} +% \begin{macrocode} \newcommand*\renewcaptionstyle[1]{% \expandafter\ifx\csname caption@@#1\endcsname\relax \PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}% @@ -433,16 +435,12 @@ % \begin{macrocode} \newcommand*\caption@makecaption[1]{% \usecaptionmargin -% \end{macrocode} -% \begin{macrocode} \ifcaptionlabel \def\caption@label{% {\captionlabelfont\captionlabel\captionlabeldelim}\captionlabelsep}% \else \let\caption@label\@empty \fi -% \end{macrocode} -% \begin{macrocode} \captionfont \onelinecaption {\caption@label\captiontext}% @@ -739,9 +737,9 @@ % (like \textsf{ucthesis}), so we do it here if not already done. % \changes{v2.1}{2002/02/19}{\cs{abovecaptionskip} and \cs{belowcaptionskip} will be defined if neccessary} % \begin{macrocode} -\@ifundefined{abovecaptionskip}{% +\caption@ifundefined\abovecaptionskip{% \newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{} -\@ifundefined{belowcaptionskip}{% +\caption@ifundefined\belowcaptionskip{% \newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{} % \end{macrocode} % \end{macro} @@ -817,7 +815,7 @@ % \changes{v2.2}{2007/04/06}{\cs{let}\cs{caption@make}\cs{caption@makecaption} added} % \begin{macrocode} \newcommand*\usecaptionstyle[1]{% - \@ifundefined{captiontext}{% + \caption@ifundefined\captiontext{% \PackageError{caption2}{You can't use \protect#1 in normal text}{The usage of \protect#1 is only allowed inside code declared with\MessageBreak \protect\defcaptionstyle, @@ -980,7 +978,7 @@ \renewcommand*\caption@of[2]{\def\@captype{#2}% \@ifundefined{fst@#2}{}{% \@nameuse{fst@#2}% - \@ifundefined{@float@setevery}{}{\@float@setevery{#2}}% + \caption@ifundefined\@float@setevery{}{\@float@setevery{#2}}% \let\caption@fs@capt\@fs@capt \let\@fs@capt\caption@of@float}% #1} @@ -1068,7 +1066,7 @@ % into v2.1 of the \textsf{subfigure} package) we define it first. % \begin{macrocode} \newcommand*\setsubcapstyle{% - \@ifundefined{subcapraggedrightfalse}{% + \caption@ifundefined\subcapraggedrightfalse{% \newif\ifsubcapraggedright}{}% \ifsubcaphang \ifsubcapcenter diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx index cf6d48a3072..84fe9ad6ca6 100644 --- a/Master/texmf-dist/source/latex/caption/caption3.dtx +++ b/Master/texmf-dist/source/latex/caption/caption3.dtx @@ -25,12 +25,12 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{4127} +% \CheckSum{4248} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{caption3.drv}[2011/08/06 v1.3 Implementation of the caption kernel] +\ProvidesFile{caption3.drv}[2011/10/09 v1.4 Implementation of the caption kernel] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % @@ -200,7 +200,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2011/08/18 v1.3b caption3 kernel (AR)] +\ProvidesPackage{caption3}[2011/10/09 v1.4 caption3 kernel (AR)] % \end{macrocode} % % \subsection{Generic helpers} @@ -462,6 +462,16 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\caption@gobble} +% \changes{v1.4}{2011/08/19}{This macro added} +% |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\par +% Same as |\@gobble|, but gobbles optional arguments as well. +% \begin{macrocode} +\DeclareRobustCommand*\caption@gobble{% + \caption@withoptargs\@gobbletwo} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\caption@CheckCommand} % \changes{v1.1}{2007/04/10}{This macro added} % \begin{macro}{\caption@IfCheckCommand} @@ -914,6 +924,7 @@ % \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added} % \changes{v1.2a}{2008/01/12}{\cs{captionsetup@starfalse} added} % \changes{v1.2d}{2009/09/30}{Bugfix 09-09-29: Missing error handler will be defined automatically} +% \changes{v1.4}{2011/08/24}{Redefinition of \cs{XKV@err} added} % |\caption@setkeys|\oarg{package}\marg{family}\marg{key-values}\par % This one simply calls |\setkeys|\marg{family}\marg{key-values} % but lets the error messages not refer to the \package{keyval} package, @@ -928,13 +939,17 @@ % \begin{macrocode} \expandafter\let\csname ORI@KV@err\caption@keydepth\endcsname\KV@err \expandafter\let\csname ORI@KV@errx\caption@keydepth\endcsname\KV@errx + \expandafter\let\csname ORI@XKV@err\caption@keydepth\endcsname\XKV@err + \edef\caption@keydepth{\caption@keydepth i}% +% \end{macrocode} +% \begin{macrocode} \expandafter\let\expandafter\KV@err\csname #1@KV@err\endcsname \ifx\KV@err\relax \def\KV@err##1{\PackageError{#1}{##1}{% See the #1 package documentation for explanation.}}% \fi - \let\KV@errx\KV@err - \edef\caption@keydepth{\caption@keydepth i}% + \def\KV@errx{\KV@err}% + \def\XKV@err{\let\@tempa\XKV@tkey\KV@err}% % \end{macrocode} % \begin{macrocode} \caption@Debug{\protect\setkeys{#2}{#3}}% @@ -944,6 +959,7 @@ \edef\caption@keydepth{\expandafter\@gobble\caption@keydepth}% \expandafter\let\expandafter\KV@err\csname ORI@KV@err\caption@keydepth\endcsname \expandafter\let\expandafter\KV@errx\csname ORI@KV@errx\caption@keydepth\endcsname + \expandafter\let\expandafter\XKV@err\csname ORI@XKV@err\caption@keydepth\endcsname % \end{macrocode} % \begin{macrocode} \ifx\caption@keydepth\@empty \captionsetup@starfalse \fi @@ -1737,8 +1753,10 @@ % \end{macrocode} % \end{macro} % -% There are two pre-defined text formats, called `simple' and `period'. +% There are three pre-defined text formats, called `empty', `simple' and `period'. +% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added} % \begin{macrocode} +\DeclareCaptionTextFormat{empty}{} \DeclareCaptionTextFormat{simple}{#1} \DeclareCaptionTextFormat{period}{#1.} % \end{macrocode} @@ -2254,6 +2272,36 @@ % \end{macrocode} % \end{macro} % +% \changes{v1.4}{2011/08/30}{Option \opt{listtype=} added} +% \changes{v1.4}{2011/08/30}{Option \opt{listtype+=} added} +% \begin{macrocode} +\DeclareCaptionOption{listtype}{\caption@setlisttype{#1}} +\DeclareCaptionOption{listtype+}{\caption@setlisttype@ext{#1}} +% \end{macrocode} +% +% \begin{macro}{\caption@setlisttype} +% \changes{v1.4}{2011/08/30}{This macro added} +% |\caption@setlisttype|\marg{type} +% \begin{macrocode} +\newcommand*\caption@setlisttype{% + \caption@setlisttype@ext{}% + \caption@@setlisttype\caption@listtype} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@setlisttype[2]{% + \edef#1{#2}% + \ifx#1\@empty \let#1\@undefined \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\caption@setlisttype@ext} +% \changes{v1.4}{2011/08/30}{This macro added} +% |\caption@setlisttype@ext|\marg{type extension} +% \begin{macrocode} +\newcommand*\caption@setlisttype@ext{% + \caption@@setlisttype\caption@listtype@ext} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\DeclareCaptionListFormat} % \changes{v1.1}{2004/07/15}{This macro added} % \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}} @@ -2635,7 +2683,9 @@ % \begin{macro}{\caption@ifthesisclass} % \begin{macrocode} \providecommand*\caption@ifthesisclass{% - \caption@ifundefined\cph@font{\@gobble}{\caption@ifundefined\cpb@font\@gobble\@firstofone}} + \caption@ifundefined\cph@font + {\@gobble}% + {\caption@ifundefined\cpb@font\@gobble\@firstofone}} % \end{macrocode} % \end{macro} % @@ -2823,30 +2873,57 @@ % \changes{v1.1}{2007/07/01}{This macro added} % \changes{v1.3}{2010/10/26}{Error check added} % \changes{v1.3}{2011/06/24}{Split into two macros} +% \changes{v1.4}{2011/08/19}{Split into three macros} +% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added} % |\caption@addcontentsline|\marg{type}\marg{list entry}\par % Makes an entry in the list-of-whatever, if requested, % i.e.~the argument \meta{list entry} is not empty and % |listof=| was set to |true|. % \begin{macrocode} -\newcommand*\caption@addcontentsline[2]{% +\newcommand\caption@addcontentsline[2]{% + \caption@ifcontentsline{#2}{% + \begingroup + \let\@tempa\@gobble + \caption@ifundefined\caption@listtype + {\edef\caption@listtype{#1}}% + {\let\@tempa\@firstofone}% + \caption@ifundefined\caption@listtype@ext + {}% + {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}% + \let\@tempa\@firstofone}% + \@tempa + {\caption@Debug{addcontentsline: #1 => \caption@listtype}% +% \caption@setoptions*\caption@listtype + \@namedef{the\caption@listtype}{\@nameuse{the#1}}}% + \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}% + \endgroup}} +% \end{macrocode} +% \begin{macrocode} +\newcommand\caption@@addcontentsline[2]{% + {\let\\\space + \@ifundefined{ext@#1}% + {\caption@Error{No float type '#1' defined}}% + {\caption@@@addcontentsline + {\csname ext@#1\endcsname}% + {#1}% + {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}% + {\ignorespaces #2}}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@@addcontentsline[4]{% + \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand\caption@ifcontentsline[1]{% \caption@iflist - {\def\@tempa{#2}}% + {\def\@tempa{#1}}% {\let\@tempa\@empty}% - \ifx\@tempa\@empty \else - {\let\\\space - \@ifundefined{ext@#1}% - {\caption@Error{No float type '#1' defined}}% - {\caption@@addcontentsline - {\csname ext@#1\endcsname}% - {#1}% - {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}% - {\ignorespaces #2}}}% + \ifx\@tempa\@empty + \expandafter\@gobble + \else + \expandafter\@firstofone \fi} % \end{macrocode} -% \begin{macrocode} -\newcommand*\caption@@addcontentsline[4]{% - \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} -% \end{macrocode} % \end{macro} % % \subsection{Typesetting the caption} @@ -3072,7 +3149,7 @@ % Re-define anything which would disturb the single-line-check. % \begin{macrocode} \newcommand*\caption@prepareslc{% - \def\label{\caption@withoptargs\@gobbletwo}% + \let\label\caption@gobble % \end{macrocode} % \begin{macrocode} \let\caption@footnote@ORI\footnote @@ -3313,14 +3390,7 @@ \caption@setkeys[caption]{caption@DCT}{#1}% % \end{macrocode} % \begin{macrocode} - \caption@ifundefined\float@exts{\newtoks\float@exts}{}% - \let\float@do=\relax - \edef\@tempa{\noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#2}}}}% - \@tempa - \caption@ifundefined\float@addtolists{% - \newcommand\float@addtolists[1]{% - \def\float@do####1{\addtocontents{####1}{##1}}\the\float@exts}% - \caption@ifundefined\@chapter{}{\caption@PatchChapter}}{}% + \expandafter\caption@DeclareTypeExt\expandafter{\@nameuse{ext@#2}}{#2}% % \end{macrocode} % \begin{macrocode} \@ifnextchar[\@@DeclareCaptionType\relax} @@ -3343,28 +3413,79 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\caption@DeclareTypeExt} +% \changes{v1.4}{2011/10/02}{Support of the tocbasic package added} +% \changes{v1.4}{2011/10/02}{Support of the titletoc package added} +% \begin{macrocode} +\newcommand*\caption@DeclareTypeExt[2]{% + \caption@ifundefined\@chapter\relax\caption@PatchChapter + \let\caption@PatchChapter\relax +% \end{macrocode} +% \begin{macrocode} + \@ifundefined{caption@ext@#1}{% + \@namedef{caption@ext@#1}{#2}% +% \end{macrocode} +% Support of \package{float} package\par +% TODO: Needs revision +% \begin{macrocode} + \caption@ifundefined\float@exts{\newtoks\float@exts}{}% + \let\float@do=\relax + \edef\@tempa{\noexpand\float@exts{\the\float@exts\float@do{#1}}}% + \@tempa + \caption@ifundefined\caption@addtolists{% + \newcommand\caption@addtolists[1]{% + \def\float@do####1{\addtocontents{####1}{##1}}\the\float@exts}}{}% +% \end{macrocode} +% Support of \package{tocbasic} package +% \begin{macrocode} + \caption@ifundefined\addtotoclist{}{% + \addtotoclist[float]{#1}% + \setuptoc{#1}{chapteratlist}% + \@namedef{listof#1name}{\list#2name}}% +% \end{macrocode} +% \begin{macrocode} + }{}% +% \end{macrocode} +% Support of \package{titletoc} package +% \begin{macrocode} + \caption@ifundefined\contentsuse{}{% + \contentsuse{#2}{#1}}% +% \end{macrocode} +% \begin{macrocode} +} +\@onlypreamble\caption@DeclareTypeExt +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\caption@within@default} % \changes{v1.2b}{2008/04/13}{This macro added} % The default `within' value. % \begin{macrocode} -\newcommand*\caption@within@default{\caption@ifundefined\c@chapter{none}{chapter}} +\newcommand*\caption@within@default{% + \caption@ifundefined\c@chapter{none}{chapter}} \@onlypreamble\caption@within@default % \end{macrocode} % \end{macro} % % \begin{macro}{\caption@listof} % \changes{v1.2}{2007/12/21}{This macro added} +% \changes{v1.4}{2011/10/02}{Support of \cs{listoftoc} added} % |\caption@listof|\marg{float type} % \begin{macrocode} -\newcommand*\caption@listof[1]{% - \begingroup - \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname - \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname - \let\caption@ORI@starttoc\@starttoc - \renewcommand*\@starttoc[1]{% - \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}% - \listoffigures - \endgroup} +\caption@ifundefined\listoftoc{% + \newcommand*\caption@listof[1]{% + \begingroup + \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname + \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname + \let\caption@ORI@starttoc\@starttoc + \renewcommand*\@starttoc[1]{% + \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}% + \listoffigures + \endgroup}% +}{% + \newcommand*\caption@listof[1]{% + \expandafter\listoftoc\expandafter{\@nameuse{ext@#1}}}% +} % \end{macrocode} % \end{macro} % @@ -3452,8 +3573,7 @@ % % \begin{macro}{\caption@PatchChapter} % \changes{v1.2b}{2008/08/02}{This macro added} -% We try to patch \cs{@chapter} so \cs{float@addtolists} will be supported. -% (Note: The \KOMAScript\ classes already support \cs{float@addtolists}.) +% We try to patch \cs{@chapter} so \cs{caption@addtolists} will be supported. % \begin{macrocode} \newcommand*\caption@PatchChapter{% \providecommand*\@chapterlistsgap{10\p@}% @@ -3491,7 +3611,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \if@twocolumn \@topnewpage[\@makechapterhead{##2}]% @@ -3541,7 +3661,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \if@twocolumn \@topnewpage[\@makechapterhead{##2}]% @@ -3577,7 +3697,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \@makechapterhead{##2}\@afterheading}% % \end{macrocode} @@ -3620,7 +3740,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \if@twocolumn \@topnewpage[\@makechapterhead{##2}]% @@ -3670,7 +3790,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \if@twocolumn \@topnewpage[\@makechapterhead{##2}]% @@ -3742,7 +3862,7 @@ \ifdim \@chapterlistsgap>\z@ \addtocontents{lof}{\protect\addvspace{\@chapterlistsgap}}% \addtocontents{lot}{\protect\addvspace{\@chapterlistsgap}}% - \float@addtolists{\protect\addvspace{\@chapterlistsgap}}% + \caption@addtolists{\protect\addvspace{\@chapterlistsgap}}% \fi \if@twocolumn \@topnewpage[\@makechapterhead{##2}]% @@ -3833,6 +3953,7 @@ % \changes{v1.2a}{2008/03/11}{Bugfix: \cs{subfigurename} will be defined now} % \changes{v1.2d}{2009/10/09}{Bugfix 08-10-01: Usage of \cs{caption@addtoreset} added} % \changes{v1.3}{2011/01/01}{\cs{@dottedlofline} will be defined \& used now} +% \changes{v1.4}{2011/10/09}{Support of the titletoc package added} % |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\ % |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par % The starred variant provides the numbering format @@ -3863,6 +3984,11 @@ \@cons\caption@subtypelist{{#3}}}% {\caption@Debug{Modify caption `sub#3'}}% % \end{macrocode} +% Support of \package{titletoc} package +% \begin{macrocode} + \caption@ifundefined\contentsuse{}{% + \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}% +% \end{macrocode} % \begin{macrocode} \@namedef{sub#3name}{}% \@namedef{sub#3autorefname}{\csname #3name\endcsname}% diff --git a/Master/texmf-dist/source/latex/caption/ltcaption.dtx b/Master/texmf-dist/source/latex/caption/ltcaption.dtx index 6dae5f9edf0..10a1deb075b 100644 --- a/Master/texmf-dist/source/latex/caption/ltcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/ltcaption.dtx @@ -25,7 +25,7 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{343} +% \CheckSum{347} % % \iffalse %<*driver> @@ -451,7 +451,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{ltcaption}[2011/01/01 v1.2a longtable captions (AR)] +\ProvidesPackage{ltcaption}[2011/09/12 v1.3 longtable captions (AR)] % \end{macrocode} % % \begin{macrocode} @@ -518,13 +518,20 @@ % \begin{macro}{\CaptionTextFont} % These commands are provided by the \package{NTG} document classes. % To make this package work with other document classes as well, -% we need to define |\CaptionLabelFont| \& |\CaptionTextFont| here. +% we need to define |\Caption|\-|Label|\-|Font| \& |\Caption|\-|Text|\-|Font| here. % \begin{macrocode} \providecommand*\CaptionLabelFont{} \providecommand*\CaptionTextFont{} % \end{macrocode} % \end{macro} % \end{macro} +% \begin{macro}{\CaptionTextFont} +% \changes{v1.3}{2011/09/12}{This macro added} +% Additionally, we define |\Caption|\-|Label|\-|Separator| which is predefined as colon. +% \begin{macrocode} + \providecommand*\CaptionLabelSeparator{:} +% \end{macrocode} +% \end{macro} % % \begin{macrocode} } @@ -614,6 +621,7 @@ % \changes{v1.1}{2007/04/20}{\cs{LT@@makecaption} added} % \changes{v1.1}{2007/06/27}{Adapted to the \package{floatrow} package by Olga Lapko} % \changes{v1.2}{2007/03/28}{Uses \cs{LTcapskip} instead of \cs{baselineskip} now} +% \changes{v1.3}{2011/09/12}{Usage of \cs{CaptionLabelSeparator} added} % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par % \smallskip % Original code: @@ -635,9 +643,10 @@ % \begin{macrocode} \renewcommand\LT@makecaption[3]{% \LT@@makecaption{% - \sbox\@tempboxa{#1{{\CaptionLabelFont#2:} }\CaptionTextFont#3}% + \sbox\@tempboxa{% + #1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3}% \ifdim\wd\@tempboxa>\hsize - #1{\CaptionLabelFont{#2:} }\CaptionTextFont#3% + #1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3% \else \hbox to\hsize{\hfil\box\@tempboxa\hfil}% \fi diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx index 27226210f65..9727cbd4b57 100644 --- a/Master/texmf-dist/source/latex/caption/subcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx @@ -25,12 +25,12 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{139} +% \CheckSum{149} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{subcaption.drv}[2011/08/17 v1.1 Adds a sub-caption feature to the caption package] +\ProvidesFile{subcaption.drv}[2011/08/29 v1.1 Adds a sub-caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -201,7 +201,7 @@ % \item Environmental `sub' settings % {\small(|\captionsetup[subfigure|\emph{ -or- }|subtable]{|\ldots|}|)} % \item Local `sub' settings -% {\small(|\captionsetup{|\ldots|}| inside |subfigure| or |subtable|)} +% {\small(|\captionsetup{|\ldots|}| inside |sub|\-|figure| or |sub|\-|table|)} % \end{enumerate} % An example: % \begin{quote} @@ -210,7 +210,7 @@ % |\captionsetup[table]{textfont=it,position=top}|\\ % |\captionsetup[subtable]{textfont=sf}| % \end{quote} -% causes the captions inside |subtable| environments to be typeset with +% causes the captions inside |sub|\-|table| environments to be typeset with % the settings % \begin{quote} % |indention=10pt,position=top,margin=0pt,font=small,|\\ @@ -281,12 +281,12 @@ % % \DescribeEnv{subfigure} % \DescribeEnv{subtable} -% After loading \thispackage\ the new environments |subfigure| and -% |subtable| are available, which have the same (optional \& mandatory) -% arguments as the |minipage| environment. +% After loading \thispackage\ the new environments |sub|\-|figure| and +% |sub|\-|table| are available, which have the same (optional \& mandatory) +% arguments as the |mini|\-|page| environment. % Inside these environments you use the ordinary |\caption| command % for typesetting captions. So this example is the same as the last one, -% but uses the |subfigure| environment: +% but uses the |sub|\-|figure| environment: % \begin{quote} % |\begin{figure}|\\ % | \begin{|\textcolor{blue}{\texttt{subfigure}}|}[b]{.5\linewidth}|\\ @@ -300,11 +300,11 @@ % | \caption{A figure}\label{fig:1}|\\ % |\end{figure}| % \end{quote} -% Using the |subfigure| or |subtable| environment instead of |\subcaption| +% Using the |sub|\-|figure| or |sub|\-|table| environment instead of |\subcaption| % has two advantages: % \begin{itemize} % \item You can override the setttings for a specific subcaption -% with a |\captionsetup| inside the |subfigure| or |subtable| environment, e.g.: +% with a |\caption|\-|setup| inside the |sub|\-|figure| or |sub|\-|table| environment, e.g.: % \begin{quote} % \ldots\\ % |\begin{subfigure}[b]{.5\linewidth}|\\ @@ -327,7 +327,7 @@ % environments with |\set|\-|caption|\-|sub|\-|type| as first contents line. % These environments are defined with the help of % |\caption@For{subtypelist}|, which executes code for every sub-type -% declared with |\DeclareCaptionSubType|. +% declared with |\Declare|\-|Caption|\-|Sub|\-|Type|. % \end{background} % % \PageBreak @@ -363,7 +363,7 @@ % Using |\sub|\-|caption|\-|box|, the baseline of the resulting box will be placed % right between contents and heading, so usually you don't have to care about the % vertical alignment of the sub-figures for yourself. -% Also the hyperlink anchor is placed properly with respect to the |hypcap=| +% Also the hyperlink anchor is placed properly with respect to the |hyp|\-|cap=| % setting. % % One example: @@ -395,7 +395,7 @@ % As you see the result is not satisfying; % the caption below the cat looks ugly because of the small width of the % graphic. This can be solved by using the optional arguments of -% |\caption|\-|box|, increasing the width of the resulting box: +% |\sub|\-|caption|\-|box|, increasing the width of the resulting box: % \begin{quote} % | |\ldots\\ % | \subcaptionbox{A cat\label{cat}}|\\ @@ -417,7 +417,7 @@ % Furthermore the main caption, which is centered with respect to the % |\text|\-|width|, looks mis-aligned with respect to the sub-captions. % This can (again) be solved by using the optional arguments of -% |\caption|\-|box|, giving both boxes the same width, for example: +% |\sub|\-|caption|\-|box|, giving both boxes the same width, for example: % \begin{quote} % | |\ldots\\ % | \subcaptionbox{A cat\label{cat}}|\\ @@ -666,14 +666,14 @@ % \noindent\begin{minipage}{\linewidth} % \setcaptiontype{figure} % \centering -% \begin{overpic}[width=60pt]{cat} +% {\begin{overpic}[width=60pt]{cat} % \put(40,34){(a)} % \end{overpic} -% {\phantomsubcaption\label{cat6.3}} -% \begin{overpic}[width=.4\textwidth]{elephant} +% \phantomsubcaption\label{cat6.3}} +% {\begin{overpic}[width=.4\textwidth]{elephant} % \put(60,50){(b)} % \end{overpic} -% {\phantomsubcaption\label{elephant6.3}} +% \phantomsubcaption\label{elephant6.3}} % \captionsetup{subrefformat=parens} % \caption{Two animals: \subref{cat6.3} a huge cat, and \subref{elephant6.3} an elephant} % \end{minipage} @@ -883,7 +883,7 @@ % \subsection{Identification} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{subcaption}[2011/08/18 v1.1a Adding subcaptions (AR)] +\ProvidesPackage{subcaption}[2011/09/12 v1.1b Sub-captions (AR)] % \end{macrocode} % % \subsection{Initial code} @@ -892,6 +892,13 @@ % \begin{macrocode} \RequirePackage{caption}[2011/08/18] % needs v3.2b or newer % \end{macrocode} +% \changes{v1.1b}{2011/09/01}{Compatibility error added} +% \begin{macrocode} +\caption@AtBeginDocument{\caption@ifcompatibility{% + \caption@Error{% + The `subcaption' package does not work correctly\MessageBreak + in compatibility mode}}{}} +% \end{macrocode} % % Since we are incompatible to them an error message will be issued when % the \package{subfigure} or \package{subfig} package is loaded. @@ -949,7 +956,7 @@ \caption@iftype {\setcaptionsubtype*\caption}% {\caption@Error{\noexpand\subcaption outside float}% - \caption@withoptargs\@gobbletwo}}% + \caption@gobble}}% % \end{macrocode} % But with a prefacing |\set|\-|caption|\-|sub|\-|type|, |\sub|\-|caption| is simply % |\caption|. @@ -1031,15 +1038,22 @@ % \end{macrocode} % % \begin{macro}{\subcaption@label} +% \changes{v1.1b}{2011/09/12}{Redefinition of \cs{SK@} added} +% \changes{v1.1b}{2011/09/12}{Uses \cs{caption@withoptargs} now} % When a label will be placed for a sub-caption, we automatically place % a second one for |\subref|, too. This second label will contain % the sub-type counter only. % \begin{macrocode} -\newcommand*\subcaption@label[1]{% +\newcommand*\subcaption@label{ + \caption@withoptargs\subcaption@@label} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\subcaption@@label[2]{% \@bsphack\begingroup - \subcaption@ORI@label{#1}% + \subcaption@ORI@label#1{#2}% + \let\SK@\@gobbletwo \protected@edef\@currentlabel{\csname thesub\@captype\endcsname}% - \subcaption@ORI@label{sub@#1}% + \subcaption@ORI@label#1{sub@#2}% \endgroup\@esphack} % \end{macrocode} % \end{macro} -- cgit v1.2.3