From 6a281494458873d6c77a5dd8c1dd2cfceb7de195 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 11 Jan 2010 00:05:34 +0000 Subject: caption update (10jan10) git-svn-id: svn://tug.org/texlive/trunk@16665 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/caption/caption.sty | 134 +++++++++++++++++---- Master/texmf-dist/tex/latex/caption/caption2.sty | 2 +- Master/texmf-dist/tex/latex/caption/caption3.sty | 60 +++++---- Master/texmf-dist/tex/latex/caption/ltcaption.sty | 2 +- Master/texmf-dist/tex/latex/caption/subcaption.sty | 2 +- 5 files changed, 152 insertions(+), 48 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty index c4b7ff5b642..e0ef8f114c3 100644 --- a/Master/texmf-dist/tex/latex/caption/caption.sty +++ b/Master/texmf-dist/tex/latex/caption/caption.sty @@ -6,7 +6,7 @@ %% %% caption.dtx (with options: `package') %% -%% Copyright (C) 1994-2009 Axel Sommerfeldt (caption@sommerfee.de) +%% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de) %% %% -------------------------------------------------------------------------- %% @@ -28,7 +28,7 @@ %% user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2009/10/09 v3.1k Customizing captions (AR)] +\ProvidesPackage{caption}[2010/01/09 v3.1l Customizing captions (AR)] \newcommand*\caption@Info[1]{\PackageInfo{caption}{#1\@gobble}} \@onlypreamble\caption@Info \RequirePackage{caption3}[2008/08/24] % needs v3.1j or newer @@ -77,23 +77,18 @@ \endgroup} \newcommand*\caption@setname[2]{\@namedef{#1name}{#2}} \caption@AtBeginDocument{\let\caption@SetName\caption@setname} -\DeclareCaptionOption{figurewithin}{\caption@Within{figure}{#1}} -\@onlypreamble@key{caption}{figurewithin} -\DeclareCaptionOption{figurewithout}{\KV@caption@figurewithin{none}} -\@onlypreamble@key{caption}{figurewithout} -\DeclareCaptionOption{tablewithin}{\caption@Within{table}{#1}} -\@onlypreamble@key{caption}{tablewithin} -\DeclareCaptionOption{tablewithout}{\KV@caption@tablewithin{none}} -\@onlypreamble@key{caption}{tablewithout} +\newcommand*\caption@DeclareWithinOption[1]{% + \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}% + \DeclareCaptionOption{#1without}{\caption@Within{#1}{none}}} +\caption@DeclareWithinOption{figure} +\caption@DeclareWithinOption{table} \DeclareCaptionOption{within}{% \@ifundefined{c@figure}{}{\caption@Within{figure}{#1}}% \@ifundefined{c@table}{}{\caption@Within{table}{#1}}% + \caption@For{typelist}{\caption@Within{##1}{#1}}% \def\caption@within@default{#1}} -\@onlypreamble@key{caption}{within} \DeclareCaptionOption{without}{\KV@caption@within{none}} -\@onlypreamble@key{caption}{without} \newcommand*\caption@Within[1]{\def\caption@type{#1}\KV@caption@DCT@within} -\@onlypreamble\caption@Within \DeclareCaptionOption*{config}[caption]{% \InputIfFileExists{#1.cfg}% {\typeout{*** Local configuration file #1.cfg used ***}}% @@ -169,11 +164,11 @@ \DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}} \DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}} \captionsetup{hypcap=1,hypcapspace=.5\baselineskip} -\@ifundefined{@captionheadfont}{}{% +\caption@ifamsclass{% \caption@Info{AMS or SMF document class}% \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class } -\@ifundefined{scr@caption}{}{% +\caption@ifkomaclass{% \caption@Info{KOMA-Script document class}% \g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}} \g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}} @@ -340,7 +335,7 @@ \@testopt{\caption@listentry{#1}}\@captype} \def\caption@listentry#1[#2]#3{% \@bsphack - #1{\def\@currentlabelname{#3}}% + #1{\caption@gettitle{#3}}% {\caption@refstepcounter{#2}% \caption@makecurrent{#2}{#3}}% \caption@addcontentsline{#2}{#3}% @@ -430,6 +425,10 @@ \let\caption@@start\relax \let\caption@freezeHref\relax \let\caption@defrostHref\relax +\newcommand\caption@gettitle[1]{% + \@ifundefined{NR@gettitle}% + {\def\@currentlabelname{#1}}% + {\NR@gettitle{#1}}} \def\caption@caption{% \caption@iftype {\caption@checkgrouplevel\@empty\caption @@ -642,12 +641,103 @@ \par \endgroup }}% + \caption@CheckCommand\@caption{% + % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX] + \long\def\@caption#1[#2]#3{% + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\let\@currentHref\hc@currentHref + \else + \hyper@makecurrent{\@captype}% + \fi + \def\@currentlabelname{#2}% + \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% + \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% + }% + \begingroup + \@parboxrestore + \if@minipage + \@setminipage + \fi + \normalsize + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\@capstartfalse + \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% + \else + \@makecaption{\csname fnum@#1\endcsname}{% + \ignorespaces + \ifHy@nesting + \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}% + \else + \Hy@raisedlink{% + \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}% + }% + #3% + \fi + }% + \fi + \par + \endgroup + }}% + \caption@CheckCommand\@caption{% + % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX] + % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX] + \long\def\@caption#1[#2]#3{% + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\let\@currentHref\hc@currentHref + \else + \hyper@makecurrent{\@captype}% + \fi + \@ifundefined{NR@gettitle}{% + \def\@currentlabelname{#2}% + }{% + \NR@gettitle{#2}% + }% + \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% + \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% + }% + \begingroup + \@parboxrestore + \if@minipage + \@setminipage + \fi + \normalsize + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\@capstartfalse + \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% + \else + \@makecaption{\csname fnum@#1\endcsname}{% + \ignorespaces + \ifHy@nesting + \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}% + \else + \Hy@raisedlink{% + \expandafter\hyper@@anchor\expandafter{% + \@currentHref + }{\relax}% + }% + #3% + \fi + }% + \fi + \par + \endgroup + }}% \caption@CheckCommand\@caption{% % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section] \long\def\@caption#1[#2]{% \def\@currentlabelname{#2}% \NR@@caption{#1}[{#2}]% }}% + \caption@CheckCommand\@caption{% + % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section] + \long\def\@caption#1[#2]{% + \NR@gettitle{#2}% + \NR@@caption{#1}[{#2}]% + }}% \caption@CheckCommand\@caption{% % subfigure.sty [2002/07/30 v2.1.4 subfigure package] \long\def\@caption#1[#2]#3{% @@ -1090,15 +1180,17 @@ \renewcommand*\caption@makecurrent[2]{% \caption@makecurrentHref{#1}% \caption@Debug{hyperref current=\@currentHref}% - \def\@currentlabelname{#2}}% + \caption@gettitle{#2}}% \newcommand*\caption@makecurrentHref{\hyper@makecurrent}% \renewcommand\caption@makeanchor[1]{% \caption@Debug{hyperref anchor: \@currentHref}% % If we cannot have nesting, the anchor is empty. \ifHy@nesting - \hyper@@anchor{\@currentHref}{#1}% + \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}% \else - \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#1% + \Hy@raisedlink{% + \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}% + }#1% \fi}% \g@addto@macro\caption@prepareslc{\let\caption@makeanchor\@firstofone}% \newif\if@capstart @@ -1408,7 +1500,7 @@ {\caption@dblarg{\@xtablecaption}}}% \let\caption@ORI@xtablecaption\@xtablecaption \long\def\@xtablecaption[#1]#2{% - \def\@currentlabelname{#2}% + \caption@gettitle{#2}% \caption@ORI@xtablecaption[#1]{#2}}% \long\def\ST@caption#1[#2]#3{\par% \caption@settype*{#1}% @@ -1428,7 +1520,7 @@ {\caption@dblarg{\@xtablecaption}}}% \let\caption@ORI@xtablecaption\@xtablecaption \long\def\@xtablecaption[#1]#2{% - \def\@currentlabelname{#2}% + \caption@gettitle{#2}% \caption@ORI@xtablecaption[#1]{#2}}% \long\def\ST@caption#1[#2]#3{\par% \caption@settype*{#1}% diff --git a/Master/texmf-dist/tex/latex/caption/caption2.sty b/Master/texmf-dist/tex/latex/caption/caption2.sty index 8b83dffa3ae..740cd490d78 100644 --- a/Master/texmf-dist/tex/latex/caption/caption2.sty +++ b/Master/texmf-dist/tex/latex/caption/caption2.sty @@ -6,7 +6,7 @@ %% %% caption2.dtx (with options: `package') %% -%% Copyright (C) 1994-2009 Axel Sommerfeldt (caption@sommerfee.de) +%% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de) %% %% -------------------------------------------------------------------------- %% diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty index 7276c25e374..37b6efe7044 100644 --- a/Master/texmf-dist/tex/latex/caption/caption3.sty +++ b/Master/texmf-dist/tex/latex/caption/caption3.sty @@ -6,7 +6,7 @@ %% %% caption.dtx (with options: `kernel') %% -%% Copyright (C) 1994-2009 Axel Sommerfeldt (caption@sommerfee.de) +%% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de) %% %% -------------------------------------------------------------------------- %% @@ -28,7 +28,7 @@ %% user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2009/10/09 v3.1k caption3 kernel (AR)] +\ProvidesPackage{caption3}[2010/01/09 v3.1l caption3 kernel (AR)] \providecommand*\@nameundef[1]{% \expandafter\let\csname #1\endcsname\@undefined} \providecommand\l@addto@macro[2]{% @@ -150,17 +150,16 @@ \def\caption@AtBeginDocument{% \caption@teststar\g@addto@macro \caption@@begindocumenthook\caption@begindocumenthook} -\@onlypreamble\caption@AtBeginDocument \AtBeginDocument{% \PackageInfo{caption}{Begin \noexpand\AtBeginDocument code\@gobble}% \def\caption@AtBeginDocument{% \@ifstar{\g@addto@macro\caption@@begindocumenthook}\@firstofone}% \caption@begindocumenthook - \let\caption@begindocumenthook\@undefined + \let\caption@begindocumenthook\relax \def\caption@AtBeginDocument{% \@ifstar\@firstofone\@firstofone}% \caption@@begindocumenthook - \let\caption@@begindocumenthook\@undefined + \let\caption@@begindocumenthook\relax \PackageInfo{caption}{End \noexpand\AtBeginDocument code\@gobble}} \newcommand*\caption@Warning[1]{% \caption@WarningNoLine{#1\on@line}} @@ -414,7 +413,10 @@ \setlength\caption@hangindent{#1}} \DeclareCaptionOption{parskip}{% \l@addto@macro\caption@@par{\setlength\parskip{#1}}} -\@ifundefined{scr@caption}{}{% +\providecommand*\caption@ifkomaclass{% + \@ifundefined{scr@caption}\@gobble\@firstofone} +\@onlypreamble\caption@ifkomaclass +\caption@ifkomaclass{% \let\caption@KV@parindent\KV@caption@parindent \DeclareCaptionOption{parindent}[]{% \ifx,#1,% @@ -803,7 +805,10 @@ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip}} -\@ifundefined{@captionheadfont}{}{% +\providecommand*\caption@ifamsclass{% + \@ifundefined{@captionheadfont}\@gobble\@firstofone} +\@onlypreamble\caption@ifamsclass +\caption@ifamsclass{% \caption@CheckCommand\@makecaption{% % amsart|amsproc|amsbook [2004/08/06 v2.20] \long\def\@makecaption#1#2{% @@ -878,7 +883,10 @@ \captionsetup[figure]{position=b} \captionsetup[table]{position=t} } -\@ifclassloaded{beamer}{% +\providecommand*\caption@ifbeamerclass{% + \@ifclassloaded{beamer}\@firstofone\@gobble} +\@onlypreamble\caption@ifbeamerclass +\caption@ifbeamerclass{% \caption@CheckCommand\beamer@makecaption{% % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau \long\def\beamer@makecaption#1#2{% @@ -908,8 +916,11 @@ % \usebeamertemplate**{caption} will set font \DeclareCaptionDefaultFont{font}{}% \setbeamertemplate{caption}[caption3]} -}{} -\@ifundefined{scr@caption}{}{% +} +\providecommand*\caption@ifkomaclass{% + \@ifundefined{scr@caption}\@gobble\@firstofone} +\@onlypreamble\caption@ifkomaclass +\caption@ifkomaclass{% \caption@CheckCommand\@makecaption{% % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class] \long\def\@makecaption#1#2{% @@ -945,7 +956,10 @@ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption} \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel} } -\@ifundefined{CaptionFonts}{}{% +\providecommand*\caption@ifntgclass{% + \@ifundefined{CaptionFonts}\@gobble\@firstofone} +\@onlypreamble\caption@ifntgclass +\caption@ifntgclass{% \caption@CheckCommand\@makecaption{% % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class] \long\def\@makecaption#1#2{% @@ -961,7 +975,9 @@ \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont} \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont} } -\@ifclassloaded{thesis}{% +\providecommand*\caption@ifthesisclass{% + \@ifundefined{cph@font}{\@gobble}{\@ifundefined{cpb@font}\@gobble\@firstofone}} +\caption@ifthesisclass{% \caption@CheckCommand\@makecaption{% % thesis.cls 1996/25/01 1.0g LaTeX document class (wm). \long\def\@makecaption#1#2{% @@ -976,7 +992,7 @@ \DeclareCaptionDefaultFormat{hang} \DeclareCaptionDefaultFont{labelfont}{\cph@font} \DeclareCaptionDefaultFont{textfont}{\cpb@font} -}{} +} \@ifundefined{FB@makecaption}{}{% \caption@CheckCommand\@makecaption{% % frenchb.ldf [2005/02/06 v1.6g French support from the babel system] @@ -1232,6 +1248,7 @@ \caption@Debug{New type `#2'}% \newcounter{#2}\@namedef{theH#2}{}% \KV@caption@DCT@within\caption@within@default + \caption@DeclareWithinOption{#2}% \KV@caption@DCT@placement{tbp}% \@ifundefined{c@float@type}% {\newcounter{float@type}% @@ -1303,29 +1320,23 @@ \begingroup \caption@setkeys[caption]{caption@within}{#1}% \endgroup} -\@onlypreamble@key{caption@DCT}{within} \define@key{caption@DCT}{without}{\KV@caption@DCT@within{none}} -\@onlypreamble@key{caption@DCT}{without} \define@key{caption@within}{none}[]{% \caption@within{}{}} -\@onlypreamble@key{caption@within}{none} \define@key{caption@within}{section}[]{% \@addtoreset\caption@type{section}% \caption@within{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}} -\@onlypreamble@key{caption@within}{section} \@ifundefined{c@chapter}{}{% \define@key{caption@within}{chapter}[]{% \@addtoreset\caption@type{chapter}% \caption@within{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}} - \@onlypreamble@key{caption@within}{chapter}} +}% \@onlypreamble@key{caption@within}{chapter}} \newcommand*\caption@within{% \expandafter\caption@within@\expandafter{\caption@type}} -\@onlypreamble\caption@within \newcommand*\caption@within@[3]{% \global\@namedef{the#1}{#2\arabic{#1}}% \@ifundefined{theH#1}\caption@AtBeginDocument\@firstofone {\global\@namedef{theH#1}{#3\arabic{#1}}}} -\@onlypreamble\caption@within@ \providecommand*\@removefromreset[2]{{% \expandafter\let\csname c@#1\endcsname\@removefromreset \def\@elt##1{% @@ -1622,7 +1633,6 @@ or \noexpand\@chapter was redefined by another package}% \fi \let\caption@PatchChapter\@undefined} -\@onlypreamble\caption@PatchChapter \newcommand\caption@patch@chapter[3]{% \begingroup \let\if@mainmatter\iffalse @@ -1634,7 +1644,6 @@ \global\let\caption@patch@chapter\@gobblethree \fi \endgroup} -\@onlypreamble\caption@patch@chapter \long\def \@gobblethree #1#2#3{} \newcommand*\caption@patch@stpelt{% \let\caption@stpelt\@stpelt @@ -1704,13 +1713,11 @@ \@onlypreamble\@@DeclareCaptionSubType \newcommand*\caption@subtypelist{} \newcommand*\caption@For{\caption@withoptargs\caption@@For} -\@onlypreamble\caption@For \newcommand\caption@@For[3]{% \caption@AtBeginDocument#1{% \def\@elt##1{#3}% \@nameuse{caption@#2}% \let\@elt\relax}}% -\@onlypreamble\caption@@For \caption@AtBeginDocument{% \def\@tempa{\@ifstar\sf@@subref\sf@subref}% \ifx\subref\@tempa @@ -1719,6 +1726,11 @@ \let\@dottedxxxline\sf@NEW@dottedxxxline \let\sf@subfloat\sf@NEW@subfloat \DeclareRobustCommand*\subref{\@ifstar\sf@@subref\sf@subref}% + \renewcommand*\sf@updatecaptionlist[4]{% + \xdef\sf@captionlist{% + \sf@captionlist,% + {\protect\numberline{\@subcaplabel}\noexpand{\ignorespaces #2}}% + {\@currentHref}}}% \fi \let\sf@NEW@dottedxxxline\@undefined \let\sf@NEW@subfloat\@undefined} diff --git a/Master/texmf-dist/tex/latex/caption/ltcaption.sty b/Master/texmf-dist/tex/latex/caption/ltcaption.sty index baa250653c8..4d4ec8b2ed9 100644 --- a/Master/texmf-dist/tex/latex/caption/ltcaption.sty +++ b/Master/texmf-dist/tex/latex/caption/ltcaption.sty @@ -6,7 +6,7 @@ %% %% ltcaption.dtx (with options: `package') %% -%% Copyright (C) 1994-2009 Axel Sommerfeldt (caption@sommerfee.de) +%% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de) %% %% -------------------------------------------------------------------------- %% diff --git a/Master/texmf-dist/tex/latex/caption/subcaption.sty b/Master/texmf-dist/tex/latex/caption/subcaption.sty index ec9b65eecdc..a56cba74719 100644 --- a/Master/texmf-dist/tex/latex/caption/subcaption.sty +++ b/Master/texmf-dist/tex/latex/caption/subcaption.sty @@ -6,7 +6,7 @@ %% %% subcaption.dtx (with options: `package') %% -%% Copyright (C) 1994-2009 Axel Sommerfeldt (caption@sommerfee.de) +%% Copyright (C) 1994-2010 Axel Sommerfeldt (caption@sommerfee.de) %% %% -------------------------------------------------------------------------- %% -- cgit v1.2.3