diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/subcaption.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/caption/subcaption.dtx | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx index 27226210f65..9727cbd4b57 100644 --- a/Master/texmf-dist/source/latex/caption/subcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx @@ -25,12 +25,12 @@ % caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{139} +% \CheckSum{149} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{subcaption.drv}[2011/08/17 v1.1 Adds a sub-caption feature to the caption package] +\ProvidesFile{subcaption.drv}[2011/08/29 v1.1 Adds a sub-caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -201,7 +201,7 @@ % \item Environmental `sub' settings % {\small(|\captionsetup[subfigure|\emph{ -or- }|subtable]{|\ldots|}|)} % \item Local `sub' settings -% {\small(|\captionsetup{|\ldots|}| inside |subfigure| or |subtable|)} +% {\small(|\captionsetup{|\ldots|}| inside |sub|\-|figure| or |sub|\-|table|)} % \end{enumerate} % An example: % \begin{quote} @@ -210,7 +210,7 @@ % |\captionsetup[table]{textfont=it,position=top}|\\ % |\captionsetup[subtable]{textfont=sf}| % \end{quote} -% causes the captions inside |subtable| environments to be typeset with +% causes the captions inside |sub|\-|table| environments to be typeset with % the settings % \begin{quote} % |indention=10pt,position=top,margin=0pt,font=small,|\\ @@ -281,12 +281,12 @@ % % \DescribeEnv{subfigure} % \DescribeEnv{subtable} -% After loading \thispackage\ the new environments |subfigure| and -% |subtable| are available, which have the same (optional \& mandatory) -% arguments as the |minipage| environment. +% After loading \thispackage\ the new environments |sub|\-|figure| and +% |sub|\-|table| are available, which have the same (optional \& mandatory) +% arguments as the |mini|\-|page| environment. % Inside these environments you use the ordinary |\caption| command % for typesetting captions. So this example is the same as the last one, -% but uses the |subfigure| environment: +% but uses the |sub|\-|figure| environment: % \begin{quote} % |\begin{figure}|\\ % | \begin{|\textcolor{blue}{\texttt{subfigure}}|}[b]{.5\linewidth}|\\ @@ -300,11 +300,11 @@ % | \caption{A figure}\label{fig:1}|\\ % |\end{figure}| % \end{quote} -% Using the |subfigure| or |subtable| environment instead of |\subcaption| +% Using the |sub|\-|figure| or |sub|\-|table| environment instead of |\subcaption| % has two advantages: % \begin{itemize} % \item You can override the setttings for a specific subcaption -% with a |\captionsetup| inside the |subfigure| or |subtable| environment, e.g.: +% with a |\caption|\-|setup| inside the |sub|\-|figure| or |sub|\-|table| environment, e.g.: % \begin{quote} % \ldots\\ % |\begin{subfigure}[b]{.5\linewidth}|\\ @@ -327,7 +327,7 @@ % environments with |\set|\-|caption|\-|sub|\-|type| as first contents line. % These environments are defined with the help of % |\caption@For{subtypelist}|, which executes code for every sub-type -% declared with |\DeclareCaptionSubType|. +% declared with |\Declare|\-|Caption|\-|Sub|\-|Type|. % \end{background} % % \PageBreak @@ -363,7 +363,7 @@ % Using |\sub|\-|caption|\-|box|, the baseline of the resulting box will be placed % right between contents and heading, so usually you don't have to care about the % vertical alignment of the sub-figures for yourself. -% Also the hyperlink anchor is placed properly with respect to the |hypcap=| +% Also the hyperlink anchor is placed properly with respect to the |hyp|\-|cap=| % setting. % % One example: @@ -395,7 +395,7 @@ % As you see the result is not satisfying; % the caption below the cat looks ugly because of the small width of the % graphic. This can be solved by using the optional arguments of -% |\caption|\-|box|, increasing the width of the resulting box: +% |\sub|\-|caption|\-|box|, increasing the width of the resulting box: % \begin{quote} % | |\ldots\\ % | \subcaptionbox{A cat\label{cat}}|\\ @@ -417,7 +417,7 @@ % Furthermore the main caption, which is centered with respect to the % |\text|\-|width|, looks mis-aligned with respect to the sub-captions. % This can (again) be solved by using the optional arguments of -% |\caption|\-|box|, giving both boxes the same width, for example: +% |\sub|\-|caption|\-|box|, giving both boxes the same width, for example: % \begin{quote} % | |\ldots\\ % | \subcaptionbox{A cat\label{cat}}|\\ @@ -666,14 +666,14 @@ % \noindent\begin{minipage}{\linewidth} % \setcaptiontype{figure} % \centering -% \begin{overpic}[width=60pt]{cat} +% {\begin{overpic}[width=60pt]{cat} % \put(40,34){(a)} % \end{overpic} -% {\phantomsubcaption\label{cat6.3}} -% \begin{overpic}[width=.4\textwidth]{elephant} +% \phantomsubcaption\label{cat6.3}} +% {\begin{overpic}[width=.4\textwidth]{elephant} % \put(60,50){(b)} % \end{overpic} -% {\phantomsubcaption\label{elephant6.3}} +% \phantomsubcaption\label{elephant6.3}} % \captionsetup{subrefformat=parens} % \caption{Two animals: \subref{cat6.3} a huge cat, and \subref{elephant6.3} an elephant} % \end{minipage} @@ -883,7 +883,7 @@ % \subsection{Identification} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{subcaption}[2011/08/18 v1.1a Adding subcaptions (AR)] +\ProvidesPackage{subcaption}[2011/09/12 v1.1b Sub-captions (AR)] % \end{macrocode} % % \subsection{Initial code} @@ -892,6 +892,13 @@ % \begin{macrocode} \RequirePackage{caption}[2011/08/18] % needs v3.2b or newer % \end{macrocode} +% \changes{v1.1b}{2011/09/01}{Compatibility error added} +% \begin{macrocode} +\caption@AtBeginDocument{\caption@ifcompatibility{% + \caption@Error{% + The `subcaption' package does not work correctly\MessageBreak + in compatibility mode}}{}} +% \end{macrocode} % % Since we are incompatible to them an error message will be issued when % the \package{subfigure} or \package{subfig} package is loaded. @@ -949,7 +956,7 @@ \caption@iftype {\setcaptionsubtype*\caption}% {\caption@Error{\noexpand\subcaption outside float}% - \caption@withoptargs\@gobbletwo}}% + \caption@gobble}}% % \end{macrocode} % But with a prefacing |\set|\-|caption|\-|sub|\-|type|, |\sub|\-|caption| is simply % |\caption|. @@ -1031,15 +1038,22 @@ % \end{macrocode} % % \begin{macro}{\subcaption@label} +% \changes{v1.1b}{2011/09/12}{Redefinition of \cs{SK@} added} +% \changes{v1.1b}{2011/09/12}{Uses \cs{caption@withoptargs} now} % When a label will be placed for a sub-caption, we automatically place % a second one for |\subref|, too. This second label will contain % the sub-type counter only. % \begin{macrocode} -\newcommand*\subcaption@label[1]{% +\newcommand*\subcaption@label{ + \caption@withoptargs\subcaption@@label} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\subcaption@@label[2]{% \@bsphack\begingroup - \subcaption@ORI@label{#1}% + \subcaption@ORI@label#1{#2}% + \let\SK@\@gobbletwo \protected@edef\@currentlabel{\csname thesub\@captype\endcsname}% - \subcaption@ORI@label{sub@#1}% + \subcaption@ORI@label#1{sub@#2}% \endgroup\@esphack} % \end{macrocode} % \end{macro} |