diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-04-07 13:23:56 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-04-07 13:23:56 +0000 |
commit | f3293da79b2d98143874b2594dac2dbafa167d1c (patch) | |
tree | 6815bade64d06cf7c97c28304e756fc25bf38035 /Master/texmf-dist/source/latex/caption | |
parent | 41fdc70e57b74afa2a63e751e435055e5dfe7c58 (diff) |
The caption package v3.1h
git-svn-id: svn://tug.org/texlive/trunk@7346 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/caption')
-rw-r--r-- | Master/texmf-dist/source/latex/caption/caption.dtx | 174 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/ltcaption.dtx | 47 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/caption/subcaption.dtx | 138 |
3 files changed, 248 insertions, 111 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx index 5019819460b..a489d57fe58 100644 --- a/Master/texmf-dist/source/latex/caption/caption.dtx +++ b/Master/texmf-dist/source/latex/caption/caption.dtx @@ -24,12 +24,12 @@ % user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{6216} +% \CheckSum{6230} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{caption.drv}[2008/03/20 v3.1g Implementation of the caption package] +\ProvidesFile{caption.drv}[2008/04/01 v3.1h Implementation of the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % @@ -56,7 +56,7 @@ \ifpdf\usepackage{hypdestopt}\fi \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}} % -\usepackage[debug]{caption}[2008/03/01] +\usepackage[debug]{caption}[2008/04/01] % \DeclareRobustCommand*\eTeX{\texorpdfstring {\leavevmode\hbox{$\varepsilon$}-\TeX}% @@ -233,7 +233,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2008/03/20 v3.1g caption3 kernel (AR)] +\ProvidesPackage{caption3}[2008/03/20 v3.1h caption3 kernel (AR)] % \end{macrocode} % % \subsection{Generic helpers} @@ -3226,7 +3226,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2008/03/20 v3.1g Customizing captions (AR)] +\ProvidesPackage{caption}[2008/04/01 v3.1h Customizing captions (AR)] %\@ifundefined{PackageRedefines}{}{\PackageRedefines{caption}{caption}} % \end{macrocode} % @@ -3243,7 +3243,7 @@ % \subsection{Loading the kernel} % % \begin{macrocode} -\RequirePackage{caption3}[2008/03/01] % needs v3.1g +\RequirePackage{caption3}[2008/03/20] % needs v3.1g or newer % \end{macrocode} % % \subsection{Check against incompatible packages} @@ -3263,36 +3263,30 @@ % \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added} % \begin{macrocode} \caption@AtBeginDocument{% - \@ifpackageloaded{ftcap}{% - \caption@IncompatiblePackage{ftcap}{}% - }{}% - \@ifpackageloaded{nonfloat}{% - \caption@IncompatiblePackage{nonfloat}{.\MessageBreak - Furthermore you should use \noexpand\captionof instead of\MessageBreak - \noexpand\figcaption or \string\tabcaption}% - }{}% - \@ifpackageloaded{topcapt}{% - \caption@IncompatiblePackage{topcapt}{}% - }{}% -} + \@ifpackageloaded{ftcap}{\caption@DisablePositionOption{ftcap}}{}% + \@ifpackageloaded{nonfloat}{\caption@DisablePositionOption{nonfloat}}{}% + \@ifpackageloaded{topcapt}{\caption@DisablePositionOption{topcapt}}{}} % \end{macrocode} -% -% \begin{macro}{\caption@Incompatible} +% \begin{macro}{\caption@DisablePositionOption} % \changes{v3.1g}{2008/03/20}{\texttt{position=b} added} -% Issue an `incompatible' warning. +% \changes{v3.1h}{2008/03/29}{% +% Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption}; +% moved from package to kernel; disables the `position' option now instead of issuing a warning} +% |\caption@DisablePositionOption|\marg{package}\par +% disables the `position' option. % \begin{macrocode} -\newcommand*\caption@IncompatiblePackage[2]{% - \PackageWarningNoLine{caption}{% - Usage of the #1 package together with the\MessageBreak - caption package is strongly not recommended.\MessageBreak - Instead of loading the #1 package you should\MessageBreak - use the caption package option\MessageBreak - \space\space`tableposition=top'#2}% - \caption@Info{Setting position=b for compatibility reasons}% - \caption@setposition b} +\newcommand*\caption@DisablePositionOption[1]{% + \caption@Info{% + `#1' package detected; setting `position=b' for compatibility reasons}% + \caption@setposition b% +% \end{macrocode} +% \begin{macrocode} + \DeclareCaptionOption{position}{% + \caption@Error{Usage of the `position' option is incompatible\MessageBreak + to the `#1' package}}} % \end{macrocode} % \begin{macrocode} -\@onlypreamble\caption@IncompatiblePackage +\@onlypreamble\caption@DisablePositionOption % \end{macrocode} % \end{macro} % @@ -3349,15 +3343,6 @@ % % \begin{macrocode} \if@tablecaptionabove - \caption@AtBeginDocument{% - \def\caption@tempa#1{% - \@ifpackageloaded{#1}{\caption@Error{% - You can't use the global option\MessageBreak - \space\space`tablecaptionabove'\MessageBreak - and use the #1 package, too}}{}}% - \caption@tempa{ftcap}% - \caption@tempa{nonfloat}% - \caption@tempa{topcapt}}% \@tablecaptionabovetrue \else \@tablecaptionabovefalse @@ -3503,15 +3488,6 @@ % \end{macrocode} % \begin{macrocode} \DeclareCaptionOption{tableposition}{% - \caption@AtBeginDocument{% - \def\caption@tempa##1{% - \@ifpackageloaded{##1}{\caption@Error{% - You can't use the caption package option\MessageBreak - \space\space`tableposition=#1'\MessageBreak - and use the ##1 package, too}}{}}% - \caption@tempa{ftcap}% - \caption@tempa{nonfloat}% - \caption@tempa{topcapt}}% \captionsetup*[table]{position=#1}} \@onlypreamble@key{caption}{tableposition} % \end{macrocode} @@ -6741,7 +6717,7 @@ }{} % \end{macrocode} % -% \subsubsection{The supertabular package} +% \subsubsection{The supertabular and xtab packages} % % \begin{macrocode} \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{% @@ -6749,15 +6725,30 @@ % % \begin{macro}{\tablecaption} % \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work} +% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore} % Make |\topcaption*| and |\bottomcaption*| work. % \begin{macrocode} - \let\caption@ORI@tablecaption\tablecaption - \def\tablecaption{\caption@star\relax\caption@ORI@tablecaption}% + \renewcommand*\tablecaption{% + \caption@star + {\refstepcounter{table}}% + {\caption@dblarg{\@xtablecaption}}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xtablecaption} +% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work} +% Make |\nameref| and |\autoref| work. +% \begin{macrocode} + \let\caption@ORI@xtablecaption\@xtablecaption + \long\def\@xtablecaption[#1]#2{% + \def\@currentlabelname{#2}% + \caption@ORI@xtablecaption[#1]{#2}}% % \end{macrocode} % \end{macro} % % \begin{macro}{\ST@caption} % \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added} +% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now} % The original code: % \begin{verbatim} % \long\def\ST@caption#1[#2]#3{\par% @@ -6794,9 +6785,76 @@ % \end{macro} % % \begin{macrocode} -}{% - \let\caption@setSTposition\@undefined -} +}{} +% \end{macrocode} +% +% \changes{v3.1h}{2008/04/01}{Support of the xtab package added} +% \begin{macrocode} +\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{% +% \end{macrocode} +% +% \begin{macro}{\tablecaption} +% Make |\topcaption*| and |\bottomcaption*| work. +% \begin{macrocode} + \renewcommand*\tablecaption{% + \caption@star + {\refstepcounter{table}}% + {\caption@dblarg{\@xtablecaption}}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@xtablecaption} +% Make |\nameref| and |\autoref| work. +% \begin{macrocode} + \let\caption@ORI@xtablecaption\@xtablecaption + \long\def\@xtablecaption[#1]#2{% + \def\@currentlabelname{#2}% + \caption@ORI@xtablecaption[#1]{#2}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ST@caption} +% The original code: +% \begin{verbatim} +% \long\def\ST@caption#1[#2]#3{\par% +% \@initisotab +% \addcontentsline{\csname ext@#1\endcsname}{#1}% +% {\protect\numberline{% +% \csname the#1\endcsname}{\ignorespaces #2}} +% \begingroup +% \@parboxrestore +% \normalsize +% %% \if@topcaption \vskip -10\p@ \fi +% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par +% %% \if@topcaption \vskip 10\p@ \fi +% \endgroup +% \global\advance\ST@pageleft -\PWSTcapht +% \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft} +% } +% \end{verbatim}%^^A +% \begin{macrocode} + \long\def\ST@caption#1[#2]#3{\par% + \caption@settype*{#1}% + \caption@setoptions{xtabular}% +% \end{macrocode} +% \begin{macrocode} + \def\caption@fixposition{% + \caption@setposition{\if@topcaption t\else b\fi}}% +% \end{macrocode} +% \begin{macrocode} + \@initisotab + \caption@beginex{#1}{#2}{#3}% + \caption@boxrestore + \caption@normalsize + \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par + \caption@end + \global\advance\ST@pageleft -\PWSTcapht + \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +}{} % \end{macrocode} % % \subsubsection{The threeparttable package} @@ -7152,6 +7210,12 @@ % {\emph{WRAPFIG.STY ver 3.6}},\\ % 2003/01/31 % +% \bibitem{xtab} +% Peter Wilson:\\ +% \href{http://tug.ctan.org/tex-archive/macros/latex/contrib/xtab/}% +% {\emph{The xtab package}},\\ +% 2004/05/24 +% % \bibitem{Anne} % Anne Br\"uggemann-Klein:\\ % \emph{Einf\"uhrung in die Dokumentverarbeitung},\\ diff --git a/Master/texmf-dist/source/latex/caption/ltcaption.dtx b/Master/texmf-dist/source/latex/caption/ltcaption.dtx index 2b77a784b5d..8963d46dfcb 100644 --- a/Master/texmf-dist/source/latex/caption/ltcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/ltcaption.dtx @@ -24,13 +24,13 @@ % user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{336} +% \CheckSum{340} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesFile{ltcaption.drv}% - [2007/10/03 v1.1 This package fixes caption problems with + [2008/03/28 v1.2 This package fixes caption problems with other-than-centered aligned longtables] \hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up. % @@ -114,6 +114,14 @@ % % \subsection{Further justification} % +% \DescribeMacro{\LTcapskip} +% This length is controlling the skip between the caption and the contents +% below the caption and can be altered with |\setlength\LTcapskip{|\ldots|}|. +% When \thispackage\ is loaded it will be set to |\abovecaptionskip| which +% usually represents the skip between caption and contents in floating +% environments. +% (Without this package, the \package{longtable} package uses |\baselineskip| here.) +% % \DescribeMacro{\LTcapleft} % \DescribeMacro{\LTcapright} % You can alter the centering of the caption box (of width |\LTcapwidth|) @@ -132,9 +140,9 @@ % captions as well. % % \emph{Note:} -% These commands do not work when used with one of the \KOMAScript\ -% classes\cite{KOMAScript} |scrartcl|, |scrreprt| or |scrbook|, -% the \KOMAScript\ settings for captions are used instead. +% These lengths \& commands do not work when \thispackage\ is used with one +% of the \KOMAScript\ classes\cite{KOMAScript} |scrartcl|, |scrreprt| or +% |scrbook|, the \KOMAScript\ settings for captions are used instead. % Same with the \package{caption} package which also uses its own options % and settings. % @@ -155,9 +163,9 @@ % \setcounter{figure}{6} % \begingroup % \renewcommand\LTcaptype{figure} -% \begin{longtable}{ll} +% \begin{longtable}{l} % \caption{An example longtable}\\ -% A & B \\ +% \ldots \\ % \end{longtable} % \endgroup % @@ -344,6 +352,7 @@ % \fi % % \StopEventually{%^^A +% \pagebreak[3] % \begin{thebibliography}{9} % \bibitem{longtable} % David Carlisle: @@ -439,7 +448,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{ltcaption}[2008/03/21 v1.1a longtable captions (AR)] +\ProvidesPackage{ltcaption}[2008/03/28 v1.2 longtable captions (AR)] % \end{macrocode} % % \subsection{User interface} @@ -459,8 +468,7 @@ % \begin{macrocode} \@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{% \@ifpackageloaded{listings}{% - \providecommand*\ext@lstlisting{lol}% - }{}} + \providecommand*\ext@lstlisting{lol}}{}} % \end{macrocode} % \end{macro} % @@ -474,6 +482,13 @@ % \changes{v1.1}{2007/04/20}{The skips will not be defined if the % \package{caption} package is loaded} % +% \begin{macro}{\LTcapskip} +% \changes{v1.2}{2007/03/28}{This skip added} +% \begin{macrocode} + \newskip\LTcapskip \LTcapskip=\abovecaptionskip +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\LTcapleft} % \begin{macro}{\LTcapright} % \begin{macro}{\ifLTcapmargins} @@ -518,8 +533,6 @@ % i.e. |\AtBeginDocument|. % \begin{macrocode} \@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{% -% \end{macrocode} -% \begin{macrocode} \let\ltcaption@ORI@LT@array\LT@array \renewcommand*\LT@array{% % \end{macrocode} @@ -542,10 +555,7 @@ \def\lst@@caption{\relax}% % \end{macrocode} % \begin{macrocode} - \ltcaption@ORI@LT@array}% -% \end{macrocode} -% \begin{macrocode} -} + \ltcaption@ORI@LT@array}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@LTtype[2]{% @@ -592,6 +602,8 @@ % % \begin{macro}{\LT@makecaption} % \changes{v1.1}{2007/04/20}{\cs{LT@@makecaption} added} +% \changes{v1.1}{2007/06/27}{Adapted to the \package{floatrow} package by Olga Lapko} +% \changes{v1.2}{2007/03/28}{Uses \cs{LTcapskip} instead of \cs{baselineskip} now} % |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par % \smallskip % Original code: @@ -610,7 +622,6 @@ % \hss}}} % \end{verbatim}%^^A % Our code:\footnote{Adapted to the \package{floatrow} package by Olga Lapko} -% \changes{v1.1}{2007/06/27}{Adapted to the \package{floatrow} package by Olga Lapko} % \begin{macrocode} \renewcommand\LT@makecaption[3]{% \LT@@makecaption{% @@ -620,7 +631,7 @@ \else \hbox to\hsize{\hfil\box\@tempboxa\hfil}% \fi - \endgraf\vskip\baselineskip}} + \endgraf\vskip\LTcapskip}} % \end{macrocode} % \begin{macrocode} \newcommand\LT@@makecaption[1]{% diff --git a/Master/texmf-dist/source/latex/caption/subcaption.dtx b/Master/texmf-dist/source/latex/caption/subcaption.dtx index 6a8d6b6e17f..defb3b40dae 100644 --- a/Master/texmf-dist/source/latex/caption/subcaption.dtx +++ b/Master/texmf-dist/source/latex/caption/subcaption.dtx @@ -24,12 +24,12 @@ % user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{144} +% \CheckSum{204} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{subcaption.drv}[2008/01/12 v0.3 Adds a sub-caption feature to the caption package] +\ProvidesFile{subcaption.drv}[2008/03/30 v0.3 Adds a sub-caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -75,13 +75,17 @@ \newcommand*\x{\discretionary{}{}{}} % \usepackage{marvosym} +\makeatletter +\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}} +\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}} +\makeatother +% +\usepackage[alpine]{ifsym} +\newenvironment{background}{\par\bigskip\csname background*\endcsname}{\csname endbackground*\endcsname} +\newenvironment{background*}{\small\MARGINSYM{\Mountain}\ignorespaces}{\par} +% \newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}} -\newenvironment{info}{\par\bigskip\csname info*\endcsname}{\csname endinfo*\endcsname} -\newenvironment{info*}% - {\small - \MARGINSYM{\vbox to \ht\strutbox{\LARGE\Info}}% - \ignorespaces}% - {\par} +%\newcommand*\NEW[2]{}%\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}} % \begin{document} \DocInput{subcaption.dtx} @@ -121,26 +125,30 @@ % \package{caption} package. % \end{abstract} % -% \subsection*{Introduction} -% \begin{info*} -% Prepared with either |\Declare|\-|Caption|\-|Sub|\-|Type| (offered by the -% \package{caption} package) or |\new|\-|sub|\-|float| (offered by the -% \package{subfig} package), the caption package option |subtype| becames -% available, causing |\caption| to typeset a sub-caption instead of an -% ordinary one.\par +% \begin{background} +% At the end of each section, text marked with the mountain symbol +% will contain background knowledge on how the particular command or +% environment is actually implemented. +% If you just want to use this package as it is, you don't have to read or +% understand them. +% \end{background} +% +% \begin{background*} % This package demonstrates the usage of |\Declare|\-|Caption|\-|Sub|\-|Type|, % |\caption|\-|setup{sub|\-|type}|, and the internal hook -% |\caption@sub|\-|type|\-|hook|. -% \end{info*} +% |\caption@sub|\-|type|\-|hook| (offered by the \package{caption} package). +% \end{background*} % % \setcounter{tocdepth}{2} % \tableofcontents % +% \iffalse % \vfill +% \INFO* % \emph{Please note:} % This package is incompatible with the \package{subfigure} and \package{subfig} % packages. -% \medskip +% \fi % % \clearpage % \section{The user interface} @@ -256,18 +264,19 @@ % % \bigskip % -% \begin{info} -% Actually the |\subcaption| command is just a simple combination of -% |\caption|\-|setup{sub|\-|type*}| and |\caption|. -% Analogous to the |type| option, the |subtype| option (both offered by the -% \package{caption} package) sets the sub-type of the box or environment +% \begin{background} +% Prepared with either |\Declare|\-|Caption|\-|Sub|\-|Type| (offered by the +% \package{caption} package) or |\new|\-|sub|\-|float| (offered by the +% \package{subfig} package), the caption package option |subtype| becames +% available. +% Analogous to the |type| option of the \package{caption} package, +% the |subtype| option sets the sub-type of the box or environment % (so |\caption| will typeset a sub-caption instead of an ordinary one), % places a proper hyperlink anchor (non-starred variant only), -% executes options associated with the sub-type etc.\iffalse~\footnote{\emph{Note:} -% Since \cs{captionsetup}\csmarg{subtype} is part of the \package{caption} -% package, it works in coorparation with the \package{subfig} package as -% well.}\fi -% \end{info} +% executes options associated with the sub-type etc.\par +% The |\subcaption| command is just a simple combination of +% |\caption|\-|setup{sub|\-|type*}| and |\caption|. +% \end{background} % % \PageBreak % \subsection{The subfigure \& subtable environments} @@ -315,13 +324,13 @@ % % \bigskip % -% \begin{info} +% \begin{background} % The |subfigure| \& |subtable| environments are just simple minipage % environments with |\caption|\-|setup|\x|{subtype}| 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|. -% \end{info} +% \end{background} % % \PageBreak % \subsection{The \cs{subcaptionbox} command} @@ -431,11 +440,11 @@ % % \bigskip % -% \begin{info} +% \begin{background} % The |\sub|\-|caption|\-|box| is a |\par|\-|box| with % |\caption|\-|setup{sub|\-|type}| as first contents line. % \iffalse See implementation for details.\fi -% \end{info} +% \end{background} % % \PageBreak % \subsection{The \cs{subref} command} @@ -460,10 +469,10 @@ % the same result. % \end{small} % -% \begin{info} +% \begin{background} % The |\sub|\-|ref| command demonstrates the usage of |\caption@sub|\-|type|\-|hook| % which will be called during |\caption|\-|setup{sub|\-|type}|. -% \end{info} +% \end{background} % % \pagebreak[3] % \subsection{The \cs{DeclareCaptionSubType} command} @@ -520,10 +529,10 @@ % \subcaptionbox{Table two}[3cm][c]{\begin{tabular}{cc}E & F\\ G & H\\ \end{tabular}} % \end{minipage} % -% \begin{info} +% \begin{background} % |\Declare|\-|Caption|\-|Sub|\-|Type| is an integral part of the \package{caption} % package kernel. -% \end{info} +% \end{background} % % \pagebreak[3] % \subsection{Where do hyperlinks jump?} @@ -575,7 +584,7 @@ % \fi % % \pagebreak[3] -% \section{Beyond this package} +% \subsection{Beyond this package} % \label{floatrow} % % For a more advanced usage of the sub-caption feature of the @@ -681,6 +690,7 @@ % \changes{v0.1}{2007/09/01}{First demo} % \changes{v0.2}{2007/11/11}{\cs{subcaptionbox} added} % \changes{v0.3}{2007/12/06}{Adapted to \package{caption} package \version{3.1f}} +% \changes{v1.0}{2008/03/16}{\cs{subfloat} added} % % \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}} % @@ -698,7 +708,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{subcaption}[2007/12/06 v0.3 Adding subcaptions (AR)] +\ProvidesPackage{subcaption}[2008/03/16 v1.0 Adding subcaptions (AR)] % \end{macrocode} % % \subsection{Initial code} @@ -841,6 +851,58 @@ % \end{macro} % % \pagebreak[3] +% \subsubsection{The \cs{subfloat} command} +% +% \begin{macro}{\subfloat} +% \changes{v0.4}{2008/03/01}{This macro added} +% |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}\\ +% |\subfloat*|\marg{body}\par +% If \meta{sub-caption} is given, we simply map this to \cs{subcaptionbox}. +% If not, we do the same as \cs{subcaptionbox}, but increment the +% sub-caption counter instead of typesetting a sub-caption. +% (The star variant is neither incrementing the sub-caption counter +% nor setting an hyperref anchor.) +% \begin{macrocode} +\newcommand*\subfloat{% + \@ifnextchar[\@subfloat\subfloat@} +% \end{macrocode} +% \begin{macrocode} +\long\def\@subfloat[#1]{% + \@ifnextchar[{\@@subfloat{#1}}{\subcaptionbox{#1}}} +% \end{macrocode} +% \begin{macrocode} +\long\def\@@subfloat#1[#2]{\subcaptionbox[{#1}]{#2}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\subfloat@{% + \caption@teststar\subfloat@@\@firstoftwo\@secondoftwo} +% \end{macrocode} +% \begin{macrocode} +\newcommand\subfloat@@[2]{% + \setbox\@tempboxa\hbox{#2}% + \begingroup + \captionsetup{subtype*}% set \caption@position + \caption@iftop{\subfloat@@@ t}{\subfloat@@@ b}% + {#1}\subcaptionbox@hj@default} +% \end{macrocode} +% \begin{macrocode} +\newcommand\subfloat@@@[3]{% + \endgroup + \parbox[#1]{\wd\@tempboxa}{% + #2% \@firstoftwo in star form, \@secondoftwo otherwise + {\captionsetup{subtype*,position=#1}}% + {\captionsetup{subtype,position=#1}% + \caption@refstepcounter\@subcaptype + \caption@prepareanchor\@subcaptype{}% + \caption@makeanchor{}}% + \caption@iftop{\hrule\@height\z@}{}% + \csname caption@hj@#3\endcsname + \unhbox\@tempboxa + \caption@iftop{}{\hrule\@height\z@}}}% +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] % \subsubsection{The \cs{subref} command} % % At |\captionsetup{subtype}|, we redefine |\label|. |