diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-17 00:45:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-17 00:45:00 +0000 |
commit | d74ed9e8979cfaba08a049a508d7b82fcd284656 (patch) | |
tree | c1323b1dd5e141a6b608bc9a653521d691168377 /Master/texmf-dist/tex/latex/caption | |
parent | 82455bade99d6d43ff3c89172936e0a7a11f6430 (diff) |
caption 3.1a (16sep07)
git-svn-id: svn://tug.org/texlive/trunk@4959 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption.sty | 115 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption2.sty | 9 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption3.sty | 121 |
3 files changed, 153 insertions, 92 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty index bd69e94cb18..653e9a4ec52 100644 --- a/Master/texmf-dist/tex/latex/caption/caption.sty +++ b/Master/texmf-dist/tex/latex/caption/caption.sty @@ -28,10 +28,10 @@ %% caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2007/09/01 v3.1 Customising captions (AR)] +\ProvidesPackage{caption}[2007/09/16 v3.1a Customising captions (AR)] \newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}} \@onlypreamble\caption@Info -\RequirePackage{caption3}[2007/09/01] % needs v3.1 or newer +\RequirePackage{caption3}[2007/09/16] % needs v3.1a or newer \@ifpackageloaded{caption2}{% \caption@Error{% You can't use both, the (obsolete) caption2 *and*\MessageBreak @@ -88,15 +88,15 @@ \else \@tablecaptionabovefalse \fi - \def\onelinecaptionstrue{\captionsetup{singlelinecheck=1}} - \def\onelinecaptionsfalse{\captionsetup{singlelinecheck=0}} + \def\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo} + \def\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo} \ifonelinecaptions \onelinecaptionstrue \else \onelinecaptionsfalse \fi - \def\@captionabovetrue{\captionsetup{position=t}} - \def\@captionabovefalse{\captionsetup{position=b}} + \def\@captionabovetrue{\let\caption@position\@firstoftwo} + \def\@captionabovefalse{\let\caption@position\@secondoftwo} \let\caption@KOMA@setcapindent\@setcapindent \renewcommand*\@setcapindent[1]{% \caption@KOMA@setcapindent{#1}\caption@setcapindent} @@ -924,6 +924,8 @@ \caption@defrost \end\@captype}% }% + \ForFloatingEnvironments{% + \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}% }{% \let\caption@ifFPlistcap\@undefined \let\caption@ifFPrefcap\@undefined @@ -1038,27 +1040,30 @@ \caption@ORI@lst@MakeCaption{#1}% \caption@end}% \providecommand*\ext@lstlisting{lol}% - \g@addto@macro\caption@settypehook{\let\lst@@caption\relax}% }{} \providecommand*\LTcaptype{table} \caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{% \RequirePackage{ltcaption}[2007/09/01]% \let\LT@@makecaption\@undefined - \let\caption@ORI@LT@array\LT@array - \renewcommand*\LT@array{% - \global\let\caption@opt@@longtable\@undefined - \def\captionsetup##1{\noalign{% - \@captionsetup\@gobble[@longtable]{##1}% - \global\let\caption@opt@@longtable\caption@opt@@longtable}}% - \def\captionlistentry##1{\noalign{% - \caption@listentry[\LTcaptype]{##1}}}% - \def\ContinuedFloat{\noalign{% - \caption@Error{\noexpand\ContinuedFloat outside float}}}% - \caption@ORI@LT@array}% -\def\LT@c@ption#1[#2]#3{% - \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}% - \def\@currentlabelname{#2}% - \caption@addcontentsline\LTcaptype{#2}}% + \caption@AtBeginDocument{% + \let\caption@ORI@LT@array\LT@array + \renewcommand*\LT@array{% + \global\let\caption@opt@@longtable\@undefined + \def\captionsetup##1{\noalign{\LT@captionsetup{##1}}}% + \def\LT@captionsetup##1{% + \@captionsetup\@gobble[@longtable]{##1}% + \global\let\caption@opt@@longtable\caption@opt@@longtable}% + \def\@captionabovetrue{\LT@captionsetup{position=t}}% + \def\@captionabovefalse{\LT@captionsetup{position=b}}% + \def\captionlistentry##1{\noalign{% + \caption@listentry[\LTcaptype]{##1}}}% + \def\ContinuedFloat{\noalign{% + \caption@Error{\noexpand\ContinuedFloat outside float}}}% + \caption@ORI@LT@array}}% + \def\LT@c@ption#1[#2]#3{% + \LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}% + \def\@currentlabelname{#2}% + \caption@addcontentsline\LTcaptype{#2}}% \renewcommand\LT@makecaption[3]{% \caption@LT@make{% \caption@startrue#1\caption@starfalse @@ -1169,6 +1174,9 @@ \nobreak\hspace{12pt}}% \newcommand\caption@makerot[2]{% \begin{minipage}\captionwidth\caption@@make{#1}{#2}\end{minipage}}% + \ForFloatingEnvironments{% + \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}% + \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}% }{} \caption@IfPackageLoaded{sidecap}[1999/05/11 v1.4d]{% \caption@setbool{needfreeze}{1}% @@ -1198,18 +1206,29 @@ \def\SC@orig@caption[##1]##2{\caption@defrost}% \caption@setSC@justify % for compatibility mode \caption@ORI@endSC@FLOAT}% + \ForFloatingEnvironments{% + \newenvironment{SC#1}% + {\SC@float[\@nameuse{SC@#1@vpos}]{#1}}{\endSC@float}% + \newenvironment{SC#1*}% + {\SC@dblfloat[\@nameuse{SC@#1@vpos}]{#1}}{\endSC@dblfloat}}% }{} \caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{% \def\sf@ifpositiontop{% - \@ifundefined{if\@captype topcap}{% - \@gobbletwo - }{% - \@nameuse{if\@captype topcap}% - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi - }}% + \ifx\@captype\@undefined + \expandafter\@gobbletwo + \else\ifx\@captype\relax + \expandafter\expandafter\expandafter\@gobbletwo + \else + \expandafter\expandafter\expandafter\sf@if@position@top + \fi\fi} + \def\sf@if@position@top{% + \@ifundefined{if\@captype topcap}% + {\@gobbletwo}% + {\@nameuse{if\@captype topcap}% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi}} }{} \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{% \let\caption@ORI@tablecaption\tablecaption @@ -1276,26 +1295,30 @@ \else \expandafter\let\csname caption@ORI@wrap#1\expandafter\endcsname \csname wrap#1\endcsname - \@namedef{wrap#1}{% - \caption@settype*{#1}% - \float@ifstyle{#1}{% - \ifx\WF@floatstyhook\@undefined - \caption@Error{% - For a successful cooperation of the `wrapfig' package\MessageBreak - with the `float' package you should use at least\MessageBreak - `wrapfig' version 3.6}% - \else - \float@dostyle{#1}% - \fi}{}% - \caption@clearmargin - \caption@setoptions{wrapfloat}% - \caption@setoptions{wrap#1}% - \@nameuse{caption@ORI@wrap#1}}% + \@namedef{wrap#1}{\caption@wrapfloat{#1}}% \expandafter\let\csname caption@OUR@wrap#1\expandafter\endcsname \csname wrap#1\endcsname \fi}% + \newcommand*\caption@wrapfloat[1]{% + \caption@settype*{#1}% + \float@ifstyle{#1}{% + \ifx\WF@floatstyhook\@undefined + \caption@Error{% + For a successful cooperation of the `wrapfig' package\MessageBreak + with the `float' package you should use at least\MessageBreak + `wrapfig' version 3.6}% + \else + \float@dostyle{#1}% + \fi}{}% + \caption@clearmargin + \caption@setoptions{wrapfloat}% + \caption@setoptions{wrap#1}% + \@nameuse{caption@ORI@wrap#1}}% \caption@restylewrapfloat{figure}% \caption@restylewrapfloat{table}% + \ForFloatingEnvironments{% + \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}% + \caption@restylewrapfloat{#1}}% \ifx\WF@floatstyhook\@undefined \else % wrapfig v3.6 \@ifundefined{float@restyle}{}{% \toks@=\expandafter{\float@restyle{#1}% (env may or may not be defined) diff --git a/Master/texmf-dist/tex/latex/caption/caption2.sty b/Master/texmf-dist/tex/latex/caption/caption2.sty index 5fec636caf7..c23bfbcec24 100644 --- a/Master/texmf-dist/tex/latex/caption/caption2.sty +++ b/Master/texmf-dist/tex/latex/caption/caption2.sty @@ -185,9 +185,12 @@ \DeclareOption{oneline}{\onelinecaptionstrue} \DeclareOption{nooneline}{\onelinecaptionsfalse} \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{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@setpackage{float}{0}\caption@setpackage{longtable}{0}% \caption@setpackage{subfigure}{0}} diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty index 5488a81fb14..14a28367e74 100644 --- a/Master/texmf-dist/tex/latex/caption/caption3.sty +++ b/Master/texmf-dist/tex/latex/caption/caption3.sty @@ -28,7 +28,7 @@ %% caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2007/09/01 v3.1 caption3 kernel (AR)] +\ProvidesPackage{caption3}[2007/09/16 v3.1a caption3 kernel (AR)] \providecommand*\@nameundef[1]{% \expandafter\let\csname #1\endcsname\@undefined} \providecommand\l@addto@macro[2]{% @@ -437,11 +437,14 @@ \expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}} \DeclareCaptionFormat{plain}{#1#2#3\par} \DeclareCaptionFormat{hang}{% - \@hangfrom{#1#2}% - \advance\caption@parindent\hangindent - \advance\caption@hangindent\hangindent - \caption@@par - #3\par} + \caption@ifin@list\caption@lsepcrlist\caption@lsepname + {\caption@Error{% + The option `labelsep=\caption@lsepname' does not work\MessageBreak + with `format=hang'}}% + {\@hangfrom{#1#2}% + \advance\caption@parindent\hangindent + \advance\caption@hangindent\hangindent + \caption@@par#3\par}} \def\caption@fmt@default{\caption@fmt@plain} \def\caption@ifh@default{\caption@ifh@plain} \newcommand*\DeclareCaptionLabelFormat[2]{% @@ -461,14 +464,21 @@ \@onlypreamble\DeclareCaptionLabelSeparator \newcommand\caption@declarelabelseparator[3]{% \global\expandafter\let\csname caption@iflf@#2\endcsname#1% - \global\long\@namedef{caption@lsep@#2}{#3}} + \global\long\@namedef{caption@lsep@#2}{#3}% + \caption@@declarelabelseparator{#2}#3\\\@nil} \@onlypreamble\caption@declarelabelseparator +\long\def\caption@@declarelabelseparator#1#2\\#3\@nil{% + \def\@tempa{#3}\ifx\@tempa\@empty \else + \caption@g@addto@list\caption@lsepcrlist{#1}% + \fi} +\@onlypreamble\caption@@declarelabelseparator \DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}} \DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}} \newcommand*\caption@setlabelseparator[1]{% \@ifundefined{caption@lsep@#1}% {\caption@Error{Undefined label separator `#1'}}% - {\expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname + {\edef\caption@lsepname{#1}% + \expandafter\let\expandafter\caption@iflf\csname caption@iflf@#1\endcsname \expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}} \DeclareCaptionLabelSeparator{none}{} \DeclareCaptionLabelSeparator{colon}{: } @@ -687,11 +697,9 @@ \DeclareCaptionOption{debug}[1]{% \caption@set@bool\caption@ifdebug{#1}% \let\caption@iftypewarning\caption@ifdebug - \caption@ifdebug{% - \def\caption@Debug{\PackageInfo{caption}}% - }{% - \let\caption@Debug\@gobble - }} + \caption@ifdebug + {\def\caption@Debug{\PackageInfo{caption}}}% + {\let\caption@Debug\@gobble}} \DeclareOption{debug}{\setkeys{caption}{debug}} \setkeys{caption}{debug=0} \caption@CheckCommand\@makecaption{\let\@makecaption\@undefined} @@ -830,7 +838,11 @@ \fi}} \DeclareCaptionFormat{default}{% \ifdofullc@p - \caption@fmt@hang{#1}{#2}{#3}% + \caption@ifin@list\caption@lsepcrlist\caption@lsepname + {\caption@Error{% + The option `labelsep=\caption@lsepname' does not work\MessageBreak + with \noexpand\setcaphanging (which is set by default)}}% + {\caption@fmt@hang{#1}{#2}{#3}}% \else #1#2% \ifdim\cap@indent<\z@ @@ -1061,48 +1073,71 @@ \caption@ifempty\@unused} \newcommand*\caption@@par{% \parindent\caption@parindent\hangindent\caption@hangindent}% -\providecommand*\DeclareFloatingEnvironment[1]{% +\providecommand*\DeclareFloatingEnvironment{% + \@ifnextchar[%] + \caption@@DeclareFloatingEnvironment\caption@DeclareFloatingEnvironment} +\@onlypreamble\DeclareFloatingEnvironment +\newcommand*\caption@DeclareFloatingEnvironment[1]{% + \caption@@DeclareFloatingEnvironment[lo#1]{#1}} +\@onlypreamble\caption@DeclareFloatingEnvironment +\def\caption@@DeclareFloatingEnvironment[#1]#2{% \@ifundefined{c@chapter}% - {\newcounter{#1}% - \@namedef{the#1}{\arabic{#1}}% - \@namedef{theH#1}{\arabic{#1}}}% - {\newcounter{#1}[chapter]% - \@namedef{the#1}{\ifnum\c@chapter>\z@ \thechapter.\fi \arabic{#1}}% - \@namedef{theH#1}{\theHchapter.\arabic{#1}}}% - \@namedef{fps@#1}{tbp}% - \@ifundefined{c@float@type}{% - \newcounter{float@type}% - \setcounter{float@type}{\@ifundefined{c@figure}14}}{}% - \expandafter\xdef\csname ftype@#1\endcsname{\the\value{float@type}}% + {\newcounter{#2}% + \@namedef{the#2}{\arabic{#2}}% + \@namedef{theH#2}{\arabic{#2}}}% + {\newcounter{#2}[chapter]% + \@namedef{the#2}{\ifnum\c@chapter>\z@ \thechapter.\fi \arabic{#2}}% + \@namedef{theH#2}{\theHchapter.\arabic{#2}}}% + \@namedef{fps@#2}{tbp}% + \@ifundefined{c@float@type}% + {\newcounter{float@type}% + \setcounter{float@type}{\@ifundefined{c@figure}14}}% + {}% + \caption@Debug{float type `#2'=\the\value{float@type}}% + \expandafter\xdef\csname ftype@#2\endcsname{\the\value{float@type}}% \addtocounter{float@type}{\value{float@type}}% - \@namedef{ext@#1}{lo#1}% - \@namedef{fnum@#1}{\@nameuse{#1name}\nobreakspace\@nameuse{the#1}}% - \newenvironment{#1}{\@float{#1}}{\end@float}% - \newenvironment{#1*}{\@dblfloat{#1}}{\end@dblfloat}% - \expandafter\newcommand\csname listof#1s\endcsname{\begingroup - \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname - \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname + \@namedef{ext@#2}{#1}% + \@namedef{fnum@#2}{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}% + \newenvironment{#2}{\@float{#2}}{\end@float}% + \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% + \expandafter\newcommand\csname listof#2s\endcsname{\begingroup + \expandafter\let\expandafter\listfigurename\csname list#2name\endcsname + \expandafter\let\expandafter\ext@figure\csname ext@#2\endcsname \let\caption@ORI@starttoc\@starttoc \renewcommand*\@starttoc[1]{% \expandafter\caption@ORI@starttoc\expandafter{\ext@figure}}% \listoffigures \endgroup}% \@ifundefined{l@figure}% - {\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}}% - {\expandafter\let\csname l@#1\endcsname\l@figure}% - \expandafter\newcommand\csname #1name\endcsname{}% + {\@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}}% + {\expandafter\let\csname l@#2\endcsname\l@figure}% + \expandafter\newcommand\csname #2name\endcsname{}% \edef\@tempa{% - \def\noexpand\@tempa{\expandafter\noexpand\@car#1\@nil}}% + \def\noexpand\@tempa{\expandafter\noexpand\@car#2\@nil}}% \uppercase\expandafter{\@tempa}% \edef\@tempb{% - \noexpand\g@addto@macro\noexpand\@tempa{\expandafter\@cdr#1\@nil}}% + \noexpand\g@addto@macro\noexpand\@tempa{\expandafter\@cdr#2\@nil}}% \@tempb - \expandafter\let\csname #1name\endcsname\@tempa - \expandafter\newcommand\csname list#1name\endcsname{}% - \expandafter\xdef\csname list#1name\endcsname{List of \@tempa s}% - \@cons\caption@floatlist{{#1}}} -\@onlypreamble\DeclareFloatingEnvironment + \expandafter\let\csname #2name\endcsname\@tempa + \expandafter\newcommand\csname list#2name\endcsname{}% + \expandafter\xdef\csname list#2name\endcsname{List of \@tempa s}% + \@cons\caption@floatlist{{#2}}% + \@ifnextchar[{\caption@@@DeclareFloatingEnvironment{#2}}\relax} +\@onlypreamble\caption@@DeclareFloatingEnvironment +\def\caption@@@DeclareFloatingEnvironment#1[#2]{% + \@namedef{#1name}{#2}% + \@ifnextchar[{\caption@@@@DeclareFloatingEnvironment{#1}}\relax} +\@onlypreamble\caption@@@DeclareFloatingEnvironment +\def\caption@@@@DeclareFloatingEnvironment#1[#2]{% + \@namedef{list#1name}{#2}} +\@onlypreamble\caption@@@@DeclareFloatingEnvironment \newcommand*\caption@floatlist{} +\providecommand\ForFloatingEnvironments[1]{% + \caption@AtBeginDocument{% + \def\@elt##1{#1}% + \caption@floatlist + \let\@elt\relax}}% +\@onlypreamble\ForFloatingEnvironments \caption@AtBeginDocument{% \def\@tempa{\@ifstar\sf@@subref\sf@subref}% \ifx\subref\@tempa |