diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-09 00:39:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-09 00:39:21 +0000 |
commit | 60cbc8437dcfde310f54a43fd254865ec7e5296a (patch) | |
tree | 119dc082348b649e2fa1fb8eb6ba90639fe764df /Master/texmf-dist/source/latex/caption | |
parent | 7e39ebb4ceedd3a7699e90140504b8373cdf26cf (diff) |
caption (8jan13)
git-svn-id: svn://tug.org/texlive/trunk@28765 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/caption')
-rw-r--r-- | Master/texmf-dist/source/latex/caption/bicaption.dtx | 219 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption-deu.tex | 12 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption-eng.tex | 12 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption-rus.tex | 11 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption.dtx | 636 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption.ins | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption2.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption3.dtx | 298 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/newfloat.dtx | 112 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/subcaption.dtx | 79 |
10 files changed, 880 insertions, 503 deletions
diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx index fb3d58f932d..fdfe5a62602 100644 --- a/Master/texmf-dist/source/latex/caption/bicaption.dtx +++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx @@ -2,7 +2,7 @@ % % This is file `bicaption.dtx'. % -% Copyright (C) 2010-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 2010-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -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".F +% This work has the LPPL maintenance status "maintained". % % This Current Maintainer of this work is Axel Sommerfeldt. % @@ -25,12 +25,12 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{369} +% \CheckSum{385} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{bicaption.drv}[2011/10/30 v1.0 Adds a bilingual caption feature to the caption package] +\ProvidesFile{bicaption.drv}[2012/12/26 v1.1 Adds a bilingual caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -61,8 +61,8 @@ \ifpdf\usepackage{hypdestopt}\fi \hypersetup{pdfkeywords={LaTeX, package, bicaption},pdfstartpage={},pdfstartview={}} % -\usepackage{bicaption}[2010/09/01] -\usepackage{subcaption}[2010/09/01] +\usepackage{bicaption}[2012/12/26] +\usepackage{subcaption}[2012/04/09] % \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}} \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}} @@ -73,7 +73,6 @@ \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}} \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} \newcommand*\version[2][]{$v#2$} -\newcommand*\x{\discretionary{}{}{}} % \usepackage{marvosym} \makeatletter @@ -140,6 +139,7 @@ % \section{The user interface} % % \subsection{Loading the package} +% \label{sec:loading} % % \DescribeMacro{\usepackage} % This package will be loaded by @@ -159,7 +159,12 @@ % |\captionsetup[bi-second]|\marg{options}\quad. % \end{quote} % +% When used with the \package{babel} or \package{polyglossia} package, the +% \package{bicaption} package should be loaded \emph{after} it, so the main +% language will be set automatically. See \autoref{sec:babel} for details. +% % \subsection{Setting options} +% \label{sec:options} % % \DescribeMacro{\captionsetup} % \begin{quote} @@ -186,7 +191,7 @@ % % \bigskip % -% Options specified with |\usepackage[|\ldots|]{bi|\-|caption}| and +% Options specified with |\use|\-|package[|\ldots|]{bi|\-|caption}| and % |\caption|\-|setup[bi|\ldots|]{|\ldots|}| will override the ones specified by % |\caption|\-|setup{|\ldots|}| and |\caption|\-|setup[fig|\-|ure]{|\ldots|}| % (same for `table'). So finally we have the following order how @@ -217,7 +222,19 @@ % |labelsep=quad,indention=10pt,position=top,labelfont=bf|~. % \end{quote} % +% \bigskip +% +% To limit |bi|, |bi-first|, or |bi-second| options to specific environments one can use +% multiple optional arguments for |\caption|\-|setup|, e.g.: +% \begin{quote} +% |\captionsetup[figure][bi-first]|\oarg{options} +% \end{quote} +% will limit the settings to the first heading of |figure| environments only. +% Please note that the environment name has to be specified as first optional argument +% while the bilingual selection as second one. +% % \subsection{Additional options} +% \label{sec:additional-options} % % These options are available additional to the ones offered by the % \package{caption} package: @@ -228,8 +245,8 @@ % Sets the language of the caption, e.g. % \begin{quote}|\use|\-|package|\-|[lang=eng|\-|lish]{bi|\-|caption}|\end{quote} % will typeset the second caption of bilingual captions in English. -% (The language will be set with |\select|\-|language| internally, -% so the \package{babel} package must be loaded for using this option.) +% (The language will be set with |\select|\-|caption|\-|language| internally, +% see \autoref{sec:babel} for details.) % % \item[bi-lang=] % \DescribeMacro{bi-lang=} @@ -258,6 +275,7 @@ % \end{Options} % % \subsection{The \cs{bicaption} commands} +% \label{sec:bicaption} % % \DescribeMacro\bicaption % Bilingual captions will be typeset by @@ -320,6 +338,7 @@ % % \PageBreak % \subsection{A sample document} +% \label{sec:example} % % \begin{quote} % |\documentclass[english,ngerman]{article}|\\ @@ -517,6 +536,7 @@ % % \PageBreak % \subsection{Customising lists} +% \label{sec:lists} % % \DescribeMacro{list=} % As default both caption texts will be insert into the List of Figures resp. List of Tables. @@ -593,8 +613,9 @@ % |\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 \DeclareFloatingEnvironment|\\ +% |% Note: Loading titletoc should be done prior|\\ +% |% defining additional floating environments with|\\ +% |% \DeclareFloatingEnvironment|\\ % |\usepackage{titletoc}|\\ % ||\\ % |\usepackage{newfloat}|\\ @@ -630,6 +651,64 @@ % |\end{document}| % \end{quote} % +% \subsection{Language Selection} +% \label{sec:babel} +% +% For language selection \thispackage\ uses two macros internally: +% +% \medskip +% +% \DescribeMacro\captionmainlanguage +% |\caption|\-|main|\-|lan|\-|guage| contains the main language, e.g. |english| or |german|. +% If not set prior to loading \thispackage, \thispackage\ will try to obtain this setting from +% the \package{babel} or \package{polyglossia} package. +% +% So if you are using either \package{babel} or \package{polyglossia}, and want to adopt +% the main language setting from it, then just load \thispackage\ \emph{after} it, +% and simply forget about the |\caption|\-|main|\-|lan|\-|guage| stuff. +% +% Otherwise one can either define |\caption|\-|main|\-|lan|\-|guage| prior to +% loading \thispackage, e.g.: +% \begin{quote} +% |\newcommand\captionmainlanguage{french}|\\ +% |\usepackage|\oarg{options}|{bicaption}| +% \end{quote} +% Or one can specify the main language via |\caption|\-|setup| after loading \thispackage, e.g.: +% \begin{quote} +% |\usepackage|\oarg{options}|{bicaption}|\\ +% |\captionsetup[bi-first]{lang=french}| +% \end{quote} +% When not using the \package{babel} or \package{polyglossia} package both approaches +% will have exactly the same effect. +% But when using the \package{babel} or \package{polyglossia} package, and one want to +% specify the main caption language manually, the first approach is preferable since +% defining |\caption|\-|main|\-|lan|\-|guage| will suppress the automatic detection mechanism. +% +% \medskip +% +% \DescribeMacro\selectcaptionlanguage +% |\select|\-|caption|\-|lan|\-|guage| will be used internally to select the language: +% \begin{quote} +% |\selectcaptionlanguage|\marg{font-or-list-entry}\marg{language} +% \end{quote} +% For setting the language of the caption \meta{font-or-list-entry} will be |\@first|\-|of|\-|two|, +% for setting the language of the list entry \meta{font-or-list-entry} will be +% |\@second|\-|of|\-|two|.~\footnote{\cs{@firstoftwo} and \cs{@secondoftwo} are defined +% in the \LaTeX\ kernel and simply pick either the 1st or 2nd argument.} +% It defaults to |\select@lan|\-|guage| (caption) resp.~|\select|\-|lan|\-|guage| (list entry) +% offered by the \package{babel} and \package{polyglossia} package: +% \begin{quote} +% |\providecommand*\selectcaptionlanguage[2]{%|\\ +% | #1{\select@language}{\selectlanguage}{#2}}| +% \end{quote} +% If you need to alter this, just either define |\select|\-|caption|\-|lan|\-|guage| prior +% loading \thispackage, or redefine it afterwards. +% +% \medskip +% +% Please note that all of this will only be relevant if the |lang=| option will be used. +% Otherwise |\select|\-|caption|\-|lan|\-|guage| won't be used by \thispackage\ at all. +% % \iffalse % --------------------------------------------------------------------------- % % \fi @@ -715,10 +794,10 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{bicaption}[2011/10/30 v1.0a Bilingual Captions (AR)] +\ProvidesPackage{bicaption}[2012/12/26 v1.1 Bilingual Captions (AR)] % \end{macrocode} % \begin{macrocode} -\RequirePackage{caption}[2011/08/28] % needs v3.2c or newer +\RequirePackage{caption}[2012/12/26] % needs v3.3 or newer % \end{macrocode} % \changes{v1.0}{2011/09/01}{Compatibility error added} % \begin{macrocode} @@ -733,6 +812,24 @@ % \pagebreak[3] % \subsection{Initial code} % +% \begin{macro}{\bicaption@Info} +% |\bicaption@Info|\marg{message} +% \begin{macrocode} +\newcommand*\bicaption@Info[1]{% + \PackageInfo{bicaption}{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\bicaption@InfoNoLine} +% |\bicaption@InfoNoLine|\marg{message}\par +% \Note{The \cs{@gobble} at the end of the 2nd argument of +% \cs{PackageInfo} suppresses the line number info. +% See TLC2\cite{TLC2}, A.4.7, p885 for details.} +% \begin{macrocode} +\newcommand*\bicaption@InfoNoLine[1]{% + \PackageInfo{bicaption}{#1\@gobble}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\bicaption@Warning} % |\bicaption@Warning|\marg{message} % \begin{macrocode} @@ -751,6 +848,7 @@ See the bicaption package documentation for explanation.} % \end{macrocode} % \end{macro} +% % \begin{macro}{\bicaption@Error} % |\bicaption@Error|\marg{message} % \begin{macrocode} @@ -809,23 +907,19 @@ % % \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} +% \changes{v1.1}{2012/04/09}{Support of \cs{selectcaptionlanguage} added} +% Set the language (stored in |\bi|\-|caption@lan|\-|guage|) +% via |\select|\-|bi|\-|caption|\-|lan|\-|guage|. % \begin{macrocode} -\newcommand*\bicaption@select@language[1]{% +\newcommand*\bicaption@selectlanguage[1]{% \caption@ifundefined\bicaption@language{}{% - \expandafter#1\expandafter{\bicaption@language}}} + \expandafter\selectcaptionlanguage\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\@firstoftwo} % \end{macrocode} % \begin{macrocode} \g@addto@macro\caption@prepareslc{% @@ -833,6 +927,15 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\selectcaptionlanguage} +% |\selectcaptionlanguage|\marg{font-or-list-entry}\marg{language} +% will finally be used to set up the language. +% \begin{macrocode} +\providecommand*\selectcaptionlanguage[1]{% + #1\select@language\selectlanguage} +% \end{macrocode} +% \end{macro} +% % \pagebreak[3] % \subsection{Execution of options} % @@ -843,17 +946,25 @@ % % Set the language for the first caption. % \begin{macrocode} -\ifcsname bbl@main@language\endcsname - \edef\@tempa{\noexpand\captionsetup[bi-first]{lang=\bbl@main@language}} - \@tempa +\ifcsname captionmainlanguage\endcsname + \bicaption@InfoNoLine{main language is set to \captionmainlanguage} +\else\ifcsname bbl@main@language\endcsname + \bicaption@InfoNoLine{babel found, main language is \bbl@main@language} + \let\captionmainlanguage\bbl@main@language \else\ifcsname xpg@main@language\endcsname - \edef\@tempa{\noexpand\captionsetup[bi-first]{lang=\xpg@main@language}} - \@tempa + \bicaption@InfoNoLine{polyglossia found, main language is \xpg@main@language} + \let\captionmainlanguage\xpg@main@language \else - \bicaption@WarningNoLine{Please load this package after the babel package} -\fi\fi + \bicaption@InfoNoLine{main language is not set} +\fi\fi\fi % \end{macrocode} -% We use |\caption@ProcessOptions| here to add the options to the `|bi-second|' option +% \begin{macrocode} +\ifcsname captionmainlanguage\endcsname + \edef\@tempa{\noexpand\captionsetup[bi-first]{lang=\captionmainlanguage}} + \@tempa +\fi +% \end{macrocode} +% We use |\caption@Process|\-|Options| here to add the options to the `|bi-second|' option % list instead of executing them immediately. % \begin{macrocode} \caption@SetupOptions{bicaption}{\captionsetup[bi-second]{#2}}% @@ -863,16 +974,18 @@ % \pagebreak[3] % \subsection{Main code} % -% \begin{macro}{\caption@kernel@addcontentsline} +% \begin{macro}{\caption@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. +% \changes{v1.0b}{2012/01/15}{\cs{caption@kernel@addcontentsline} changed to \cs{caption@addcontentsline}} +% We patch |\caption@add|\-|contents|\-|line| (of the \package{caption} package kernel) +% so |bi|\-|caption@add|\-|contents|\-|line| will be used for bilingual captions instead. % \begin{macrocode} -\let\caption@kernel@addcontentsline@ORI\caption@kernel@addcontentsline -\renewcommand*\caption@kernel@addcontentsline[2]{% +\let\bicaption@addcontentsline@ORI\caption@addcontentsline +\renewcommand*\caption@addcontentsline[2]{% \caption@ifundefined\bicaption@lentry - {\caption@kernel@addcontentsline@ORI{#1}{#2}}% - {\expandafter\bicaption@addcontentsline\expandafter{\bicaption@lentry}{#1}{#2}% + {\bicaption@addcontentsline@ORI{#1}{#2}}% + {\expandafter\bicaption@addcontentsline\expandafter + {\bicaption@lentry}{#1}{#2}% \global\let\bicaption@lentry\@undefined}} % \end{macrocode} % \end{macro} @@ -880,7 +993,7 @@ % \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}. +% Typeset both captions using the original version of |\caption@add|\-|contents|\-|line|. % \begin{macrocode} \newcommand\bicaption@addcontentsline[3]{% \begingroup @@ -913,20 +1026,21 @@ % \begin{macrocode} \newcommand*\bicaption@@addcontentsline[2]{% \caption@ifcontentsline{#2}{% - \bicaption@selectlanguage\relax - \caption@kernel@addcontentsline@ORI{#1}{#2}}} + \bicaption@selectlanguage\@secondoftwo + \bicaption@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. +% We patch |\caption@@make| (of the \package{caption} package kernel) +% so |\bi|\-|caption@@make| will be used for bilingual captions instead. % \begin{macrocode} \let\caption@@make@ORI\caption@@make \renewcommand\caption@@make[2]{% \caption@ifundefined\bicaption@text {\caption@@make@ORI{#1}{#2}}% - {\expandafter\bicaption@@make\expandafter{\bicaption@text}{#1}{#2}% + {\expandafter\bicaption@@make\expandafter + {\bicaption@text}{#1}{#2}% \global\let\bicaption@text\@undefined}} % \end{macrocode} % \end{macro} @@ -945,10 +1059,8 @@ % \begin{macrocode} \ifnum\bicaption@lang=0\relax \bicaption@ifslc - {\caption@@slc{#2}{#3}{\captionwidth}{}% - {\caption@set@bool\caption@ifslc0}% - \caption@@slc{#2}{#1}{\captionwidth}{}% - {\caption@set@bool\caption@ifslc0}}% + {\caption@slc{#2}{#3}{}{\KV@caption@singlelinecheck0}% + \caption@slc{#2}{#1}{}{\KV@caption@singlelinecheck0}}% {}% \fi % \end{macrocode} @@ -1045,7 +1157,7 @@ % % \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|. +% Gets the label command out of the (first) caption text and stores it to |\bi|\-|caption@label|. % \begin{macrocode} \long\def\bicaption@getlabel#1\label#2#3\@nil{% \def\@tempa{#2}% @@ -1134,6 +1246,13 @@ % \end{macrocode} % \end{macro} % +% \begin{thebibliography}{9} +% \bibitem{TLC2} +% Frank Mittelbach and Michel Goossens:\\ +% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)}, +% \newblock Addison-Wesley, 2004. +% \end{thebibliography} +% % \iffalse %</package> % \fi diff --git a/Master/texmf-dist/source/latex/caption/caption-deu.tex b/Master/texmf-dist/source/latex/caption/caption-deu.tex index 451a55b6db4..f3e88f0dc9a 100644 --- a/Master/texmf-dist/source/latex/caption/caption-deu.tex +++ b/Master/texmf-dist/source/latex/caption/caption-deu.tex @@ -1,7 +1,7 @@ % % This is file `caption-deu.tex'. % -% Copyright (C) 1994-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -2750,6 +2750,7 @@ Beschriftung für Abbildungen und Tabellen, die die gesamte Seitenhöhe einnehmen, an. Hierbei wird die Beschriftung ans Ende der vorherigen oder nächsten Seite verschoben.} +\iffalse \NEWfeature{v3.1} Zwei Optionen regeln die Verweise auf die Umgebungen |FPfigure| und |FPtable|: \begin{description} @@ -2764,6 +2765,7 @@ oder \cs{nameref} plazierten Referenzen auf die Beschriftung der Abbildung bzw.~Tabelle verweisen, auf "`|figure|"' gesetzt auf den Inhalt der Abbildung. (Die Vorbelegung ist |FP|\-|ref=|\x|figure|.) \end{description} +\fi Spezielle Einstellungen für die Umgebungen |FPfigure| und |FPtable| können mit \begin{quote} @@ -3314,8 +3316,9 @@ Prof.~Dr.~Dirk Hoffmann, Frank Martini, Danie Els, Philipp Woock, -Fadi Semmo und -Matthias Stevens +Fadi Semmo, +Matthias Stevens und +Leo Liu für ihre Hilfe beim stetigen Verbessern dieses Paketes bedanken. % --------------------------------------------------------------------------- % @@ -3372,8 +3375,10 @@ Option & Kurzbeschreibung & Abschnitt \\ |figureposition|\preambleoption & gibt einen Hinweis auf die Position & \ref{skips} \\ |font|(|+|) & wählt den Zeichensatz & \ref{fonts} \\ |format| & wählt das Format & \ref{formats} \\ +\iffalse |FPlist| & Wohin soll der Listeneintrag einer FPfigure zeigen? & \ref{fltpage} \\ |FPref| & Wohin soll ein |\ref| einer FPfigure zeigen? & \ref{fltpage} \\ +\fi |hangindent| & setzt den "`hängenden"' Einzug & \ref{margins} \\ |hypcap| & wählt das "`hypcap"' Feature aus & \ref{hyperref} \\ |hypcapspace| & setzt den Abstand über einem Hyperlink & \ref{hyperref} \\ @@ -4015,7 +4020,6 @@ aktuellen Entsprechungen: |isu| & |format=hang|\\ |center| & |justification=centering|\\ |centerlast| & |justification=centerlast|\\ -%|anne| & |justification=centerlast|\\ |nooneline| & |singlelinecheck=off|\\ |scriptsize| & |font=scriptsize|\\ |footnotesize| & |font=footnotesize|\\ diff --git a/Master/texmf-dist/source/latex/caption/caption-eng.tex b/Master/texmf-dist/source/latex/caption/caption-eng.tex index 0893e216c9f..381d745be3e 100644 --- a/Master/texmf-dist/source/latex/caption/caption-eng.tex +++ b/Master/texmf-dist/source/latex/caption/caption-eng.tex @@ -1,7 +1,7 @@ % % This is file `caption-eng.tex'. % -% Copyright (C) 1994-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -2660,6 +2660,7 @@ caption for |figure|s or |table|s which needs the whole page for its contents. This will be done by placing the caption on the bottom of the previous or next page.} +\iffalse \NEWfeature{v3.1} Two options control the links to the environments |FPfigure| and |FPtable|: \begin{description} @@ -2672,6 +2673,7 @@ If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref} will link to the caption; if set to |figure|, it will link to the figure contents. (The default setting is |FP|\-|ref=|\x|figure|.) \end{description} +\fi If you want to setup special options for the |FPfigure| and |FPtable| environments you can use @@ -3183,8 +3185,9 @@ Prof.~Dr.~Dirk Hoffmann, Frank Martini, Danie Els, Philipp Woock, -Fadi Semmo, and -Matthias Stevens +Fadi Semmo, +Matthias Stevens, and +Leo Liu who all helped to make this package a better one. % --------------------------------------------------------------------------- % @@ -3241,8 +3244,10 @@ Option & Short description & Section \\ |figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\ |font|(|+|) & sets the font & \ref{fonts} \\ |format| & sets the format & \ref{formats} \\ +\iffalse |FPlist| & To where the list entry of a FPfigure should link? & \ref{fltpage} \\ |FPref| & To where a |\ref| to a FPfigure should link? & \ref{fltpage} \\ +\fi |hangindent| & sets the hang indention & \ref{margins} \\ |hypcap| & selects `hypcap' feature & \ref{hyperref} \\ |hypcapspace| & sets the distance between hyperlink and contents & \ref{hyperref} \\ @@ -3851,7 +3856,6 @@ they have been replaced within this version of \thispackage: |isu| & |format=hang|\\ |center| & |justification=centering|\\ |centerlast| & |justification=centerlast|\\ -%|anne| & |justification=centerlast|\\ |nooneline| & |singlelinecheck=off|\\ |scriptsize| & |font=scriptsize|\\ |footnotesize| & |font=footnotesize|\\ diff --git a/Master/texmf-dist/source/latex/caption/caption-rus.tex b/Master/texmf-dist/source/latex/caption/caption-rus.tex index a7fc44a3479..8bf60c425c4 100644 --- a/Master/texmf-dist/source/latex/caption/caption-rus.tex +++ b/Master/texmf-dist/source/latex/caption/caption-rus.tex @@ -635,13 +635,11 @@ % An example: Using the options Ïðèìåð: ñ~îïöèÿìè êëþ÷åé \begin{quote} - |format=plain,labelformat=parens,labelsep=quad,|\\ - | figurename=\CYRR\cyri\cyrs\cyru\cyrn\cyro\cyrk| + |format=plain,labelformat=parens,labelsep=quad| \end{quote} % gives captions like this one: ñîçäà¸òñÿ òàêàÿ ïîäïèñü: - \example{format=plain,labelformat=parens,labelsep=quad, - figurename=\CYRR\cyri\cyrs\cyru\cyrn\cyro\cyrk}{\exampletext} + \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext} \end{Example} [Íàçâàíèå â~íóìåðàöèîííîì çàãîëîâêå äëÿ äàííîãî ïðèìåðà èçìåíåíî ñ~ïîìîùüþ îïöèè |figurename|. \See{\Ref{names}}] @@ -3902,6 +3900,7 @@ extension} äëÿ Ñïèñêà, «|tbp|» êàê îïöèÿ ðàçìåùåíèÿ \meta{placement} |figure| èëè |table|, ñîäåðæèìîå êîòîðûõ çàíèìàåò öåëóþ ñòðàíèöó. Ïîäïèñü ïðè ýòîì ðàçìåùàåòñÿ íà ïðåäûäóùåé èëè ñëåäóþùåé ñòðàíèöå [íà ðàçâîðîòå].} +\iffalse \NEWfeature{v3.1} % Two options control the links to the environments |FPfigure| and |FPtable|: Ñëåäóþùèå êëþ÷è êîíòðîëèðóþò ññûëêè íà îêðóæåíèÿ |FPfigure| è~|FPtable|: @@ -3923,6 +3922,7 @@ extension} äëÿ Ñïèñêà, «|tbp|» êàê îïöèÿ ðàçìåùåíèÿ \meta{placement} áóäóò ïðèâÿçàíû ê~ïîäïèñè; à~åñëè |figure| \cdash--- òî ê~ñîäåðæèìîìó ôëîòà. (Çíà÷åíèå ïî óìîë÷àíèþ |FPref=figure|.) \end{description} +\fi % If you want to setup special options for the |FPfigure| and |FPtable| % environments you can use @@ -4787,10 +4787,12 @@ who all helped to make this package a better one.} |font|(|+|) & çàäà¸ò øðèôò & \ref{fonts} \\ % |format| & sets the format & \ref{formats} \\ |format| & çàäà¸ò ôîðìàò & \ref{formats} \\ +\iffalse % |FPlist| & to where the list entry of a FPfigure should link? & \ref{fltpage} \\ |FPlist| & ê~÷åìó ïðèâÿçûâàòü FPfigure â~Ñïèñêå ôëîòîâ? & \ref{fltpage} \\ % |FPref| & to where a |\ref| to a FPfigure should link? & \ref{fltpage} \\ |FPref| & ê~÷åìó ïðèâÿçûâàòü |\ref| äëÿ FPfigure? & \ref{fltpage} \\ +\fi % |hangindent| & sets the hang indention & \ref{margins} \\ |hangindent| & \cell{çàäà¸ò âòÿæêó [íà âåñó;\\ ñîîòâåòñòâóåò êîìàíäå \cs{hangindent}]} & \ref{margins} \\ % |hypcap| & select `hypcap' feature & \ref{hyperref} \\ @@ -5762,7 +5764,6 @@ who all helped to make this package a better one.} |isu| & |format=hang|\\ |center| & |justification=centering|\\ |centerlast| & |justification=centerlast|\\ -%|anne| & |justification=centerlast|\\ |nooneline| & |singlelinecheck=off|\\ |scriptsize| & |font=scriptsize|\\ |footnotesize| & |font=footnotesize|\\ diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx index e60749285e8..84af747aa8d 100644 --- a/Master/texmf-dist/source/latex/caption/caption.dtx +++ b/Master/texmf-dist/source/latex/caption/caption.dtx @@ -2,7 +2,7 @@ % % This is file `caption.dtx'. % -% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -21,16 +21,16 @@ % This work consists of the files caption.ins, caption.dtx, caption2.dtx, % caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx, % the derived files caption.sty, caption2.sty, caption3.sty, -% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty, + % bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty, % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{3545} +% \CheckSum{3475} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{caption.drv}[2011/08/06 v3.2 Implementation of the caption package] +\ProvidesFile{caption.drv}[2012/12/26 v3.3 Implementation of the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % @@ -54,7 +54,7 @@ \ifpdf\usepackage{hypdestopt}\fi \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}} % -\usepackage[debug]{caption}[2010/09/01] +\usepackage[debug]{caption}[2013/01/01] % \DeclareRobustCommand*\eTeX{\texorpdfstring {\leavevmode\hbox{$\varepsilon$}-\TeX}% @@ -86,8 +86,6 @@ % \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}} % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} % \newcommand*\version[2][]{\textit{v#2}} -% \newcommand*\x{\discretionary{-}{}{}} -% \newcommand*\xx{\discretionary{}{}{}} % % \GetFileInfo{caption.drv} % \let\docdate\filedate @@ -220,14 +218,14 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2012/02/19 v3.2f Customizing captions (AR)] +\ProvidesPackage{caption}[2013/01/06 v3.3 Customizing captions (AR)] %\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}} % \end{macrocode} % % \subsection{Loading the kernel} % % \begin{macrocode} -\RequirePackage{caption3}[2011/08/30] % needs v1.4 or newer +\RequirePackage{caption3}[2012/12/26] % needs v1.5 or newer % \end{macrocode} % % \subsection{Check against incompatible document classes} @@ -303,15 +301,12 @@ % % \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added} % \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written} -% \changes{v3.1f}{2007/11/18}{Options \opt{figurename} and \opt{tablename} are now -% available after the document preamble, too.} % \changes{v3.1f}{2007/11/18}{Option \opt{name} added} % \begin{macrocode} \DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}} \@onlypreamble@key{caption}{figurename} \DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}} \@onlypreamble@key{caption}{tablename} -\DeclareCaptionOption{name}{\caption@setname\@captype{#1}} % \end{macrocode} % % \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added} @@ -335,6 +330,13 @@ \caption@NewFloat{\newfloat@setname{#1}{#2}}} \@onlypreamble\caption@SetName % \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\DeclareCaptionOption{name}{\caption@setname\@captype{#1}} +% \end{macrocode} +% \begin{macro}{\caption@setname} +% |\caption@setname|\marg{float}\marg{name} % \begin{macrocode} \newcommand*\caption@setname[2]{% \@namedef{#1name}{#2}} @@ -407,6 +409,27 @@ {\caption@Warning{Configuration file #1.cfg not found}}} % \end{macrocode} % +% \begin{macro}{\caption@selectlistentry} +% \changes{v3.2}{2010/11/07}{This macro added} +% |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}} +% \begin{macrocode} +\newcommand*\caption@selectlistentry[1]{% + \caption@ifinlist{#1}{heading}{% + \let\caption@iflistheading\@firstoftwo + }{\caption@ifinlist{#1}{default,list-entry,entry}{% + \let\caption@iflistheading\@secondoftwo + }{% + \caption@Error{Undefined list-entry selection `#1'}% + }}} +% \end{macrocode} +% \end{macro} +% +% \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added} +% \begin{macrocode} +\DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}} +\captionsetup{list-entry=default} +% \end{macrocode} +% % \begin{macro}{\caption@setparboxrestore} % \changes{v3.2}{2010/11/07}{This macro added} % |\caption@setparboxrestore|\marg{\purett{partial} or \purett{full}} @@ -470,9 +493,6 @@ \DeclareCaptionOptionNoValue*{center}{% \caption@setformat{plain}% \caption@setjustification{centering}} -\DeclareCaptionOptionNoValue*{anne}{% - \caption@setformat{plain}% - \caption@setjustification{centerlast}} \DeclareCaptionOptionNoValue*{centerlast}{% \caption@setformat{plain}% \caption@setjustification{centerlast}} @@ -778,12 +798,37 @@ % % \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}} % +% \begin{macro}{\ifcaption@caption} +% \changes{v3.3}{2011/12/28}{This switch added} +% \begin{macro}{\ifcaption@subcaption} +% \changes{v3.3}{2011/12/28}{This switch added} +% \begin{macro}{\ifcaption@ContinuedFloat} +% \changes{v3.3}{2011/12/28}{This switch added} +% Since we support continued floats and sub-figures it's not an easy task +% to manage the figure (and table) counter. (Especially since previous versions +% of the caption package has proven that correcting a counter locally is not a good idea.) +% +% These three switches hold the +% current status: |\if|\-|caption@caption| is set if the caption was already +% typeset (so the counter doesn't need to be incremented for sub-figures), +% |\if|\-|caption@sub|\-|caption| is set if there is already content which have +% incremented the counter (so the counter doesn't need to be incremented +% for the main caption, further sub-figures, and other stuff), and +% |\if|\-|caption@Continued|\-|Float| is set if |\Continued|\-|Float| was given. +% \begin{macrocode} +\newif\ifcaption@caption +\newif\ifcaption@subcaption +\newif\ifcaption@ContinuedFloat +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\caption@caption} % \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added} % \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} from \textsf{memoir} document class 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. @@ -795,8 +840,7 @@ \caption@iftype {\caption@checkgrouplevel\@empty\caption \caption@star - {\@nameuse{donemaincaptiontrue}% - \caption@refstepcounter\@captype}% + {\caption@refstepcounter\@captype}% {\caption@dblarg{\@caption\@captype}}}% {\caption@Error{\noexpand\caption outside float}% \caption@gobble}} @@ -820,6 +864,7 @@ % \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now} % \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class} % \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}} +% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package} % As above, our version has been adapted to the packages we support. % Additionally our code is nested by |\caption@beginex| \& % |\caption@end| instead of |\begingroup| \& |\endgroup|. @@ -836,6 +881,7 @@ \ifcaption@star \else \caption@prepareanchor{#1}{#2}% \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}% + \@nameuse{nag@hascaptiontrue}% \fi % \end{macrocode} % \begin{macrocode} @@ -868,7 +914,7 @@ % \begin{macrocode} \newcommand*\caption@prepareanchor[2]{% \caption@makecurrent{#1}{#2}% - \caption@ifhypcap\caption@@start{}% + \caption@ifhypcap\caption@@start\relax \M@gettitle{#2}} % \end{macrocode} % \end{macro} @@ -898,8 +944,8 @@ % are well known, so documents written in the old (\package{caption} % package \version{1.x}) days (where |\caption| \& |\@caption| were not % redefined by us) will still compile fine. -% For example the usage of the \package{captcont} package, which brings -% it's own definition of |\caption*|, was quite common these days. +% For example the usage of the (now obsolete) \package{captcont} package, +% which brings its own definition of |\caption*|, was quite common these days. % \begin{macrocode} \newcommand*\caption@redefine{} \g@addto@macro\caption@redefine{% @@ -942,7 +988,7 @@ % \begin{macrocode} \caption@CheckCommand\caption{% % float.sty [2001/11/08 v1.3d Float enhancements (AL)] - \renewcommand\caption{% + \long\def\caption{% \ifx\@captype\@undefined \@latex@error{\noexpand\caption outside float}\@ehd \expandafter\@gobble @@ -1003,7 +1049,7 @@ \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}}% + \long\def\caption{\donemaincaptiontrue\m@moldhypcaption}}% % \end{macrocode} % \begin{macrocode} \caption@IfCheckCommand{}{% @@ -1046,6 +1092,16 @@ % % \begin{macrocode} \caption@CheckCommand\@caption{% + % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class] + \long\def\@caption#1[#2]#3{% + \MNR@old@caption{#1}[{#2}]{#3}% + \def\@currentlabelname{#2}% + \M@gettitle{#2}% + }}% +% \end{macrocode} +% +% \begin{macrocode} + \caption@CheckCommand\@caption{% % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system] \long\def\@caption#1[#2]#3{% \csname par\endcsname @@ -1469,18 +1525,26 @@ % \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced} % \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added} % \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}} +% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added} % |\caption@settype*|\marg{type}\par % sets |\@captype| and executes the options associated with it -% (using |\caption@setoptions|). -% Furthermore we check |\currentgrouplevel| (if avail), +% (using |\caption@set|\-|options|). +% Furthermore we check |\current|\-|group|\-|level| (if avail), % redefine |\@currentlabel| so a |\label| before |\caption| will result % in a hint instead of a wrong reference, and -% use the macro |\caption@|(|sub|)|typehook| (which will be used by our +% use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our % \package{float} package support).\par % The non-starred version sets a \package{hyperref} anchor additionally -% (if |hypcap=true| and the \package{hypcap} package is not loaded). +% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded). % \begin{macrocode} \newcommand*\caption@settype{% + \global\caption@captionfalse + \global\caption@subcaptionfalse + \global\caption@ContinuedFloatfalse + \caption@set@type} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@set@type{% \caption@@settype{}} % \end{macrocode} % \begin{macrocode} @@ -1518,7 +1582,6 @@ \fi % \end{macrocode} % \begin{macrocode} - \let\caption@ifrefstepcounter\@secondoftwo #2{}{% \let\@currentlabel\caption@undefinedlabel % \let\@currentHlabel\@undefined @@ -1677,43 +1740,43 @@ % \begin{macro}{\captionbox} % \changes{v3.2}{2010/12/17}{This macro added} % \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}} +% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}} % A |\parbox| with contents and caption, separated by an invisible |\hrule|. % \begin{macrocode} \newcommand*\captionbox{% - \let\captionbox@settype\@gobble - \caption@withoptargs\caption@box} + \caption@withoptargs{\caption@ibox\@gobble}} % \end{macrocode} % \begin{macrocode} -\newcommand\caption@box[2]{% - \@testopt{\caption@ibox{#1}{#2}}{\wd\@tempboxa}} +\newcommand\caption@ibox[3]{% + \@testopt{\caption@iibox{#1}{#2}{#3}}{\wd\@tempboxa}} % \end{macrocode} % \begin{macrocode} -\long\def\caption@ibox#1#2[#3]{% - \@testopt{\caption@iibox{#1}{#2}{#3}}\captionbox@hj@default} +\long\def\caption@iibox#1#2#3[#4]{% + \@testopt{\caption@iiibox{#1}{#2}{#3}{#4}}\captionbox@hj@default} % \end{macrocode} % \begin{macrocode} -\long\def\caption@iibox#1#2#3[#4]#5{% - \setbox\@tempboxa\hbox{#5}% +\long\def\caption@iiibox#1#2#3#4[#5]#6{% + \setbox\@tempboxa\hbox{#6}% \begingroup - \captionbox@settype*% set \caption@position + #1*% set \caption@position \caption@iftop{% \endgroup - \parbox[t]{#3}{% - \captionbox@settype\relax + \parbox[t]{#4}{% + #1\relax \caption@setposition t% - \vbox{\caption#1{#2}}% + \vbox{\caption#2{#3}}% \captionbox@hrule - \csname caption@hj@#4\endcsname + \csname caption@hj@#5\endcsname \unhbox\@tempboxa}% }{% \endgroup - \parbox[b]{#3}{% - \captionbox@settype\relax + \parbox[b]{#4}{% + #1\relax \caption@setposition b% - \csname caption@hj@#4\endcsname + \csname caption@hj@#5\endcsname \unhbox\@tempboxa \captionbox@hrule - \vtop{\caption#1{#2}}}% + \vtop{\caption#2{#3}}}% }} % \end{macrocode} % \begin{macrocode} @@ -1739,26 +1802,21 @@ % Bugfix: \cs{newcounter} replaced by \cs{newcount}} % \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed} % \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added} -% \changes{v3.1g}{2008/01/29}{Starred variant and hook \cs{sf@ContinuedFloat} added} +% \changes{v3.1g}{2008/01/29}{Starred variant added} % \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed} +% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now} % |\ContinuedFloat|\\ % |\ContinuedFloat*|\par -% This mainly decrements the appropriate counter and increments the -% continuation counter instead. -% Furthermore we set |\caption@resetContinuedFloat| to |\@gobble| so the -% continuation counter will not be reset to zero inside |\caption@refstepcounter|. -% Please forget about the optional argument, it was never working well, is -% incompatible to the \package{subfig} package, but is still there for -% compatibility reasons. -% \Note{The definition of \cs{ContinuedFloat} itself is compatible -% to the one inside the \package{subfig} package, except for the -% starred variant and the optional argument.} +% This mainly sets the appropriate flag, increments the +% continuation counter, and executes the given options. +% Furthermore we set |\caption@reset|\-|Continued|\-|Float| to |\@gobble| so the +% continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par % When the \package{hyperref} package is used we have the problem -% that the usage of |\ContinuedFloat| will create duplicate -% hyper links -- |\@currentHref| will be the same for the main float and +% that the usage of |\Continued|\-|Float| will create duplicate +% hyper links -- |\@current|\-|Href| will be the same for the main float and % the continued ones. So we have to make sure unique labels and references -% will be created each time. We do this by extending |\theHfigure| and -% |\theHtable|, so for continued floats the scheme +% will be created each time. We do this by extending |\the|\-|H|\-|figure| and +% |\the|\-|H|\-|table|, so for continued floats the scheme % \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote} % will be used instead of % \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote} @@ -1768,44 +1826,40 @@ % \begin{macrocode} \def\ContinuedFloat{% \caption@iftype - {\addtocounter\@captype\m@ne - \caption@ContinuedFloat\@captype}% + {\caption@ContinuedFloat\@captype}% {\caption@Error{\noexpand\ContinuedFloat outside float}}} % \end{macrocode} % \begin{macrocode} -\def\caption@ContinuedFloat#1{% - \@ifstar{\caption@Continued@Float@{#1}}{\caption@Continued@Float{#1}}} -% \end{macrocode} -% \begin{macrocode} -\def\caption@Continued@Float@{% - \addtocounter\@captype\@ne - \@stpelt{ContinuedFloat}\stepcounter{ContinuedFloat}% - \def\caption@resetContinuedFloat##1{\xdef\caption@CFtype{##1}}% - \caption@@ContinuedFloat} +\newcommand*\caption@ContinuedFloat[1]{% + \@ifstar + {\caption@@refstepcounter\@captype + \caption@@ContinuedFloat{#1}}% + {\caption@Continued@Float{#1}}} % \end{macrocode} % \begin{macrocode} -\def\caption@Continued@Float#1{% +\newcommand*\caption@Continued@Float[1]{% \edef\caption@tempa{#1}% \ifx\caption@tempa\caption@CFtype - \stepcounter{ContinuedFloat}% - \let\caption@resetContinuedFloat\@gobble \caption@@ContinuedFloat{#1}% - \sf@ContinuedFloat{#1}% \else \caption@Error{Continued `#1' after `\caption@CFtype'}% \fi} % \end{macrocode} % \begin{macrocode} -\def\caption@@ContinuedFloat#1{% +\newcommand*\caption@@ContinuedFloat[1]{% + \global\caption@ContinuedFloattrue + \stepcounter{ContinuedFloat}% + \caption@@@ContinuedFloat{#1}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@@ContinuedFloat[1]{% + \caption@setoptions{ContinuedFloat}% + \caption@setoptions{continued#1}% \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat \@ifundefined{theH#1}{}{% \expandafter\l@addto@macro\csname theH#1\endcsname{% \@alph\c@ContinuedFloat}}% - \caption@setoptions{ContinuedFloat}% - \caption@setoptions{continued#1}} -% \end{macrocode} -% \begin{macrocode} -\providecommand*\sf@ContinuedFloat[1]{} + \let\caption@@@ContinuedFloat\@gobble} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@CFtype{??} @@ -1813,7 +1867,7 @@ % \end{macro} % % \begin{macro}{\theContinuedFloat} -% Its preset to \cs{@empty}, so usually the continuation counter is not +% This one is preset to \cs{@empty}, so usually the continuation counter is not % included in the caption label or references. % \begin{macrocode} \newcounter{ContinuedFloat} @@ -1828,10 +1882,8 @@ % (This one will be called inside |\@caption|.) % \begin{macrocode} \newcommand*\caption@resetContinuedFloat[1]{% - \@stpelt{ContinuedFloat}% \xdef\caption@CFtype{#1}% - \def\ContinuedFloat{\caption@Error{% - \noexpand\ContinuedFloat must be placed at the top of the environment}}} + \@stpelt{ContinuedFloat}} % \end{macrocode} % \end{macro} % @@ -1852,19 +1904,80 @@ % \begin{macro}{\caption@refstepcounter} % \changes{v3.1}{2007/07/28}{This macro added} % \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here} -% Resets the continuation counter, increments the float (i.e. |figure| or -% |table|) counter, and sets the |refstepcounter| flag. +% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added} +% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added} +% Increments the float (i.e. |figure| or |table|) counter, +% resets the continuation counter, and redefines itself to |\@gobble|. % \begin{macrocode} \newcommand*\caption@refstepcounter[1]{% \@ifundefined{c@#1}% {\caption@Error{No float type '#1' defined}}% - {\caption@resetContinuedFloat{#1}% - \caption@@refstepcounter{#1}% - \let\caption@ifrefstepcounter\@firstoftwo}} + {\caption@ref@stepcounter{#1}% % \end{macrocode} +% Set flag if this part of the figure (or table) contains a caption now. +% (If |\caption@if|\-|top| is not set, |\caption| is at the bottom of this part, +% therefore ending this part, so we set the flag to |false| in this case.) % \begin{macrocode} -\newcommand*\caption@@refstepcounter{\refstepcounter} -\let\caption@ifrefstepcounter\@secondoftwo + \caption@fixposition + \caption@iftop{\global\caption@captiontrue}{\global\caption@captionfalse}% +% \end{macrocode} +% This part does not contain content (like sub-figures) yet, +% so we set |\if|\-|caption@sub|\-|caption| to |false|. +% \begin{macrocode} + \global\caption@subcaptionfalse +% \end{macrocode} +% Support of the \textsf{memoir} document class. +% \begin{macrocode} + \@nameuse{donemaincaptiontrue}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@ref@stepcounter{% + \ifcaption@ContinuedFloat + \let\caption@tempa\caption@@refcounter + \global\caption@ContinuedFloatfalse + \else + \let\caption@tempa\caption@@refstepcounter + \ifcaption@caption \else + \ifcaption@subcaption +% Counter was already incremented by content, so we suppress \stepcounter{#1} here + \let\caption@tempa\caption@@refcounter + \fi + \fi + \fi + \caption@tempa} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@refcounter[1]{% + \let\caption@stepcounter@ORI\stepcounter + \def\stepcounter##1{% + \def\caption@tempa{#1}% + \def\caption@tempb{##1}% + \ifx\caption@tempa\caption@tempb \else + \caption@stepcounter@ORI{##1}% + \fi}% + \caption@@@refstepcounter{#1}% + \let\stepcounter\caption@stepcounter@ORI} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@refstepcounter[1]{% + \caption@prepare@stepcounter{#1}{ref}% + \caption@@@refstepcounter{#1}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@stepcounter[1]{% + \caption@prepare@stepcounter{#1}{}% + \caption@@@stepcounter{#1}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@prepare@stepcounter[2]{% + \flushsubcaptionlistentries[#2stepcounter]% + \caption@resetContinuedFloat{#1}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@@refstepcounter{\refstepcounter} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@@@stepcounter{\stepcounter} % \end{macrocode} % \end{macro} % @@ -1872,13 +1985,24 @@ % \changes{v3.1}{2007/02/05}{This macro added} % \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar} % (which was introduced in \LaTeXe\ 2004/01/23), too} +% \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added} % A |\relax| was added compared to |\@dblarg| so |\caption{}| will be % expanded to |\caption[\relax]{}| (and not to |\caption[]{}|). +% Furthermore support for option \opt{list-entry} was added. % \begin{macrocode} -\caption@ifundefined\kernel@ifnextchar - {\newcommand\caption@dblarg[1]{\@ifnextchar[{#1}{\caption@xdblarg{#1}}}}% - {\newcommand\caption@dblarg[1]{\kernel@ifnextchar[{#1}{\caption@xdblarg{#1}}}}% -\newcommand\caption@xdblarg[2]{#1[{#2\relax}]{#2}}% +\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{} +% \end{macrocode} +% \begin{macrocode} +\newcommand\caption@dblarg[1]{% + \kernel@ifnextchar[{\caption@ydblarg{#1}}{\caption@xdblarg{#1}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand\caption@xdblarg[2]{% + #1[{#2\relax}]{#2}} +% \end{macrocode} +% \begin{macrocode} +\long\def\caption@ydblarg#1[#2]#3{% + \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}} % \end{macrocode} % \end{macro} % @@ -1888,22 +2012,22 @@ % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added} % \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& % \cs{caption@resetContinuedFloat} removed} +% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed} % Our handling of |\caption| will always be surrounded by % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par % |\caption@begin|\marg{type} performs these tasks: % \begin{enumerate} -% \item[1.] Start a new group. -% \item[2.] Define |\fnum@|\meta{type} if the caption label format is set -% to non-default. -% \item[3.] Override the |position=| setting, if necessary. +% \item[1.] Override the |position=| setting, if necessary. % (for example if set to |auto| or used inside a |supertabular|) +% \item[2.] Start a new group. +% \item[3.] Define |\fnum@|\meta{type} if the caption label format is set +% to non-default. % \end{enumerate} % \begin{macrocode} \newcommand*\caption@begin[1]{% + \caption@fixposition \begingroup - \caption@setfnum{#1}% - \caption@fixposition - \global\let\caption@fixedposition\caption@position} + \caption@setfnum{#1}} % \end{macrocode} % \end{macro} % @@ -1929,11 +2053,11 @@ % \end{macro} % % \begin{macro}{\caption@end} +% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed} % |\caption@end| closes the group. % \begin{macrocode} \newcommand*\caption@end{% - \endgroup - \let\caption@position\caption@fixedposition} + \endgroup} % \end{macrocode} % \end{macro} % @@ -2038,7 +2162,7 @@ % % \begin{macro}{\caption@makecurrent} % This one is needed for support of the \package{nameref} and \package{hyperref} package. -% \changes{v3.3}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added} +% \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added} % \begin{macrocode} \newcommand*\caption@makecurrent[1]{\caption@gettitle} % \end{macrocode} @@ -2083,7 +2207,6 @@ % \begin{macrocode} \def\caption@DeclareSubType sub#1\@nil{% \caption@Debug{Initializing subtype for `#1'\@gobble}% - \@namedef{caption@c@#1}{0}% \@namedef{caption@beginsub#1}{\caption@beginsubfloat{#1}}} \@onlypreamble\caption@DeclareSubType % \end{macrocode} @@ -2109,6 +2232,8 @@ % \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added} % \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added} % \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added} +% \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}} +% \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} 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.) @@ -2118,27 +2243,26 @@ \caption@warmup % \end{macrocode} % \begin{macrocode} - \caption@ifrefstepcounter{}{% - % 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}% -% \end{macrocode} -% \begin{macrocode} - \ifnum\csname caption@c@\@captype\endcsname=\value\@captype \else - \caption@Debug{Reset sub\@captype\ counter}% - \expandafter\xdef\csname caption@c@\@captype\endcsname{% - \the\value\@captype}% - \@stpelt\@subcaptype + \ifcaption@caption \else +% no \caption in this part of the (floating) environment yet + \let\caption@add@contentsline\caption@addsubcontentsline + \ifcaption@subcaption \else +% no \subcaption in this part of the (floating) environment yet + \ifcaption@ContinuedFloat + \global\caption@ContinuedFloatfalse + \else + \caption@@stepcounter\@captype + \fi + \global\caption@subcaptiontrue + \fi \fi % \end{macrocode} % \begin{macrocode} \c@ContinuedFloat=0\relax - \let\caption@resetContinuedFloat\@gobble - \let\caption@addcontentsline\caption@kernel@addcontentsline \let\caption@setfloatcapt\@firstofone % \end{macrocode} % \begin{macrocode} + \caption@setbox{parbox}% \caption@clearmargin \caption@iflist{}{\let\caption@setlist\@gobble}% \caption@setoptions{sub}% @@ -2178,7 +2302,7 @@ \newcommand*\caption@subcaption{% \caption@checkgrouplevel{sub}\subcaption \caption@star - {\caption@refstepcounter\@subcaptype}% + {\caption@@@refstepcounter\@subcaptype}% {\caption@dblarg{\@caption\@subcaptype}}} % \end{macrocode} % \end{macro} @@ -2189,30 +2313,18 @@ % \begin{macrocode} \newcommand*\caption@subphantom{% \caption@checkgrouplevel{sub}\phantomsubcaption - \caption@refstepcounter\@subcaptype} + \caption@@@refstepcounter\@subcaptype} % \end{macrocode} % \end{macro} % -% \begin{macro}{\caption@addcontentsline} -% \changes{v3.1g}{2008/01/12}{Argument of \cs{caption@addsubcontentslines} removed} -% \changes{v3.1i}{2008/08/02}{Argument of \cs{caption@addsubcontentslines} re-added} -% We extend |\caption@addcontentsline| so it handles sub-captions, too. -% \Note{\cs{sf@ifpositiontop} \& \cs{@listsubcaptions} are defined by the -% \package{subfigure} \& \package{subfig} packages.} +% \begin{macro}{caption@clearsubcontentslines} +% Clear pending sub-caption list entries. % \begin{macrocode} -\let\caption@kernel@addcontentsline\caption@addcontentsline -\renewcommand\caption@addcontentsline[2]{% - \sf@ifpositiontop{\@listsubcaptions{#1}}{}% - \caption@kernel@addcontentsline{#1}{#2}% - \sf@ifpositiontop{}{\@listsubcaptions{#1}}% - \caption@addsubcontentslines{#1}} +\newcommand*\caption@clearsubcontentslines{% + \global\let\caption@subcontentslines\@empty} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@addsubcontentslines[1]{% - \begingroup - \caption@subcontentslines - \endgroup - \caption@clearsubcontentslines}% +\caption@clearsubcontentslines % \end{macrocode} % \end{macro} % @@ -2221,11 +2333,15 @@ % \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} +% \changes{v3.3}{2012/01/15}{Debug message added} % Add a pending sub-caption list entry. % \begin{macrocode} \newcommand*\caption@addsubcontentsline[4]{% + \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}% \begingroup - \let\label\caption@gobble \let\index\caption@gobble \let\glossary\caption@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}% @@ -2237,36 +2353,41 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\caption@checksubcontentslines} -% \changes{v3.1g}{2008/01/07}{Bugfix: Uses \cs{caption@Error} instead of \cs{subcaption@Error} now} -% Checks if the list of pending sub-captions is empty, if not, -% a warning will be issued. +% \begin{macro}{\flushsubcaptionlistentries} +% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}} +% Writes pending sub-caption list entries. % \begin{macrocode} -\newcommand*\caption@checksubcontentslines{% - \ifx\caption@subcontentslines\@empty \else - \caption@Error{% - Something's wrong--perhaps a missing \protect\caption\MessageBreak - in the last figure or table}% - \caption@clearsubcontentslines - \fi} +\newcommand*\flushsubcaptionlistentries[1][user]{% + \caption@Debug{\string\flushsubcaptionlistentries (#1)}% + \begingroup + \caption@subcontentslines + \endgroup + \caption@clearsubcontentslines} % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@clearsubcontentslines} -% Clear pending sub-caption list entries. +% We need to patch \cs{chapter} otherwise a vertical gap will be inserted into +% the list prior pending sub-caption list entries. +% We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat} +% will not complain about an unknown document class. % \begin{macrocode} -\newcommand*\caption@clearsubcontentslines{% - \global\let\caption@subcontentslines\@empty} +\AtBeginDocument{\caption@ifundefined\chapter{}{% + \let\caption@chapter@ORI\chapter + \def\chapter{% + \flushsubcaptionlistentries[chapter]\caption@chapter@ORI}}} % \end{macrocode} -% \end{macro} -% +% Same for \cs{appendix}. % \begin{macrocode} -\caption@AtBeginDocument*{% - \caption@ifundefined\sf@ifpositiontop{\let\sf@ifpositiontop\@gobbletwo}{}% - \caption@clearsubcontentslines - \g@addto@macro\caption@typehook{\caption@checksubcontentslines}% - \AtEndDocument{\caption@checksubcontentslines}}% +\AtBeginDocument{\caption@ifundefined\appendix{}{% + \let\caption@appendix@ORI\appendix + \def\appendix{% + \flushsubcaptionlistentries[appendix]\caption@appendix@ORI}}} +% \end{macrocode} +% Flush the list of pending sub-caption list entries at the end of the document. +% \begin{macrocode} +\AtEndDocument{% + \flushsubcaptionlistentries[AtEndDocument]} % \end{macrocode} +% \end{macro} +% % % \subsection{Document class \& Babel package support} % @@ -2503,24 +2624,19 @@ % \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} +% \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.} % |\caption@freeze|\par % Used by the \package{fltpage} \& \package{sidecap} package support. % \begin{macrocode} - \newcommand*\caption@freeze{% + \newcommand*\caption@freeze[1]{% + \caption@settype*{#1}% + \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround! % \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% - \let\setcounter\caption@frozen@setcounter - \let\addtocounter\caption@frozen@addtocounter}% + \caption@@freeze{\caption@@@ContinuedFloat\@captype}% + \caption@frozen@ContinuedFloat}% % \end{macrocode} % \begin{macrocode} \let\caption@frozen@setup\caption@setup @@ -2537,11 +2653,7 @@ \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 + {\let\@currentlabel\caption@SClabel \caption@withoptargs\caption@SC@caption}}% \long\def\caption@SC@caption##1##2{% \caption@@freeze{\caption##1{##2}}% @@ -2577,6 +2689,15 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\caption@prepare@defrost} +% \changes{v3.3}{2013/01/06}{This macro added} +% Prevent resetting the caption flags +% \begin{macrocode} + \newcommand*\caption@prepare@defrost{% + \let\caption@settype\caption@set@type} +% \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} @@ -2932,13 +3053,7 @@ \def\FP@captype{#1}% \begin{lrbox}{\FP@floatCorpusBOX}% \minipage\hsize % changes from LR mode to vertical mode - \caption@settype*{#1}% - \caption@freeze - \global\let\FP@Label\@empty - \caption@ifFPrefcap - {}% - {\def\caption@freeze@label##1##2{% - \g@addto@macro\FP@Label{\FP@label##1{##2}}}}% + \caption@freeze{#1}% \ignorespaces}% % \end{macrocode} % \end{macro} @@ -2990,35 +3105,16 @@ \FP@helpNote\FP@captype\FP@positionLabel % \end{macrocode} % \begin{macrocode} - \edef\FP@RestoreCounter{% - \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\FP@captype[p!]% + {\caption@prepare@defrost + \begin\FP@captype[p!]% \usebox\FP@floatCorpusBOX - \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}}% - {\ifx\caption@SClentry\@empty \else - \expandafter\captionlistentry\expandafter{\caption@SClentry}% - \fi}% - \caption@makeanchor\relax - \FP@Label \end\FP@captype}% - {\FP@RestoreCounter - \@ifundefined{theH\FP@captype}{}{% + {\@ifundefined{theH\FP@captype}{}{% \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}% - {\begin\FP@captype[b!]% + {\caption@prepare@defrost + \begin\FP@captype[b!]% \let\FP@savedSetfnumCommand\caption@setfnum \def\caption@setfnum##1{% \FP@savedSetfnumCommand{##1}% @@ -3029,7 +3125,6 @@ \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption \caption@setoptions{FP\@captype}% \FP@separatorCaption - \caption@ifFPlistcap{}{\let\caption@addcontentsline\@gobbletwo}% \caption@defrost \end\FP@captype}% }% @@ -3072,11 +3167,11 @@ \g@addto@macro\caption@prepareslc{\measuring@true}% % \end{macrocode} % -% \begin{macro}{\caption@@refstepcounter} +% \begin{macro}{\caption@@@refstepcounter} % We redefine |\caption@@refstepcounter| so |\H@refstepcounter| will be used % instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|. % \begin{macrocode} - \renewcommand*\caption@@refstepcounter{\H@refstepcounter}% + \renewcommand*\caption@@@refstepcounter{\H@refstepcounter}% % \end{macrocode} % \end{macro} % @@ -3314,8 +3409,19 @@ % \end{macro} % % \begin{macro}{\float@makebox} +% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now} % Do our own redefinition of |\float@makebox|, if it was redefined by % the \package{hyperref} package. +% (But first of all we correct a wrong load order \package{hyperref}-\package{float}, +% if possible.) +% \begin{macrocode} + \caption@ifundefined\HyNew@float@makebox{}{% + \caption@ifundefined\HyOrg@float@makebox{% + \caption@Debug{% + Correcting wrong load order hyperref-float\@gobble}% + \let\HyOrg@float@makebox\float@makebox + \let\float@makebox\HyNew@float@makebox}{}}% +% \end{macrocode} % \begin{macrocode} \caption@ifundefined\HyOrg@float@makebox{}{% \caption@Debug{% @@ -3643,9 +3749,12 @@ \caption@startrue#1\caption@starfalse % \end{macrocode} % +% \begin{macrocode} + \caption@prepare@stepcounter\LTcaptype{LT}% +% \end{macrocode} +% % \changes{v3.1}{2007/05/05}{\cs{caption@normalsize} added} % \begin{macrocode} - \caption@resetContinuedFloat\LTcaptype \caption@begin\LTcaptype \caption@normalsize % \end{macrocode} @@ -3862,7 +3971,7 @@ % |\edef\x{%|\\ % | \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\ % | {\unexpanded\expandafter{##2}}}|\\ -% |\x| +% |\-| % \end{quote}} % \begin{macrocode} \caption@ORI@make@piccaption @@ -3921,6 +4030,7 @@ % \begin{macro}{\@makerotcaption} % \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now} % \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox} now} +% \changes{v3.3}{2012/12/26}{Rewritten (again)} % Original (bugfixed) code: % \begin{verbatim} % \long\def\@makerotcaption#1#2{% @@ -3936,34 +4046,19 @@ % } % \end{verbatim}%^^A % Our version emulates this behavior, but if |width=| is set, -% the rotated caption is always typeset as |minipage|. +% the rotated caption is always typeset as |\parbox|. % (Note that |margin=| is not supported here.) % \begin{macrocode} \long\def\@makerotcaption#1#2{% -% \end{macrocode} -% -% \begin{macrocode} - \ifdim\captionwidth=\z@ - \setcaptionwidth{.8\textheight}% - \caption@slc{#1}{#2}{.8\vsize}{% - \let\caption@makerot\caption@@make - \caption@clearmargin -% \long\def\caption@parbox##1##2{\hbox{\hsize=.8\textheight\relax##2}}% -% (not needed because \rotatebox uses an \hbox anyway) - \let\caption@parbox\@secondoftwo}% - \caption@set@bool\caption@ifslc0% been there, done that - \fi -% \end{macrocode} -% -% \begin{macrocode} - \rotatebox{90}{\caption@makerot{#1}{#2}}% + \rotatebox{90}{% + \ifdim\captionwidth=\z@ + \setcaptionwidth{.8\vsize}% + \l@addto@macro\caption@singleline{\caption@setbox{none}}% + \fi + \let\caption@calcmargin\relax + \caption@@make{#1}{#2}}% \nobreak\hspace{12pt}}% % \end{macrocode} -% -% \begin{macrocode} - \newcommand\caption@makerot[2]{% - \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}% -% \end{macrocode} % \end{macro} % % \begin{macrocode} @@ -4000,8 +4095,7 @@ % which will be executed later on. % Furthermore we need to make |\caption*| work. % \begin{macrocode} - \caption@settype*{#2}% - \caption@freeze + \caption@freeze{#2}% % \end{macrocode} % The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a % |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work. @@ -4024,18 +4118,6 @@ \let\caption@ORI@endSC@FLOAT\endSC@FLOAT \def\endSC@FLOAT{% % \end{macrocode} -% \Note{\cs{@captype} isn't defined here, this will be done inside -% the original definition of \cs{endSC@FLOAT}. But \cs{SC@captype} is -% defined and can be used here, if needed.} -% \begin{macrocode} - \let\caption@ORI@settype\caption@settype - \def\caption@settype##1{% will be done in \@xfloat - \caption@ORI@settype*{##1}% do not change \@currentlabel - \caption@setSC@justify -%%% \caption@setoptions{SCfloat}% - \caption@setoptions{SC\@captype}% - \caption@start}% -% \end{macrocode} % Before we can typeset the caption we need to set the margin to zero % because any extra margin would only be disturbing here.\par % (We don't need to take care about the caption position because @@ -4063,11 +4145,16 @@ % not the regular one!} % \begin{macrocode} \let\caption\SC@orig@caption - \def\SC@orig@caption[##1]##2{\caption@defrost}% + \def\SC@orig@caption[##1]##2{% + \caption@setSC@justify +%%% \caption@setoptions{SC}% + \caption@setoptions{SC\@captype}% + \caption@defrost}% % \end{macrocode} % Finally we call the original definition of |\endSC@FLOAT|. % \begin{macrocode} \caption@setSC@justify % for compatibility mode + \caption@prepare@defrost \caption@ORI@endSC@FLOAT}% % \end{macrocode} % \end{macro} @@ -4335,10 +4422,10 @@ % \changes{v3.2d}{2011/11/02}{Redefinition of this macro added} % First of all we make the \package{wrapfig} package independent from the package % load order regarding the \package{float} package. -% Since the usage of |\@float@set|\x|every| is missing in the code of the \package{wrapfig} -% package (it should be in the redefinition of |\float@re|\x|style|, right after +% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig} +% package (it should be in the redefinition of |\float@re|\-|style|, right after % |\@nameuse{fst@#1}|), we don't use it here, too, -% especially since |\wrap|\x|float| will usually not be used when used with re-styled floats. +% especially since |\wrap|\-|float| will usually not be used when used with re-styled floats. % \begin{macrocode} \renewcommand*\wrapfloat[1]{% \def\@captype{#1}% @@ -4378,7 +4465,7 @@ % \changes{v3.2d}{2011/11/02}{This macro added} % \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed} % We place our \package{hyperref} anchor here, apply the `wrap' options etc. -% Since the usage of |\@float@set|\x|every| is missing in the \package{wrapfig} +% Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig} % package we will catch it up here for making the necessary adaptions to the % \package{float} package. % \begin{macrocode} @@ -4387,7 +4474,7 @@ \@ifundefined{fst@#1}{}{\@float@setevery{#1}}% \caption@settype{#1}% \caption@clearmargin -%%% \caption@setoptions{wrapfloat}% +%%% \caption@setoptions{wrap}% \caption@setoptions{wrap#1}}% % \end{macrocode} % \end{macro} @@ -4406,22 +4493,17 @@ % % \clearpage % \begin{thebibliography}{99} -% \bibitem{TLC2} -% Frank Mittelbach and Michel Goossens:\\ -% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\ -% \newblock Addison-Wesley, 2004. -% % \bibitem{beamer} % Till Tantau:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/beamer/}% -% {\emph{User Guide to the Beamer Class, Version 3.07}},\\ -% March 11, 2007 +% {\emph{The beamer class, User Guide for version 3.25}},\\ +% December 26, 2012 % % \bibitem{KOMAScript} % Markus Kohm \& Jens-Uwe-Morawski:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/koma-script/}% % {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\ -% 2007-01-09 +% 2012-07-22 % % \bibitem{NTG} % Victor Eijkhout:\\ @@ -4445,7 +4527,7 @@ % Olga Lapko:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/floatrow/}% % {\emph{The floatrow package documentation}},\\ -% 2007/08/24 +% 2009/08/02 % % \bibitem{fltpage} % Sebastian Gross:\\ @@ -4456,14 +4538,14 @@ % \bibitem{hyperref} % Sebastian Rahtz \& Heiko Oberdiek:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/hyperref/}% -% {\emph{Hypertext marks in \LaTeX}},\\ -% November 12, 2007 +% {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\ +% November 2012 % % \bibitem{hypcap} % Heiko Oberdiek:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}% % {\emph{The hypcap package -- Adjusting anchors of captions}},\\ -% 2007/04/09 +% 2011/02/16 % % \bibitem{listings} % Carsten Heinz \& Brooks Moses:\\ @@ -4505,7 +4587,7 @@ % Steven D. Cochran:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/subfigure/}% % {\emph{The subfigure package}},\\ -% 2002/07/02 +% 2005/03/15 % % \bibitem{subfig} % Steven D. Cochran:\\ @@ -4517,25 +4599,25 @@ % Johannes Braams and Theo Jurriens:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/supertabular/}% % {\emph{The supertabular environment}},\\ -% 2002/07/19 +% 2004/02/20 % % \bibitem{threeparttable} % Donald Arseneau:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/misc/}% % {\emph{Three part tables: title, tabular environment, notes}},\\ -% 2003/06/13 +% March 5, 2010 % % \bibitem{wrapfig} % Donald Arseneau:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/wrapfig/}% % {\emph{WRAPFIG.STY ver 3.6}},\\ -% 2003/01/31 +% Jan 31, 2003 % % \bibitem{xtab} % Peter Wilson:\\ % \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/xtab/}% % {\emph{The xtab package}},\\ -% 2004/05/24 +% 2011/07/31 % \end{thebibliography} % % \iffalse diff --git a/Master/texmf-dist/source/latex/caption/caption.ins b/Master/texmf-dist/source/latex/caption/caption.ins index 412fe0ce3cd..763f86f2156 100644 --- a/Master/texmf-dist/source/latex/caption/caption.ins +++ b/Master/texmf-dist/source/latex/caption/caption.ins @@ -6,7 +6,7 @@ \preamble -Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) -------------------------------------------------------------------------- diff --git a/Master/texmf-dist/source/latex/caption/caption2.dtx b/Master/texmf-dist/source/latex/caption/caption2.dtx index 88b7f1fc906..f5195233adf 100644 --- a/Master/texmf-dist/source/latex/caption/caption2.dtx +++ b/Master/texmf-dist/source/latex/caption/caption2.dtx @@ -2,7 +2,7 @@ % % This is file `caption2.dtx'. % -% Copyright (C) 1994-2008 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 1994-2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx index 4a084501a2a..d80fb43d646 100644 --- a/Master/texmf-dist/source/latex/caption/caption3.dtx +++ b/Master/texmf-dist/source/latex/caption/caption3.dtx @@ -2,7 +2,7 @@ % % This is file `caption3.dtx'. % -% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -25,12 +25,12 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{3410} +% \CheckSum{3461} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{caption3.drv}[2011/10/09 v1.4 Implementation of the caption kernel] +\ProvidesFile{caption3.drv}[2013/01/06 v1.5 Implementation of the caption kernel] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % @@ -57,7 +57,7 @@ \ifpdf\usepackage{hypdestopt}\fi \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}} % -\usepackage[debug]{caption3}[2011/07/01] +\usepackage[debug]{caption3}[2013/01/01] % \DeclareRobustCommand*\eTeX{\texorpdfstring {\leavevmode\hbox{$\varepsilon$}-\TeX}% @@ -89,8 +89,6 @@ % \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}} % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} % \newcommand*\version[2][]{\textit{v#2}} -% \newcommand*\x{\discretionary{-}{}{}} -% \newcommand*\xx{\discretionary{}{}{}} % % \GetFileInfo{caption3.drv} % \let\docdate\filedate @@ -200,7 +198,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2012/01/12 v1.4b caption3 kernel (AR)] +\ProvidesPackage{caption3}[2013/01/06 v1.5 caption3 kernel (AR)] % \end{macrocode} % % \subsection{Generic helpers} @@ -438,27 +436,29 @@ % % \begin{macro}{\caption@withoptargs} % \changes{v1.1}{2007/08/12}{This macro added} +% \changes{v1.5}{2012/04/09}{This macro revised} % |\caption@withoptargs|\marg{cmd} % \begin{macrocode} \newcommand*\caption@withoptargs[1]{% \@ifstar - {\def\caption@tempa{*}\caption@@withoptargs#1}% - {\def\caption@tempa{}\caption@@withoptargs#1}} + {\def\caption@tempa{*}\caption@@withoptargs{#1}}% + {\def\caption@tempa{}\caption@@withoptargs{#1}}} % \end{macrocode} % \begin{macrocode} \def\caption@@withoptargs#1{% \@ifnextchar[%] - {\caption@@@withoptargs#1}% - {\caption@@@@withoptargs#1}} + {\caption@@@withoptargs{#1}}% + {\caption@@@@withoptargs{#1}}} % \end{macrocode} % \begin{macrocode} \def\caption@@@withoptargs#1[#2]{% \l@addto@macro\caption@tempa{[{#2}]}% - \caption@@withoptargs#1} + \caption@@withoptargs{#1}} % \end{macrocode} % \begin{macrocode} \def\caption@@@@withoptargs#1{% - \expandafter#1\expandafter{\caption@tempa}} + \def\caption@tempb{#1}% + \expandafter\caption@tempb\expandafter{\caption@tempa}} % \end{macrocode} % \end{macro} % @@ -477,6 +477,7 @@ % \begin{macro}{\caption@IfCheckCommand} % \changes{v1.1}{2007/04/10}{This macro added} % \changes{v1.2b}{2008/08/02}{Revised so \cs{next} is no longer used} +% \changes{v1.5}{2012/08/25}{Bugfix: Uses \cs{caption@tempa} instead of \cs{@tempa}} % |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par % checks if a command already exists, with the same definition. % It can be used more-than-once to check if one of multiple definitions will @@ -491,9 +492,9 @@ % \begin{macrocode} \newcommand\caption@DoCheckCommand[2]{% \begingroup - \let\@tempa#1% + \let\caption@tempa#1% #2% - \ifx\@tempa#1% + \ifx\caption@tempa#1% \endgroup \let\caption@CheckCommand\@gobbletwo \else @@ -575,9 +576,10 @@ % See TLC2\cite{TLC2}, A.4.7, p885 for details.} % \begin{macrocode} \newcommand*\caption@InfoNoLine[1]{% - \PackageInfo{caption}{#1\@gobble}} + \caption@Info{#1\@gobble}} % \end{macrocode} % \end{macro} +% % \begin{macro}{\caption@Warning} % \changes{v1.1c}{2007/10/14}{This macro added, will now be used for warnings} % |\caption@Warning|\marg{message} @@ -598,6 +600,7 @@ See the caption package documentation for explanation.} % \end{macrocode} % \end{macro} +% % \begin{macro}{\caption@Error} % \changes{v1.0j}{2007/01/20}{This macro added, will now be used for errors} % \changes{v1.0o}{2007/04/11}{Renamed from \cs{caption@error} to \cs{caption@Error}} @@ -614,6 +617,7 @@ section about errors.\MessageBreak\@ehc} % \end{macrocode} % \end{macro} +% % \begin{macro}{\caption@KV@err} % \changes{v1.1b}{2007/09/18}{This macro added} % \begin{macrocode} @@ -675,9 +679,14 @@ % \end{macrocode} % \begin{macrocode} \newcommand*\caption@declareoption[2]{% - #1{\undefine@key{caption}{#2}}\define@key{caption}{#2}} + #1{\undefine@key{caption}{#2}}\caption@declare@option{#2}} \@onlypreamble\caption@declareoption % \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@declare@option{% + \define@key{caption}} +%% no \@onlypreamble\caption@declare@option, will be used by \captionsetup +% \end{macrocode} % \end{macro} % % \begin{macro}{\DeclareCaptionOptionNoValue} @@ -722,8 +731,9 @@ % \changes{v1.1e}{2007/07/27}{Inside packages the starred variant will be used automatically} % \changes{v1.2}{2007/11/16}{Bugfix 07-11-09: `space hack' added} % \changes{v1.2a}{2008/01/12}{\cs{ifcaptionsetup@star} will be set now} -% |\captionsetup|\oarg{type}\marg{keyval-list of options}\\ -% |\captionsetup*|\oarg{type}\marg{keyval-list of options}\par +% \changes{v1.5}{2012/04/09}{Support of multiple optional arguments added} +% |\captionsetup|\oarg{type}\ldots\marg{keyval-list of options}\\ +% |\captionsetup*|\oarg{type}\ldots\marg{keyval-list of options}\par % If the optional argument `type' is specified, we simply save or append % the option list, otherwise we `execute' it with |\setkeys|. % (The non-starred variant issues a warning if \meta{keyval-list of options} @@ -742,7 +752,20 @@ \newcommand*\caption@setup{\caption@setkeys{caption}} % \end{macrocode} % \begin{macrocode} -\def\caption@setup@options[#1]#2{% +\def\caption@setup@options[#1]{% + \@ifnextchar[% + {\caption@stepthecounter + \caption@withoptargs{\@expandtwoargs + \caption@setup@options@i{#1}{@\caption@thecounter}}}% + {\caption@setup@options@{#1}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@setup@options@i[4]{% + \caption@setup@options@{#1}{#2}% + \caption@declare@option{#2}[]{\captionsetup#3{#4}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@setup@options@[2]{% \@bsphack \ifcaptionsetup@star\captionsetup@starfalse\else\caption@addtooptlist{#1}\fi \expandafter\caption@l@addto@list\csname caption@opt@#1\endcsname{#2}% @@ -1090,6 +1113,7 @@ \newdimen\captionmargin \newdimen\captionmargin@ \newdimen\captionwidth +\newdimen\caption@tempdima % \end{macrocode} % \end{macro} % \end{macro} @@ -1209,13 +1233,14 @@ % \begin{macro}{\caption@counter} % \changes{v1.0n}{2007/04/03}{This counter added} % \changes{v1.1e}{2007/10/28}{Renamed to \cs{caption@thecounter}; \cs{caption@stepcounter} added} -% This counter numbers the captions. At the moment it will be used inside +% \changes{v1.5}{2012/04/09}{\cs{caption@stepcounter} renamed to \cs{caption@stepthecounter}} +% Internal counter. At the moment it will be used inside % |\caption@ifoddpage| only. % \begin{macrocode} \newcommand*\caption@thecounter{0} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@stepcounter{% +\newcommand*\caption@stepthecounter{% \@tempcnta\caption@thecounter \advance\@tempcnta\@ne \xdef\caption@thecounter{\the\@tempcnta}} @@ -1418,12 +1443,9 @@ % \end{macro} % % \changes{v1.2a}{2008/01/20}{Option \opt{style*=} added} -% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added} % \begin{macrocode} \DeclareCaptionOption{style}{\caption@setstyle{#1}} \DeclareCaptionOption{style*}{\caption@setstyle*{#1}} -\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}} -\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}} % \end{macrocode} % % \begin{macro}{\caption@setstyle} @@ -1467,13 +1489,15 @@ % \changes{v1.1}{2007/02/04}{% % This macro renamed from \cs{caption@setdefault} to \cs{caption@resetstyle}} % \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency} -% \changes{v1.2}{2007/11/17}{Usage of \texttt{size=} added} -% \changes{v1.2b}{2008/05/06}{Usage of \texttt{rule} added} +% \changes{v1.2}{2007/11/17}{Usage of \opt{size=} added} +% \changes{v1.2b}{2008/05/06}{Usage of \opt{rule} added} +% \changes{v1.5}{2012/03/15}{\opt{box=parbox} added} % This resets (nearly) all caption options to the base ones. % \emph{Note that this does not touch the skips and the positioning!} % \begin{macrocode} \newcommand*\caption@resetstyle{% \caption@setup{% + box=parbox,boxcolor=white,% format=plain,labelformat=default,labelsep=colon,textformat=simple,% justification=justified,font=,size=,labelfont=,textfont=,% margin=0pt,minmargin=0,maxmargin=0,% @@ -1487,6 +1511,7 @@ % \changes{v1.1}{2007/02/04}{Caption style `default' renamed to `base', and a new `default' added} % \changes{v1.1}{2007/03/31}{\opt{format=plain} added to caption style \opt{default}} % \changes{v1.1c}{2007/10/14}{\opt{format=plain} removed from caption style \opt{default}} +% \changes{v1.5}{2012/03/15}{\opt{box=default} added to caption style \opt{default}} % Currently there are two pre-defined styles, called `base' \& `default'. % The first one is a perfect match to the behavior of |\@makecaption| offered % by the standard \LaTeX\ document classes (and was called `default' in @@ -1495,10 +1520,63 @@ % \begin{macrocode} \DeclareCaptionStyle{base}[indent=0pt,justification=centering]{} \DeclareCaptionStyle{default}[indent=0pt,justification=centering]{% - format=default,labelsep=default,textformat=default,% + box=default,format=default,labelsep=default,textformat=default,% justification=default,font=default,labelfont=default,textfont=default} % \end{macrocode} % +% \changes{v1.2b}{2008/05/06}{Option \opt{slc=} added} +% \begin{macrocode} +\DeclareCaptionOption{singlelinecheck}[1]{\caption@set@bool\caption@ifslc{#1}} +\DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}} +% \end{macrocode} +% +% \subsection{Boxes} +% +% \begin{macro}{\DeclareCaptionBox} +% \changes{v1.5}{2012/03/15}{This macro added} +% |\DeclareCaptionBox|\marg{name}\marg{code with \#1 and \#2} +% \begin{macrocode} +\newcommand*\DeclareCaptionBox[2]{% + \global\long\@namedef{caption@box@#1}##1##2{#2}} +\@onlypreamble\DeclareCaptionBox +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\DeclareCaptionOption{box}{\caption@setbox{#1}} +% \end{macrocode} +% +% \begin{macro}{\caption@setbox} +% |\caption@setbox|\marg{name}\par +% Selecting a caption box simply means saving the code (in |\caption@box|). +% \begin{macrocode} +\newcommand*\caption@setbox[1]{% + \@ifundefined{caption@box@#1}% + {\caption@Error{Undefined box `#1'}}% + {\expandafter\let\expandafter\caption@box\csname caption@box@#1\endcsname}} +% \end{macrocode} +% \end{macro} +% +% There are four pre-defined label formats, called `empty', `simple', +% `parens', and `brace'. +% \begin{macrocode} +\DeclareCaptionBox{empty}{} +\DeclareCaptionBox{none}{#2} +\DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}} +%\DeclareCaptionBox{colorbox}{% +% \colorbox{\caption@boxcolor}{\caption@box@parbox{\dimexpr #1-2\fboxsep}{#2}}} +\DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{% +% \setlength\caption@tempdima{#1}% + \addtolength\caption@tempdima{-2\fboxsep}% + \caption@box@parbox\caption@tempdima{#2}}} +\DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}} +% \end{macrocode} +% +% `default' usually maps to `parbox'. +% \begin{macrocode} +\def\caption@box@default{\caption@box@parbox} +% \end{macrocode} +% % \subsection{Formats} % % \begin{macro}{\DeclareCaptionFormat} @@ -2424,6 +2502,41 @@ \vskip\belowcaptionskip}} % \end{macrocode} % +% \subsubsection{The elsarticle classes} +% \changes{v1.5}{2013/01/06}{elsarticle class support added} +% +% \begin{macro}{\caption@ifelsarticleclass} +% \begin{macrocode} +\providecommand*\caption@ifelsarticleclass{% + \@ifclassloaded{elsarticle}\@firstofone\@gobble} +\@onlypreamble\caption@ifelsarticleclass +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\caption@ifelsarticleclass{% +% \end{macrocode} +% \begin{macrocode} + \caption@CheckCommand\@makecaption{% + % elsarticle.cls,v 1.20 2008-10-13 04:24:12 cvr Exp + \long\def\@makecaption#1#2{% + \vskip\abovecaptionskip\footnotesize + \sbox\@tempboxa{#1: #2}% + \ifdim \wd\@tempboxa >\hsize + #1: #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip}} +% \end{macrocode} +% \begin{macrocode} + \DeclareCaptionDefaultFont{font}{\footnotesize} +% \end{macrocode} +% \begin{macrocode} +} +% \end{macrocode} +% % \subsubsection{The \AmS{} \& \SmF{} classes} % \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added} % @@ -2899,6 +3012,7 @@ % \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} +% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} 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 @@ -2920,20 +3034,24 @@ % \caption@setoptions\caption@listtype \@namedef{the\caption@listtype}{\@nameuse{the#1}}}% \expandafter\caption@@addcontentsline\expandafter{\caption@listtype}{#2}% - \endgroup}} + \endgroup}% + \caption@addsubcontentslines{#1}} % \end{macrocode} % \begin{macrocode} \newcommand\caption@@addcontentsline[2]{% {\let\\\space \@ifundefined{ext@#1}% {\caption@Error{No float type '#1' defined}}% - {\caption@@@addcontentsline + {\caption@add@contentsline {\csname ext@#1\endcsname}% {#1}% {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}% {\ignorespaces #2}}}} % \end{macrocode} % \begin{macrocode} +\newcommand*\caption@add@contentsline{\caption@@@addcontentsline} +% \end{macrocode} +% \begin{macrocode} \newcommand*\caption@@@addcontentsline[4]{% \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} % \end{macrocode} @@ -2948,6 +3066,9 @@ \expandafter\@firstofone \fi} % \end{macrocode} +% \begin{macrocode} +\newcommand*\caption@addsubcontentslines[1]{} +% \end{macrocode} % \end{macro} % % \subsection{Typesetting the caption} @@ -2998,32 +3119,19 @@ % \changes{v1.0n}{2007/04/03}{Usage of \cs{caption@ifoddpage} added} % \changes{v1.1}{2007/07/29}{\cs{caption@calcmargin} moved below single-line-check} % \changes{v1.1e}{2007/10/28}{\cs{caption@stepcounter} added} +% \changes{v1.5}{2012/03/15}{Uses \cs{caption@tempdima} instead of \cs{@tempdima}} +% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption@calcmargin}} % |\caption@@make|\marg{caption label}\marg{caption text} % \begin{macrocode} \newcommand\caption@@make[2]{% \begingroup - \caption@stepcounter + \caption@stepthecounter \caption@beginhook % \end{macrocode} % -% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set -% \begin{macrocode} -% TODO: Move this to \caption@calcmargin!? - \ifx\caption@maxmargin\@undefined \else - \ifdim\captionmargin>\caption@maxmargin\relax - \captionmargin\caption@maxmargin\relax - \fi - \fi - \ifx\caption@minmargin\@undefined \else - \ifdim\captionmargin<\caption@minmargin\relax - \captionmargin\caption@minmargin\relax - \fi - \fi -% \end{macrocode} -% % Special single-line treatment (option |singlelinecheck=|) % \begin{macrocode} - \caption@ifslc{\caption@slc{#1}{#2}\captionwidth\relax}{}% + \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}% % \end{macrocode} % % Typeset the left margin (option |margin=|) @@ -3042,9 +3150,9 @@ % \Note{\cs{captionindent} is \emph{not} supported if the caption format % was defined with \cs{DeclareCaptionFormat*}.} % \begin{macrocode} - \@tempdima\captionwidth - \caption@ifh{\advance\@tempdima-\caption@indent}% - \caption@parbox\@tempdima{% + \caption@tempdima\captionwidth + \caption@ifh{\advance\caption@tempdima-\caption@indent}% + \caption@parbox\caption@tempdima{% % \end{macrocode} % % Typeset the indention (option |indention=|)\\ @@ -3089,12 +3197,28 @@ % \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now} % \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), % use \cs{linewidth} instead of \cs{hsize}} +% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here} % |\caption@calcmargin|\par % Calculate |\captionmargin| \& |\captionwidth|, so both contain valid % values. % \begin{macrocode} \newcommand*\caption@calcmargin{% \caption@calcmargin@hook +% \end{macrocode} +% Check margin, if |\caption@minmargin| or |\caption@maxmargin| is set +% \begin{macrocode} + \ifx\caption@maxmargin\@undefined \else + \ifdim\captionmargin>\caption@maxmargin\relax + \captionmargin\caption@maxmargin\relax + \fi + \fi + \ifx\caption@minmargin\@undefined \else + \ifdim\captionmargin<\caption@minmargin\relax + \captionmargin\caption@minmargin\relax + \fi + \fi +% \end{macrocode} +% \begin{macrocode} \ifdim\captionwidth=\z@ \captionwidth\linewidth \advance\captionwidth by -2\captionmargin @@ -3128,27 +3252,24 @@ % \changes{v1.1c}{2007/10/14}{Support of \cs{caption@slfmt} added} % \changes{v1.1d}{2007/10/23}{`SingleLine' renamed to `singleline' for consistency} % \changes{v1.3}{2010/09/04}{Split into \cs{caption@slc} and \cs{caption@@slc}} -% |\caption@slc|\marg{label}\marg{text}\marg{width}\marg{extra code}\par +% \changes{v1.5}{2012/12/26}{Merged into a single macro again} +% |\caption@slc|\marg{label}\marg{text}\marg{single-line-code}\marg{multi-line-code}\par % This one does the single-line-check. % \begin{macrocode} \newcommand\caption@slc[4]{% - \caption@@slc{#1}{#2}{#3}{\caption@singleline#4}{}} -% \end{macrocode} -% \begin{macrocode} -\newcommand\caption@@slc[5]{% \caption@Debug{Begin SLC}% \begingroup \caption@singleline \let\caption@hj\@empty - \caption@calcmargin % calculate #3 if necessary + \caption@calcmargin % calculate \captionwidth \caption@prepareslc \sbox\@tempboxa{\caption@@@make{#1}{#2}}% - \ifdim\wd\@tempboxa>#3% + \ifdim\wd\@tempboxa>\captionwidth \endgroup - #5% + #4% \else \endgroup - #4% + #3% \fi \caption@Debug{End SLC}} % \end{macrocode} @@ -3213,10 +3334,12 @@ % \changes{v1.0l}{2006/03/09}{Bugfix 07-03-09: \cs{caption@parbox} changed from % \cs{parbox-t} to \cs{parbox-b}} % \changes{v1.2}{2007/11/11}{Renamed from \cs{captionbox} to \cs{caption@parbox}} +% \changes{v1.5}{2012/03/15}{Adapted to \cs{DeclareCaptionBox}} % |\caption@parbox|\marg{width}\marg{contents}\par % This macro defines the box which surrounds the caption paragraph. +% (For compatibility reasons we still use |\caption@par|\-|box| instead of |\caption@box|.) % \begin{macrocode} -\newcommand*\caption@parbox{\parbox[b]} +\newcommand*\caption@parbox{\caption@box} % \end{macrocode} % \end{macro} % @@ -3407,60 +3530,13 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@stpelt} -% We patch \cs{@stpelt} so a list of `connected' counters will be reset, too. -% (Like \cs{stepcounter} does in |ltcounts.dtx|.) -% \begin{macrocode} -\newcommand*\caption@patch@stpelt{% - \let\caption@stpelt\@stpelt - \def\@stpelt##1{% - \caption@stpelt{##1}% - \begingroup - \let\@elt\caption@stpelt - \csname caption@cl@##1\endcsname - \endgroup}% - \let\caption@patch@stpelt\relax} -\@onlypreamble\caption@patch@stpelt -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@addtoreset} -% \changes{v1.2d}{2009/10/09}{This macro added} -% Like \cs{@addtoreset} from |ltcounts.dtx| -% \begin{macrocode} -\newcommand*\caption@addtoreset[2]{% - \caption@patch@stpelt - \@ifundefined{caption@cl@#2}{\@namedef{caption@cl@#2}{}}{}% - \expandafter\@cons\csname caption@cl@#2\endcsname{{#1}}} -\@onlypreamble\caption@addtoreset -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@removefromreset} -% \changes{v1.2d}{2009/10/09}{This macro added} -% Like \cs{@removefromreset} from |remreset.sty| -% \begin{macrocode} -\newcommand*\caption@removefromreset[2]{% - \begingroup - \expandafter\let\csname c@#1\endcsname\caption@removefromreset - \def\@elt##1{% - \expandafter\ifx\csname c@##1\endcsname\caption@removefromreset - \else - \noexpand\@elt{##1}% - \fi}% - \expandafter\xdef\csname caption@cl@#2\endcsname{% - \csname caption@cl@#2\endcsname}% - \endgroup} -\@onlypreamble\caption@removefromreset -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\DeclareCaptionSubType} % \changes{v1.2}{2007/11/16}{This macro added} % \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} +% \changes{v1.5}{2011/12/29}{Usage of \cs{caption@addtoreset} replaced by \cs{@addtoreset}} % |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\ % |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par % The starred variant provides the numbering format @@ -3485,7 +3561,7 @@ {\@ifundefined{c@sub#3}% {\caption@Debug{New subtype `sub#3'}% \newcounter{sub#3}% - \caption@addtoreset{sub#3}{#3}% + \@addtoreset{sub#3}{#3}% \@namedef{ext@sub#3}{\csname ext@#3\endcsname}% \caption@declaresublistentry{#3}% \@cons\caption@subtypelist{{#3}}}% @@ -3568,7 +3644,7 @@ % % \begin{macro}{\caption@subtypelist} % An \cs{@elt}-list containing the subtypes defined -% with |\Declare|\x|Caption|\x|Sub|\x|Type|. +% with |\Declare|\-|Caption|\-|Sub|\-|Type|. % \begin{macrocode} \newcommand*\caption@subtypelist{} % \end{macrocode} @@ -3642,7 +3718,7 @@ % \begin{macrocode} \def\sf@NEW@subfloat{% \begingroup - \@nameuse{caption@warmup}% + \@nameuse{caption@warmup}% \caption@setfloattype\@captype \sf@ifpositiontop{% \maincaptiontoptrue diff --git a/Master/texmf-dist/source/latex/caption/newfloat.dtx b/Master/texmf-dist/source/latex/caption/newfloat.dtx index 00f04984a80..05198f0d5f4 100644 --- a/Master/texmf-dist/source/latex/caption/newfloat.dtx +++ b/Master/texmf-dist/source/latex/caption/newfloat.dtx @@ -2,7 +2,7 @@ % % This is file `newfloat.dtx'. % -% Copyright (C) 2011 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% Copyright (C) 2011-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) % % -------------------------------------------------------------------------- % @@ -25,13 +25,13 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{1204} +% \CheckSum{1291} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesFile{newfloat.drv}% - [2011/11/06 v1.0 This package offers a command for defining new floating environments] + [2012/05/18 v1.0 This package offers a command for defining new floating environments] \hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up. % \documentclass{ltxdoc} @@ -117,7 +117,7 @@ % where \meta{options} are one or more of % \begin{quote}\begin{tabular}{r@{\,}l} % |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\quad\\ -% |chapterlistsgap=| & \meta{value} +% |chapterlistsgap=| & \meta{value}~\footnotemark[1] % \end{tabular}\end{quote} % % The ``within'' counter specifies the counter which will be used to reset @@ -167,8 +167,13 @@ % |name=| & \meta{prosa name}\\ % |placement=| & \meta{combination of \,\purett{htbp}}\\ % |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\\ -% |chapterlistsgaps=| & \texttt{on} \emph{or} \texttt{off} +% |chapterlistsgaps=| & \texttt{on} \emph{or} \texttt{off}~\footnotemark[1] % \end{tabular}\end{quote} +% \footnotetext[1]{Please note that although \thispackage\ tries hard to offer this +% option it may not be available or is working incorrectly in cooperation with +% your document class since there is no standard interface which we could use +% for that purpose. Therefore we have to try to patch the \cs{chapter} command, +% and if this fails, we try to patch \cs{addtocontents} (in an unusual way) instead.} % % If no \meta{options} are given, % ``lo\meta{type}'' will be used as \meta{file extension} for the list, @@ -447,16 +452,20 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{newfloat}[2011/11/16 v1.0a Defining new floating environments (AR)] +\ProvidesPackage{newfloat}[2012/05/19 v1.0b Defining new floating environments (AR)] % \end{macrocode} % % \begin{macro}{\newfloat@Info} +% \begin{macro}{\newfloat@InfoNoLine} % |\newfloat@Info|\marg{message} % \begin{macrocode} \newcommand*\newfloat@Info[1]{% \PackageInfo{newfloat}{#1}} +\newcommand*\newfloat@InfoNoLine[1]{% + \newfloat@Info{#1\@gobble}} % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\newfloat@Error} % |\newfloat@Error|\marg{message} @@ -947,6 +956,7 @@ % \end{macro} % % \begin{macro}{\newfloat@addtolist} +% \changes{v1.0b}{2012/05/18}{Bugfix: Definition of \cs{@ifchapterlistsgap@}\meta{environment} added} % |\newfloat@addtolist|\marg{environment} % adds an environment to the list of floating environments. % \begin{macrocode} @@ -955,6 +965,8 @@ \ifcsname ext@#1\endcsname \@cons\newfloat@list{{#1}}% \@namedef{newfloat@ext@\@nameuse{ext@#1}}{#1}% + \@ifundefined{@ifchapterlistsgap@#1}{% + \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden}{}% \else \newfloat@Error{`#1' does not seem to be a floating environment}% \fi}} @@ -1015,7 +1027,7 @@ % \begin{macrocode} \providecommand*\@@addchapterlistsgap[2]{% \@ifundefined{@addchapterlistsgap@#2}{% only once per extension - \@namedef{@addchapterlistsgap@#2}{}% + \@namedef{@addchapterlistsgap@#2}{#1}% \@@@addchapterlistsgap{#2}}{}} % \end{macrocode} % \begin{macrocode} @@ -1027,14 +1039,16 @@ % \end{macro} % % \begin{macro}{\@addchapterlistsgaps} +% \changes{v1.0b}{2012/05/18}{Bugfix: Group added to make \cs{@addchapterlistsgap} work correctly} % |\@addchapterlistsgaps|\par % will add the chapter lists gaps for all floating environments in |\newfloat@list|. % \begin{macrocode} \providecommand*\@addchapterlistsgaps{% - \def\@elt##1{% - \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% - \newfloat@list - \let\@elt\relax} + \begingroup + \def\@elt##1{% + \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% + \newfloat@list + \endgroup} % \end{macrocode} % \end{macro} % @@ -1119,11 +1133,42 @@ % \end{macro} % \end{macro} % +% \begin{macro}{planb=} +% \changes{v1.0b}{2012/05/18}{This option added} +% This option switches the `Plan B' on or off. (default$=$off) +% \begin{macrocode} +\define@key{newfloat}{planb}[true]{% + \def\@tempa{#1}% + \def\@tempb{false}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@gobble + \else + \def\@tempb{true}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@iden + \else + \newfloat@Error{Invalid value `#1' for option `planb'}% + \fi + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{planb-filext=} +% \changes{v1.0b}{2012/05/19}{This option added} +% This option sets the file extension used for `Plan B'. +% (default$=$use the 1st one which seem to fit) +% \begin{macrocode} +\define@key{newfloat}{planb-fileext}{% + \newfloat@Info{Setting Plan B file extension to `#1'} + \xdef\newfloat@addtocontents@ext{#1}} +% \end{macrocode} +% \end{macro} + +% % Process the package options: % We use |\setkeys| here instead of |\ProcessOptions|. % \begin{macrocode} \let\@tempc\relax -\@expandtwoargs\setkeys{newfloat}{\@ptionlist{\@currname.\@currext}}% +\@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}% \AtEndOfPackage{\let\@unprocessedoptions\relax} % \end{macrocode} % @@ -1473,14 +1518,45 @@ % \pagebreak[3] % \subsubsection{Compatibility warning} % -% If we were not able to patch |\@chapter| a warning message is issued -% since we are not able to support chapter lists gaps then. % \begin{macrocode} \ifx\newfloat@replace@chapter\@gobbletwo \else - \PackageWarningNoLine{newfloat}{% - Unsupported document class, or\MessageBreak - \noexpand\@chapter was already redefined by another package} - \newfloat@Info{\string\@chapter\space=\space\meaning\@chapter} +% \end{macrocode} +% If we were not able to patch |\@chapter| an info message is issued +% since we may not be able to support chapter lists gaps then. +% \begin{macrocode} + \newfloat@InfoNoLine{% + Unsupported document class, or \noexpand\@chapter\MessageBreak + was already redefined by another package} + \newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter} + \newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter} +% \end{macrocode} +% Plan B: We patch |\addtocontents| instead, and keep our fingers crossed in the hope +% that this redefinition actually will fit. +% \begin{macrocode} + \newfloat@ifplanb{% + \newfloat@InfoNoLine{Trying Plan B..}% + \let\newfloat@addtocontents@ORI\addtocontents + \long\def\addtocontents#1#2{% + \newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}% + \long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{% + \def\newfloat@tempa{#4}% + \ifx\newfloat@tempa\@empty + \newfloat@addtocontents@ORI{#1}{#2}% + \else + \ifx\newfloat@addtocontents@ext\@undefined + \newfloat@Info{Setting Plan B file extension to `#1'...}% + \xdef\newfloat@addtocontents@ext{#1}% + \fi + \edef\newfloat@tempa{#1}% + \ifx\newfloat@tempa\newfloat@addtocontents@ext + \begingroup + \let\addtocontents\newfloat@addtocontents@ORI + \@addchapterlistsgaps + \endgroup + \fi + \fi}} +% \end{macrocode} +% \begin{macrocode} \fi % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx index ae8350c876e..13d365884a8 100644 --- a/Master/texmf-dist/source/latex/caption/subcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx @@ -25,12 +25,12 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{143} +% \CheckSum{133} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{subcaption.drv}[2011/08/29 v1.1 Adds a sub-caption feature to the caption package] +\ProvidesFile{subcaption.drv}[2012/05/18 v1.1 Adds a sub-caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -52,7 +52,7 @@ \fi % \usepackage[bottom]{footmisc} -\usepackage{array,graphicx,overpic,pict2e,slashbox} +\usepackage{array,graphicx,overpic,pict2e,diagbox} \IfFileExists{test/tlc2/cat.eps}{\graphicspath{{test/tlc2/}}}{}% % \PassOptionsToPackage{breaklinks=true}{hyperref} @@ -282,7 +282,18 @@ % \DescribeEnv{subtable} % 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. +% arguments as the |mini|\-|page| environment: +% \begin{quote} +% |\begin{subfigure}|\oarg{pos}\marg{width}\\ +% \ldots\\ +% |\end{subfigure}| +% \end{quote} +% and +% \begin{quote} +% |\begin{subtable}|\oarg{pos}\marg{width}\\ +% \ldots\\ +% |\end{subtable}| +% \end{quote} % 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 |sub|\-|figure| environment: @@ -305,13 +316,11 @@ % \item You can override the setttings for a specific subcaption % with a |\caption|\-|setup| inside the |sub|\-|figure| or |sub|\-|table| environment, e.g.: % \begin{quote} -% \ldots\\ % |\begin{subfigure}[b]{.5\linewidth}|\\ % | \centering\large A|\\ % | |\textcolor{blue}{\cs{captionsetup}\csmarg{skip=3pt}}\\ % | \caption{A subfigure}\label{fig:1a}|\\ % |\end{subfigure}|\\ -% \ldots % \end{quote} % \item Hyperlinks targeted to this subfigure will jump to the beginning % of the subfigure, and not to the caption of the subfigure @@ -333,8 +342,11 @@ % \section{The \cs{subcaptionbox} command} % % \DescribeMacro\subcaptionbox -% A more powerful (but less flexible) way of setting sub-figures is -% offered by the |\sub|\-|caption|\-|box| command. Its syntax is: +% A different way of setting sub-figures is +% offered by the |\sub|\-|caption|\-|box| command, which automatically +% aligns the sub-figures resp.~sub-tables by their very first caption line. +% +% Its syntax is: % \begingroup % \leftmargini=12pt % \begin{quote} @@ -882,14 +894,14 @@ % \subsection{Identification} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{subcaption}[2012/01/12 v1.1d Sub-captions (AR)] +\ProvidesPackage{subcaption}[2012/04/09 v1.1f Sub-captions (AR)] % \end{macrocode} % % \subsection{Initial code} % % Since we base on the \package{caption} package we load it here. % \begin{macrocode} -\RequirePackage{caption}[2011/08/18] % needs v3.2b or newer +\RequirePackage{caption}[2012/03/25] % needs v3.3 or newer % \end{macrocode} % \changes{v1.1b}{2011/09/01}{Compatibility error added} % \begin{macrocode} @@ -902,18 +914,20 @@ % Since we are incompatible to them an error message will be issued when % the \package{subfigure} or \package{subfig} package is loaded. % \begin{macrocode} -\caption@ifundefined\subfigure{}{% - \PackageError{subcaption}{% - This package can't be used in cooperation\MessageBreak - with the subfigure package}{RTFM}% - \endinput} +\@ifpackageloaded{subfigure}{% + \PackageError{subcaption}% + {This package can't be used in cooperation\MessageBreak + with the subfigure package}% + {RTFM}% + \endinput}{}% % \end{macrocode} % \begin{macrocode} -\caption@ifundefined\subfloat{}{% - \PackageError{subcaption}{% - This package can't be used in cooperation\MessageBreak - with the subfig package}{RTFM}% - \endinput} +\@ifpackageloaded{subfig}{% + \PackageError{subcaption}% + {This package can't be used in cooperation\MessageBreak + with the subfig package}% + {RTFM}% + \endinput}{}% % \end{macrocode} % % \iffalse @@ -945,12 +959,14 @@ % \subsubsection{The \cs{subcaption} command} % % \begin{macro}{\subcaption} +% \changes{v1.1f}{2012/04/06}{\cs{newcommand} changed to \cs{def} +% so it works with the \puresf{memoir} document class, too} % Without a prefacing |\set|\-|caption|\-|sub|\-|type|, |\sub|\-|caption| is some kind % of |\caption|\-|of{sub|\-|\@cap|\-|type}|. % \Note{Like \cs{captionof}, this command is designed to be used inside an % own group!} % \begin{macrocode} -\newcommand*\subcaption{% +\def\subcaption{% \caption@iftype {\setcaptionsubtype*\caption}% {\caption@Error{\noexpand\subcaption outside float}% @@ -1015,11 +1031,11 @@ % \changes{v1.0b}{2008/08/31}{Definition and usage of \cs{subcaption@hrule} added} % \changes{v1.0c}{2010/12/17}{Uses \cs{caption@box} now} % \changes{v1.1}{2011/08/16}{Adapted to actual version of \cs{caption@box}} +% \changes{v1.1f}{2012/04/09}{Adapted to actual version of \cs{caption@ibox}} % A |\parbox| with contents and sub-caption, separated by an invisible |\hrule|. % \begin{macrocode} \newcommand*\subcaptionbox{% - \let\captionbox@settype\setcaptionsubtype - \caption@withoptargs\caption@box} + \caption@withoptargs{\caption@ibox\setcaptionsubtype}} % \end{macrocode} % \end{macro} % @@ -1060,21 +1076,20 @@ % \changes{v1.1}{2011/08/14}{Caption option \opt{subrefformat=} added} % \changes{v1.1a}{2011/08/18}{Uses \cs{caption@setoptions*} now} % \changes{v1.1d}{2012/01/12}{Usage of \cs{caption@setoptions*} replaced by \cs{caption@setoptions}} +% \changes{v1.1f}{2012/04/09}{Revised} % This one calls |\ref| with the second label. (see |\subcaption@label|) % \begin{macrocode} \DeclareRobustCommand*\subref{% - \@ifstar{\subcaption@ref*}\@subref} -\newcommand*\@subref{% - \caption@withoptargs\@@subref} -\newcommand*\@@subref[2]{% + \@ifstar + {\caption@withoptargs\subcaption@ref*}% + {\caption@withoptargs\@subref}} +\newcommand*\@subref[2]{% \caption@ifundefined\hyperref - {\subcaption@ref#1{#2}}% - {\hyperref[#2]{\subcaption@ref*#1{#2}}}} + {\subcaption@ref{#1}{#2}}% + {\hyperref[#2]{\subcaption@ref{*#1}{#2}}}} % \end{macrocode} % \begin{macrocode} -\newcommand*\subcaption@ref{% - \caption@withoptargs\subcaption@@ref} -\newcommand*\subcaption@@ref[2]{% +\newcommand*\subcaption@ref[2]{% \begingroup \caption@setoptions{sub}% \subcaption@reffmt\p@subref{\ref#1{sub@#2}}% |