diff options
author | Karl Berry <karl@freefriends.org> | 2007-04-11 23:10:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-04-11 23:10:18 +0000 |
commit | 26c7201725a630fb71ec1c952974cd207170d70f (patch) | |
tree | ed170f312b75edfdab76756c9c253424999ab62e /Master/texmf-dist/tex/latex/caption/caption2.sty | |
parent | 7518aae005c5ab74eae9c9902b7ffc82c7da1cd6 (diff) |
caption 3.0p (10apr07)
git-svn-id: svn://tug.org/texlive/trunk@4152 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption2.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption2.sty | 106 |
1 files changed, 52 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption2.sty b/Master/texmf-dist/tex/latex/caption/caption2.sty index 02197eb69e7..0fd4bd37639 100644 --- a/Master/texmf-dist/tex/latex/caption/caption2.sty +++ b/Master/texmf-dist/tex/latex/caption/caption2.sty @@ -27,39 +27,43 @@ %% caption.sty, caption2.sty, caption3.sty, and manual.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption2}[2005/10/03 v2.1d Customising captions (AS)] +\ProvidesPackage{caption2}[2007/04/06 v2.2 Customising captions (AS)] \PackageWarning{caption2}{% - THIS PACKAGE IS OBSOLETE, PLEASE USE caption INSTEAD} -\newcommand*\captionfont{} -\newcommand*\captionlabelfont{} + *** THIS PACKAGE IS OBSOLETE, PLEASE USE caption ***} +\RequirePackage{caption3}[2007/03/04] % needs v3.0m or newer +\def\caption@package{caption2} +\@ifpackageloaded{caption}{% + \caption@error{You can't use both the caption *and* caption2 package}% + \endinput +}{} \newcommand*\captionlabeldelim{} \newcommand*\captionlabelsep{} -\newcommand*\captionsize{} -\newdimen\captionmargin -\newdimen\captionwidth -\newif\ifcaptionwidth -\newdimen\captionindent -\newif\ifcaptionlabel\captionlabeltrue -\newif\ifonelinecaptions +\newcommand*\ifcaptionwidth{\ifdim\captionwidth>\z@} +\newif\ifcaption@temp +\def\ifcaptionlabel{% + \ifcaption@star + \caption@tempfalse + \else + \caption@temptrue + \fi + \ifcaption@temp} +\def\captionlabeltrue{\caption@starfalse} +\def\captionlabelfalse{\caption@startrue} +\def\ifonelinecaptions{% + \caption@ifslc{\caption@temptrue}{\caption@tempfalse}% + \ifcaption@temp} +\def\onelinecaptionstrue{\caption@setbool{slc}{1}} +\def\onelinecaptionsfalse{\caption@setbool{slc}{0}} \newif\ifignoreLTcapwidth -\newcommand*\setcaptionmargin{% - \captionwidthfalse - \setlength\captionmargin} -\newcommand*\setcaptionwidth{% - \captionwidthtrue - \setlength\captionwidth} \newcommand*\normalcaptionparams{% \let\captionsize\@empty \renewcommand*\captionfont{\captionsize}% \let\captionlabelfont\@empty \renewcommand*\captionlabeldelim{:}% \renewcommand*\captionlabelsep{\space}% - \setcaptionmargin\z@\setlength\captionindent\z@ + \setcaptionmargin\z@ + \setlength\captionindent\z@ \onelinecaptionstrue} -\newcommand*\caption@eh{% - If you do not understand this error, please take a closer look\MessageBreak - at the documentation of the `caption2' package.\MessageBreak - \@ehc} \newcommand*\defcaptionstyle[1]{% \@namedef{caption@@#1}} \newcommand*\newcaptionstyle[1]{% @@ -118,17 +122,12 @@ \onelinecaption {\caption@label\captiontext}% {\parbox[b]\captionlinewidth{\strut\@nameuse{caption@@@#1}\par}\par}} -\newcommand*\caption@make{\caption@makecaption} \newcommand*\caption@@@normal{% \caption@label\captiontext} \newcommand*\caption@@@center{% \centering\caption@label\captiontext}% -\newcommand*\caption@centerlast{% - \advance\leftskip by 0pt plus 1fil% - \advance\rightskip by 0pt plus -1fil% - \parfillskip0pt plus 2fil\relax} \newcommand*\caption@@@centerlast{% - \caption@centerlast\caption@label\captiontext} + \centerlast\caption@label\captiontext} \newcommand*\caption@@@flushleft{% \raggedright\caption@label\captiontext}% \newcommand*\caption@@@flushright{% @@ -141,7 +140,7 @@ \newcommand*\caption@@@hang@center{% \let\caption@hangplus\centering\caption@@@hang} \newcommand*\caption@@@hang@centerlast{% - \let\caption@hangplus\caption@centerlast\caption@@@hang} + \let\caption@hangplus\centerlast\caption@@@hang} \newcommand*\caption@@@hang@flushleft{% \let\caption@hangplus\raggedright\caption@@@hang} \newcommand*\caption@@@indent{% @@ -176,20 +175,19 @@ \DeclareOption{tt}{\g@addto@macro\captionlabelfont\ttfamily} \DeclareOption{oneline}{\onelinecaptionstrue} \DeclareOption{nooneline}{\onelinecaptionsfalse} -\newcommand*\caption@package[1]{\@namedef{caption@pkt@#1}} -\DeclareOption{float}{\caption@twozerofalse\caption@package{float}{1}} -\DeclareOption{longtable}{\caption@twozerofalse\caption@package{longtable}{1}} -\DeclareOption{subfigure}{\caption@twozerofalse\caption@package{subfigure}{1}} +\newcommand*\caption@setpackage[1]{\@namedef{caption@pkt@#1}} +\DeclareOption{float}{\caption@twozerofalse\caption@setpackage{float}{1}} +\DeclareOption{longtable}{\caption@twozerofalse\caption@setpackage{longtable}{1}} +\DeclareOption{subfigure}{\caption@twozerofalse\caption@setpackage{subfigure}{1}} \DeclareOption{none}{\caption@twozerofalse - \caption@package{float}{0}\caption@package{longtable}{0}% - \caption@package{subfigure}{0}} + \caption@setpackage{float}{0}\caption@setpackage{longtable}{0}% + \caption@setpackage{subfigure}{0}} \DeclareOption{all}{\ExecuteOptions{float,longtable,subfigure}} \newif\ifcaption@ruled \DeclareOption{ruled}{\caption@ruledtrue} \DeclareOption{boxed}{} \DeclareOption{ignoreLTcapwidth}{\ignoreLTcapwidthtrue} -\DeclareOption{debug}{\caption@debugtrue} -\newif\ifcaption@debug +\DeclareOption{debug}{\captionsetup{debug}} \newif\ifcaption@twozero \normalcaptionparams \ExecuteOptions{none,normal} @@ -238,7 +236,8 @@ }{% \@ifundefined{caption@@#1}% {\PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}}% - {\@nameuse{caption@@#1}}% + {\let\caption@make\caption@makecaption + \@nameuse{caption@@#1}}% }} \renewcommand\@makecaption[2]{% \vskip\abovecaptionskip @@ -248,7 +247,7 @@ \def\captiontext{#2}% \usecaptionstyle\caption@style \vskip\belowcaptionskip} -\renewcommand*\caption@package[3]{% +\newcommand*\caption@ifpackage[3]{% \if1\@nameuse{caption@pkt@#1}% \@ifundefined{#2}% {\let\next\AtBeginDocument}% @@ -261,14 +260,13 @@ #3\let\next\@gobble \fi\fi \expandafter\let\csname caption@pkt@#1\endcsname\undefined - \ifcaption@debug + \caption@ifdebug{% \ifx\next\@gobble\PackageInfo{caption2}{#1 => gobble}% \else\ifx\next\@firstofone\PackageInfo{caption2}{#1 => firstofone}% \else\ifx\next\AtBeginDocument\PackageInfo{caption2}{#1 => AtBeginDocument}% - \fi\fi\fi - \fi + \fi\fi\fi}{}% \next} -\caption@package{float}{floatc@plain}{}{% +\caption@ifpackage{float}{floatc@plain}{}{% \ifx\floatc@plain\relax \PackageWarning{caption2}{% Option `float' was set but there is no float package loaded} @@ -306,7 +304,7 @@ \vskip\belowcaptionskip \bgroup}% \fi} -\caption@package{longtable}{LT@makecaption}{}{% +\caption@ifpackage{longtable}{LT@makecaption}{}{% \ifx\LT@makecaption\relax \PackageWarning{caption2}{% Option `longtable' was set but there is no longtable package loaded} @@ -369,7 +367,7 @@ \def\captiontext{\ignorespaces #2}% \usecaptionstyle\caption@substyle}% \caption@subfig@hss}} -\caption@package{subfigure}{@makesubfigurecaption}{% +\caption@ifpackage{subfigure}{@makesubfigurecaption}{% \let\setsubcapstyle\undefined \let\caption@makesubcaption\undefined}{% \ifx\@makesubfigurecaption\relax @@ -381,30 +379,30 @@ \ifx\subcapfont\undefined \PackageInfo{caption2}{subfigure package v2.0 detected} \let\subcapfont\@empty - \newcommand*\subfigcapwidth{\z@} - \newcommand*\setsubcapmargin{% + \newcommand\subfigcapwidth{\z@} + \newcommand\setsubcapmargin{% \subfigcapwidthfalse \renewcommand*\subfigcapmargin} - \newcommand*\setsubcapwidth{% + \newcommand\setsubcapwidth{% \subfigcapwidthtrue \renewcommand*\subfigcapwidth} - \newcommand*\subcaplabelsep{\space} + \newcommand\subcaplabelsep{\space} \let\caption@subfig@hss\hfil \else \PackageInfo{caption2}{subfigure package v2.1 (or newer) detected} \newdimen\subfigcapwidth - \newcommand*\setsubcapmargin{% + \newcommand\setsubcapmargin{% \subfigcapwidthfalse \setlength\subfigcapmargin} - \newcommand*\setsubcapwidth{% + \newcommand\setsubcapwidth{% \subfigcapwidthtrue \setlength\subfigcapwidth} - \newcommand*\subcaplabelsep{\hskip\subfiglabelskip} + \newcommand\subcaplabelsep{\hskip\subfiglabelskip} \let\caption@subfig@hss\hss \fi \newif\ifsubfigcapwidth \newdimen\subcapindent - \newcommand*\subcaplabeldelim{} + \newcommand\subcaplabeldelim{} \newcommand*\subcapstyle[1]{% \expandafter\ifx\csname caption@@#1\endcsname\relax \PackageError{caption2}{Undefined caption style `#1'}{\caption@eh}% @@ -417,7 +415,7 @@ \let\@makesubfigurecaption\caption@makesubcaption \let\@makesubtablecaption\caption@makesubcaption \fi} -\let\caption@package\undefined +\let\caption@ifpackage\undefined \endinput %% %% End of file `caption2.sty'. |