diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption.sty | 195 |
1 files changed, 100 insertions, 95 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty index 0c3426c8bcc..06e20a785ed 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/22 v3.1b Customising captions (AR)] +\ProvidesPackage{caption}[2007/10/17 v3.1c Customising captions (AR)] \newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}} \@onlypreamble\caption@Info -\RequirePackage{caption3}[2007/09/16] % needs v3.1a or newer +\RequirePackage{caption3}[2007/10/17] % needs v3.1c or newer \@ifpackageloaded{caption2}{% \caption@Error{% You can't use both, the (obsolete) caption2 *and*\MessageBreak @@ -68,7 +68,7 @@ } \@ifundefined{@captionheadfont}{}{% \caption@Info{AMS or SMF document class}% - \setlength\belowcaptionskip{0pt}% set to 3pc by AMS class + \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class } \@ifundefined{scr@caption}{}{% \caption@Info{KOMA-Script document class}% @@ -114,7 +114,7 @@ \ifx\\#1\\\else \@ifundefined{cap@margin}{}{% \def\@tempa{captionbeside}% - \ifx\@tempa\@currenvir\else\PackageWarning{caption}{% + \ifx\@tempa\@currenvir\else\caption@Warning{% Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}% \fi}% \fi @@ -153,7 +153,7 @@ \DeclareCaptionOption*{config}[caption]{% \InputIfFileExists{#1.cfg}% {\typeout{*** Local configuration file #1.cfg used ***}}% - {\PackageWarning{caption}{Configuration file #1.cfg not found}}} + {\caption@Warning{Configuration file #1.cfg not found}}} \DeclareCaptionOption{figureposition}{% \captionsetup*[figure]{position=#1}} \@onlypreamble@key{caption}{figureposition} @@ -184,51 +184,51 @@ \@onlypreamble\caption@SetFloatName \DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}} \@onlypreamble@key{caption}{compatibility} -\DeclareCaptionOption*{normal}[]{% +\DeclareCaptionOptionNoValue*{normal}{% \caption@setformat{normal}% \caption@setjustification{justified}} -\DeclareCaptionOption*{isu}[]{% +\DeclareCaptionOptionNoValue*{isu}{% \caption@setformat{hang}% \caption@setjustification{justified}} -\DeclareCaptionOption*{hang}[]{% +\DeclareCaptionOptionNoValue*{hang}{% \caption@setformat{hang}% \caption@setjustification{justified}} -\DeclareCaptionOption*{center}[]{% +\DeclareCaptionOptionNoValue*{center}{% \caption@setformat{normal}% \caption@setjustification{centering}} -\DeclareCaptionOption*{anne}[]{% +\DeclareCaptionOptionNoValue*{anne}{% \caption@setformat{normal}% \caption@setjustification{centerlast}} -\DeclareCaptionOption*{centerlast}[]{% +\DeclareCaptionOptionNoValue*{centerlast}{% \caption@setformat{normal}% \caption@setjustification{centerlast}} -\DeclareCaptionOption*{scriptsize}[]{\def\captionfont{\scriptsize}} -\DeclareCaptionOption*{footnotesize}[]{\def\captionfont{\footnotesize}} -\DeclareCaptionOption*{small}[]{\def\captionfont{\small}} -\DeclareCaptionOption*{normalsize}[]{\def\captionfont{\normalsize}} -\DeclareCaptionOption*{large}[]{\def\captionfont{\large}} -\DeclareCaptionOption*{Large}[]{\def\captionfont{\Large}} -\DeclareCaptionOption*{up}[]{\l@addto@macro\captionlabelfont\upshape} -\DeclareCaptionOption*{it}[]{\l@addto@macro\captionlabelfont\itshape} -\DeclareCaptionOption*{sl}[]{\l@addto@macro\captionlabelfont\slshape} -\DeclareCaptionOption*{sc}[]{\l@addto@macro\captionlabelfont\scshape} -\DeclareCaptionOption*{md}[]{\l@addto@macro\captionlabelfont\mdseries} -\DeclareCaptionOption*{bf}[]{\l@addto@macro\captionlabelfont\bfseries} -\DeclareCaptionOption*{rm}[]{\l@addto@macro\captionlabelfont\rmfamily} -\DeclareCaptionOption*{sf}[]{\l@addto@macro\captionlabelfont\sffamily} -\DeclareCaptionOption*{tt}[]{\l@addto@macro\captionlabelfont\ttfamily} -\DeclareCaptionOption*{nooneline}[]{\caption@setbool{slc}{0}} +\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}} +\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}} +\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}} +\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}} +\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}} +\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}} +\DeclareCaptionOptionNoValue*{up}{\l@addto@macro\captionlabelfont\upshape} +\DeclareCaptionOptionNoValue*{it}{\l@addto@macro\captionlabelfont\itshape} +\DeclareCaptionOptionNoValue*{sl}{\l@addto@macro\captionlabelfont\slshape} +\DeclareCaptionOptionNoValue*{sc}{\l@addto@macro\captionlabelfont\scshape} +\DeclareCaptionOptionNoValue*{md}{\l@addto@macro\captionlabelfont\mdseries} +\DeclareCaptionOptionNoValue*{bf}{\l@addto@macro\captionlabelfont\bfseries} +\DeclareCaptionOptionNoValue*{rm}{\l@addto@macro\captionlabelfont\rmfamily} +\DeclareCaptionOptionNoValue*{sf}{\l@addto@macro\captionlabelfont\sffamily} +\DeclareCaptionOptionNoValue*{tt}{\l@addto@macro\captionlabelfont\ttfamily} +\DeclareCaptionOptionNoValue*{nooneline}{\caption@setbool{slc}{0}} \caption@setbool{ruled}{0} -\DeclareCaptionOption*{ruled}[]{\caption@setbool{ruled}{1}} -\DeclareCaptionOption*{flushleft}[]{% +\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}} +\DeclareCaptionOptionNoValue*{flushleft}{% \caption@setformat{normal}% \caption@setjustification{raggedright}} -\DeclareCaptionOption*{flushright}[]{% +\DeclareCaptionOptionNoValue*{flushright}{% \caption@setformat{normal}% \caption@setjustification{raggedleft}} -\DeclareCaptionOption*{oneline}[]{\caption@setbool{slc}{1}} -\DeclareCaptionOption*{ignoreLTcapwidth}[]{% - \PackageWarning{caption}{Obsolete option `ignoreLTcapwidth' ignored}} +\DeclareCaptionOptionNoValue*{oneline}{\caption@setbool{slc}{1}} +\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{% + \caption@Warning{Obsolete option `ignoreLTcapwidth' ignored}} \DeclareCaptionOption*{caption}{% \caption@setbool{temp}{#1}% \caption@ifbool{temp}{}{% @@ -262,9 +262,8 @@ \@ifundefined{@#1captype}{}{% \edef\@tempa{#3}% \expandafter\ifx\csname @#1captype\endcsname\@tempa \else - \caption@iftypewarning{% - \PackageWarning{caption}{% - Caption type was already set to `#3'\MessageBreak}}{}% + \caption@iftypewarning{\caption@Warning{% + Caption type was already set to `#3'\MessageBreak}}{}% \fi}% \expandafter\edef\csname @#1captype\endcsname{#3}% \let\caption@iftypewarning\caption@ifdebug @@ -301,14 +300,12 @@ \newcommand*\caption@undefinedlabel{??} \newcommand*\caption@xlabel[2]{% \ifx\@currentlabel\caption@undefinedlabel - \PackageWarning{caption}{\noexpand\label before \noexpand\caption ignored}% + \caption@Warning{\noexpand\label before \noexpand\caption ignored}% \else \caption@ORI@label#1{#2}% \fi} \def\captionof{\caption@teststar\caption@of{\caption*}\caption} -\newcommand*\caption@of[2]{% - \let\caption@setfloatcapt\@firstofone - \caption@settype*{#2}#1} +\newcommand*\caption@of[2]{\caption@settype*{#2}#1} \newcommand*\captionlistentry{% \@testopt\caption@listentry\@captype} \def\caption@listentry[#1]#2{% @@ -316,10 +313,11 @@ \caption@makecurrent{#1}{#2}% \caption@addcontentsline{#1}{#2}} \def\ContinuedFloat{% - \caption@iftype - {\addtocounter\@captype\m@ne - \caption@ContinuedFloat\@captype}% - {\caption@Error{\noexpand\ContinuedFloat outside float}}} + \@ifnextchar[\@ContinuedFloat{% + \caption@iftype + {\addtocounter\@captype\m@ne + \caption@ContinuedFloat\@captype}% + {\caption@Error{\noexpand\ContinuedFloat outside float}}}} \def\caption@ContinuedFloat#1{% \edef\@tempa{#1}% \ifx\@tempa\caption@CFtype \else @@ -330,6 +328,7 @@ \caption@setoptions{ContinuedFloat}% \caption@setoptions{continued#1}% \let\caption@resetContinuedFloat\@gobble} +\def\@ContinuedFloat[#1]{\addtocounter{#1}\m@ne} \newcounter{ContinuedFloat} \newcommand*\caption@CFtype{??} \newcommand*\caption@@ContinuedFloat[1]{} @@ -383,7 +382,6 @@ \caption@font*{\KV@caption@fnt@normal\@unused}} \let\caption@setfloatcapt\@firstofone \newcommand*\caption@makecurrent[2]{} -\let\caption@makestart\@gobble \let\caption@@anchor\@firstofone \let\caption@start\relax \let\caption@@start\relax @@ -594,7 +592,7 @@ {\let\@tempa\@gobble}% suppress warning \caption@ifcompatibility{% \@tempa{% - \PackageWarningNoLine{caption}{% + \caption@WarningNoLine{% \noexpand\caption will not be redefined since it's already\MessageBreak redefined by a document class or package which is\MessageBreak unknown to the caption package.\MessageBreak @@ -619,11 +617,11 @@ \newcommand*\caption@star[2]{#1#2}% }{% \caption@ifincompatible{% - \PackageWarning{caption}{% + \caption@WarningNoLine{% Forced redefinition of \noexpand\caption since the\MessageBreak unsupported(!) package option `compatibility=false'\MessageBreak was given. Please fasten your seat belts, as we may\MessageBreak - experience turbulence!\@gobbletwo}% + experience turbulence}% }{}% \def\caption{% \caption@iftype @@ -754,17 +752,15 @@ \def\captionsetup##1{% \caption@g@addto@list\caption@SCsetup{##1}% \caption@setup{##1}}% + \let\caption@ORI\caption \def\caption{% - \let\captionsetup\@gobble - \caption@star - {\let\caption@ORI@refstepcounter\caption@@refstepcounter - \def\caption@@refstepcounter########1{% - \advance\csname c@########1\endcsname\@ne\relax}% - \caption@refstepcounter\@captype - \let\caption@@refstepcounter\caption@ORI@refstepcounter}% - {\caption@dblarg\@caption@SC}}% - \def\@caption@SC[##1]##2{% - \gdef\caption@SClentry{##1}\gdef\caption@SCtext{##2}% + \def\caption{\caption@Error{% + Only one \noexpand\caption can be placed in this environment}}% + \let\captionsetup\caption@setup + \let\caption@@refstepcounter\caption@l@stepcounter + \caption@ORI}% + \long\def\@caption##1[##2]##3{% + \gdef\caption@SClentry{##2}\gdef\caption@SCtext{##3}% \ignorespaces}% #1{% is \@gobble in star form, and \@firstofone otherwise \def\label##1{\gdef\caption@SClabel{##1}\ignorespaces}}% @@ -861,6 +857,7 @@ \caption@ORI@floatingtable}% \newcommand*\caption@floatflt[1]{% \caption@settype{#1}% + \caption@clearmargin \caption@setoptions{floating#1}% \let\caption@boxrestore\@parboxrestore}% }{} @@ -875,9 +872,10 @@ \def\@captype{#1}% \let\FP@LabelText\@empty \begin{lrbox}{\FP@floatCorpusBOX}% - \caption@ifFPrefcap\caption@freeze{% - \def\label##1{\gdef\FP@LabelText{##1}\ignorespaces}% - \caption@freeze*}}% + \caption@ifFPrefcap + {\caption@freeze\relax}% + {\def\label##1{\gdef\FP@LabelText{##1}\ignorespaces}% + \caption@freeze*}}% \renewcommand*\FP@floatEnd{% \end{lrbox}% \stepcounter{FP@\@captype C}% @@ -928,7 +926,7 @@ } \caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{% \@ifundefined{hyper@makecurrent}{% hyperref has stopped early - \PackageWarningNoLine{caption}{% + \caption@WarningNoLine{% Hyperref support is turned off\MessageBreak because hyperref has stopped early}% }{% @@ -936,17 +934,11 @@ \renewcommand*\caption@@refstepcounter{\H@refstepcounter}% \renewcommand*\caption@makecurrent[2]{% \caption@makecurrentHref{#1}% - \caption@Debug{hyper current=\@currentHref}% + \caption@Debug{hyperref current=\@currentHref}% \def\@currentlabelname{#2}}% \newcommand*\caption@makecurrentHref{\hyper@makecurrent}% - \renewcommand*\caption@makestart[1]{% - \begingroup - \Hy@hypertexnamesfalse - \hyper@makecurrent{#1.xxx}% - \endgroup - \caption@Debug{hyper start=\@currentHref}}% \renewcommand\caption@@anchor[1]{% - \caption@Debug{hyper anchor: \@currentHref}% + \caption@Debug{hyperref anchor: \@currentHref}% % If we cannot have nesting, the anchor is empty. \ifHy@nesting \hyper@@anchor{\@currentHref}{#1}% @@ -954,23 +946,6 @@ \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#1% \fi}% \g@addto@macro\caption@prepareslc{\let\caption@@anchor\@firstofone}% - \newcommand*\caption@startanchor[1]{% - \caption@Debug{hyper anchor: #1}% - \ifvmode\begingroup - \@tempdima\prevdepth - \nointerlineskip - \vspace*{-\caption@hypcapspace}% - \caption@anchor{#1}% - \vspace*{\caption@hypcapspace}% - \prevdepth\@tempdima - \endgroup\else - \PackageWarning{caption}{Internal Warning: Vertical TeX mode expected}% - \caption@anchor{#1}% - \fi}% - \newcommand*\caption@anchor[1]{% - \ifmeasuring@ \else - \Hy@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}% - \fi}% \renewcommand*\caption@@ContinuedFloat[1]{% \@ifundefined{theH#1}{}{% \expandafter\l@addto@macro\csname theH#1\endcsname{% @@ -985,17 +960,43 @@ \global\@capstartfalse \global\let\@currentHref\hc@currentHref}% \let\caption@@anchor\@firstofone -%%% \let\caption@startanchor\@gobble }{}}% + \newcommand*\caption@makestart[1]{% + \begingroup + \Hy@hypertexnamesfalse + \hyper@makecurrent{#1.caption}% + \endgroup + \caption@Debug{hypcap start=\@currentHref}}% + \newcommand*\caption@startanchor[1]{% + \caption@Debug{hypcap anchor: #1}% + \ifvmode\begingroup + \@tempdima\prevdepth + \nointerlineskip + \vspace*{-\caption@hypcapspace}% + \caption@anchor{#1}% + \vspace*{\caption@hypcapspace}% + \prevdepth\@tempdima + \endgroup\else + \caption@Warning{Internal Warning: Vertical TeX mode expected}% + \caption@anchor{#1}% + \fi}% + \newcommand*\caption@anchor[1]{% + \ifmeasuring@ \else + \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}% + \fi}% + \ifx\HyperRaiseLinkLength\@tempdima + \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}% + \else + \let\caption@raisedlink\Hy@raisedlink + \fi \def\caption@@start{% \@ifundefined{hc@currentHref}{% - \PackageWarning{caption}{% + \caption@Warning{% The option `hypcap=true' will be ignored for this\MessageBreak particular \string\caption}}{}}% \def\caption@freezeHref{% \let\caption@ORI@start\caption@start \def\caption@start{\let\caption@start\caption@ORI@start}% - \let\caption@ORI@@start\caption@@start \global\let\caption@currentHref\@undefined \def\caption@@start{\global\let\caption@currentHref\@currentHref}% \let\caption@ORI@setfloatcapt\caption@setfloatcapt @@ -1023,6 +1024,7 @@ \let\capstart\caption@start \let\caption@start\relax \let\caption@@start\relax + \caption@@setbool\caption@ifhypcap1% \renewcommand*\caption@hypcapspace{\hypcapspace}% \@ifundefined{Hy@float@makebox}{}{% \caption@Debug{% @@ -1093,11 +1095,12 @@ \caption@window{table}% \caption@setoptions{tabwindow}% \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }% - \newcommand*\caption@window{% + \newcommand*\caption@window[1]{% \let\caption@boxrestore\@parboxrestore \let\@makecaption\caption@@make \caption@setautoposition b% - \caption@settype}% + \caption@settype{#1}% + \caption@clearmargin}% \newcommand\caption@wincaption[1]{% \ifdim\picwd=\z@ \let\caption@makecurrent\@gobbletwo @@ -1184,7 +1187,9 @@ \caption@AtBeginDocument{\let\SC@caption=\caption}% \let\caption@ORI@SC@zfloat\SC@zfloat \def\SC@zfloat#1#2#3[#4]{% + \let\caption@ORI\caption \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]% + \let\caption\caption@ORI \caption@settype*{#2}% \caption@freeze*}% \let\caption@ORI@endSC@FLOAT\endSC@FLOAT @@ -1193,7 +1198,7 @@ \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{SCfloat}% \caption@setoptions{SC\@captype}% \caption@start}% \def\caption@setSC@justify{% @@ -1311,8 +1316,8 @@ \else \float@dostyle{#1}% \fi}{}% - \caption@clearmargin - \caption@setoptions{wrapfloat}% + \caption@clearmargin +%%% \caption@setoptions{wrapfloat}% \caption@setoptions{wrap#1}% \@nameuse{caption@ORI@wrap#1}}% \caption@restylewrapfloat{figure}% |