From b99aff7fb5a21795eb841a12a8fc470e804fa9a6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 11 May 2013 22:52:26 +0000 Subject: caption (11may13) git-svn-id: svn://tug.org/texlive/trunk@30407 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/caption/bicaption.sty | 9 +- Master/texmf-dist/tex/latex/caption/caption.sty | 159 +++++++++++---------- Master/texmf-dist/tex/latex/caption/caption3.sty | 110 +++++++++----- Master/texmf-dist/tex/latex/caption/newfloat.sty | 116 +++++++++------ Master/texmf-dist/tex/latex/caption/totalcount.sty | 55 ++++--- 5 files changed, 264 insertions(+), 185 deletions(-) (limited to 'Master/texmf-dist/tex/latex/caption') diff --git a/Master/texmf-dist/tex/latex/caption/bicaption.sty b/Master/texmf-dist/tex/latex/caption/bicaption.sty index d6a126aad03..27735cb0998 100644 --- a/Master/texmf-dist/tex/latex/caption/bicaption.sty +++ b/Master/texmf-dist/tex/latex/caption/bicaption.sty @@ -6,7 +6,7 @@ %% %% bicaption.dtx (with options: `package') %% -%% Copyright (C) 1994-2013 Axel Sommerfeldt +%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% http://sourceforge.net/projects/latex-caption/ %% @@ -39,7 +39,7 @@ \NeedsTeXFormat{LaTeX2e}[1994/12/01] \def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${% \def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }} -\caption@tempa $Id: bicaption.sty 68 2013-03-10 09:31:58Z sommerfeldt $ +\caption@tempa $Id: bicaption.dtx 89 2013-05-02 07:05:20Z sommerfeldt $ \ProvidesPackage{bicaption}[\caption@tempa v1.1-\caption@tempb Bilingual Captions (AR)] \RequirePackage{caption}[2012/12/26] % needs v3.3 or newer \caption@AtBeginDocument{\caption@ifcompatibility{% @@ -237,11 +237,6 @@ \l@addto@macro\caption@warmup{% \let\bicaption\caption@frozen@bicaption}}% \fi} -\newcommand*\bicaption@declarelist[1]{% - \@namedef{listof#1}{\bicaption@listof#1}} -\@onlypreamble\bicaption@declarelist -\def\bicaption@listof#1 {\@nameuse{listof#1}} -\caption@ForEachType{\bicaption@declarelist{#1}} \endinput %% %% End of file `bicaption.sty'. diff --git a/Master/texmf-dist/tex/latex/caption/caption.sty b/Master/texmf-dist/tex/latex/caption/caption.sty index efabb8d19d0..26e461fd682 100644 --- a/Master/texmf-dist/tex/latex/caption/caption.sty +++ b/Master/texmf-dist/tex/latex/caption/caption.sty @@ -40,9 +40,9 @@ \NeedsTeXFormat{LaTeX2e}[1994/12/01] \def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${% \def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }} -\caption@tempa $Id: caption.sty 73 2013-04-14 19:40:46Z sommerfeldt $ +\caption@tempa $Id: caption.dtx 89 2013-05-02 07:05:20Z sommerfeldt $ \ProvidesPackage{caption}[\caption@tempa v3.3-\caption@tempb Customizing captions (AR)] -\RequirePackage{caption3}[2012/12/26] % needs v1.5 or newer +\RequirePackage{caption3}[2013/05/01] % needs v1.6 or newer \caption@ifbool{documentclass}{}{% \caption@WarningNoLine{% Unsupported document class (or package) detected,\MessageBreak @@ -709,6 +709,10 @@ } \caption@AtBeginDocument{\caption@redefine} \let\@makecaption\caption@makecaption +\newcommand\phantomcaption{% + \caption@iftype + {\caption@refstepcounter\@captype}% + {\caption@Error{\noexpand\phantomcaption outside float}}}% \caption@AtBeginDocument{% \DeclareCaptionOption{type}{\setcaptiontype{#1}}% \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}% @@ -764,12 +768,7 @@ \newcommand*\caption@typehook{} \newcommand*\caption@iftype{% \caption@ifundefined\@captype\@secondoftwo\@firstoftwo} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname currentgrouplevel\endcsname\relax - \caption@Debug{TeX engine: TeX} - \let\caption@checkgrouplevel\@gobbletwo -\else - \caption@Debug{TeX engine: e-TeX} +\caption@ifeTeX{% \newcommand*\caption@checkgrouplevel[2]{% \@ifundefined{#1caption@grouplevel}{% \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}% @@ -779,8 +778,10 @@ \else \caption@Warning{\string#2\MessageBreak outside box or environment}% \fi - }{}} -\fi + }{}}% +}{% + \let\caption@checkgrouplevel\@gobbletwo +} \newcommand*\caption@undefinedlabel{% \protect\caption@xref{\caption@labelname}{\on@line}} \DeclareRobustCommand*\caption@xref[2]{% @@ -861,6 +862,7 @@ \newcommand*\caption@Continued@Float[1]{% \edef\caption@tempa{#1}% \ifx\caption@tempa\caption@CFtype + \caption@restorecounters \caption@@ContinuedFloat{#1}% \else \caption@Error{Continued `#1' after `\caption@CFtype'}% @@ -883,10 +885,8 @@ \newcommand*\caption@resetContinuedFloat[1]{% \xdef\caption@CFtype{#1}% \@stpelt{ContinuedFloat}} -\newcommand\phantomcaption{% - \caption@iftype - {\caption@refstepcounter\@captype}% - {\caption@Error{\noexpand\phantomcaption outside float}}}% +\caption@ifundefined\donemaincaptionfalse{}{% + \g@addto@macro\donemaincaptionfalse\caption@savesubcounters} \newcommand*\caption@refstepcounter[1]{% \@ifundefined{c@#1}% {\caption@Error{No float type '#1' defined}}% @@ -1007,11 +1007,19 @@ \fi \c@ContinuedFloat=0\relax \let\caption@setfloatcapt\@firstofone - \caption@setbox{parbox}% + \caption@setbox{none}% \caption@clearmargin \caption@iflist{}{\let\caption@setlist\@gobble}% \caption@setoptions{sub}% \caption@setoptions{subfloat}% for subfig-package compatibility + \def\caption@settype{\caption@withoptargs\caption@sub@settype}% + \def\caption@sub@settype##1##2{% + \def\caption@tempa{##2}% + \ifx\caption@tempa\@captype +%%% \caption@setsubtype##1\relax + \else + \caption@Error{##2 inside \@subcaptype}% + \fi}% \let\caption\caption@subcaption \let\phantomcaption\caption@subphantom \if@subfloatrow @@ -1162,61 +1170,63 @@ \caption@setbool{needfreeze}{0} \caption@AtBeginDocument*{% \caption@ifneedfreeze{% - \newcommand*\caption@freeze[1]{% - \caption@settype*{#1}% - \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround! - \let\caption@frozen@ContinuedFloat\ContinuedFloat - \def\ContinuedFloat{% - \caption@@freeze{\caption@@@ContinuedFloat\@captype}% - \caption@frozen@ContinuedFloat}% - \let\caption@frozen@setup\caption@setup - \def\caption@setup##1{% - \caption@@freeze{\caption@setup{##1}}% - \caption@frozen@setup{##1}}% - \let\caption@frozen@caption\caption - \def\caption{% + \newcommand*\caption@freezetype[1]{% + \caption@settype*{#1}% + \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround! + \caption@freeze}% + \newcommand*\caption@freeze{% + \let\caption@frozen@ContinuedFloat\ContinuedFloat + \def\ContinuedFloat{% + \caption@@freeze{\caption@@@ContinuedFloat\@captype}% + \caption@frozen@ContinuedFloat}% + \let\caption@frozen@setup\caption@setup + \def\caption@setup##1{% + \caption@@freeze{\caption@setup{##1}}% + \caption@frozen@setup{##1}}% + \let\caption@frozen@caption\caption \def\caption{% - \caption@Error{% - Only one \noexpand\caption can be placed in this environment}% - \caption@gobble}% - \@ifstar - {\caption@SC@caption*}% - {\let\@currentlabel\caption@SClabel - \caption@withoptargs\caption@SC@caption}}% - \long\def\caption@SC@caption##1##2{% - \caption@@freeze{\caption##1{##2}}% - \ignorespaces}% - \let\caption@frozen@label\label - \def\label{% - \caption@withoptargs\caption@SC@label}% - \def\caption@SC@label##1##2{% - \ifx\@currentlabel\caption@SClabel - \@bsphack - \caption@freeze@label{##1}{##2}% - \@esphack - \else - \caption@frozen@label##1{##2}% - \fi}% - \def\caption@SClabel{\caption@undefinedlabel}% - \def\caption@freeze@label##1##2{% - \caption@@freeze{\label##1{##2}}}% - \global\let\caption@frozen@content\@empty - \long\def\caption@@freeze{% - \g@addto@macro\caption@frozen@content}% - \def\caption@warmup{% - \let\ContinuedFloat\caption@frozen@ContinuedFloat - \let\caption@setup\caption@frozen@setup - \let\caption\caption@frozen@caption - \let\label\caption@frozen@label}}% + \def\caption{% + \caption@Error{% + Only one \noexpand\caption can be placed in this environment}% + \caption@gobble}% + \@ifstar + {\caption@SC@caption*}% + {\let\@currentlabel\caption@SClabel + \caption@withoptargs\caption@SC@caption}}% + \long\def\caption@SC@caption##1##2{% + \caption@@freeze{\caption##1{##2}}% + \ignorespaces}% + \let\caption@frozen@label\label + \def\label{% + \caption@withoptargs\caption@SC@label}% + \def\caption@SC@label##1##2{% + \ifx\@currentlabel\caption@SClabel + \@bsphack + \caption@freeze@label{##1}{##2}% + \@esphack + \else + \caption@frozen@label##1{##2}% + \fi}% + \def\caption@SClabel{\caption@undefinedlabel}% + \def\caption@freeze@label##1##2{% + \caption@@freeze{\label##1{##2}}}% + \global\let\caption@frozen@content\@empty + \long\def\caption@@freeze{% + \g@addto@macro\caption@frozen@content}% + \def\caption@warmup{% + \let\ContinuedFloat\caption@frozen@ContinuedFloat + \let\caption@setup\caption@frozen@setup + \let\caption\caption@frozen@caption + \let\label\caption@frozen@label}}% \newcommand*\caption@prepare@defrost{% \let\caption@settype\caption@set@type} - \newcommand*\caption@defrost{% - \ifx\caption@frozen@caption\@undefined - \caption@frozen@content - \else - \caption@Error{Internal Error:\MessageBreak - \noexpand\caption@defrost in same group as \string\caption@freeze}% - \fi}% + \newcommand*\caption@defrost{% + \ifx\caption@frozen@caption\@undefined + \caption@frozen@content + \else + \caption@Error{Internal Error:\MessageBreak + \noexpand\caption@defrost in same group as \string\caption@freeze}% + \fi}% }{}% \caption@undefbool{needfreeze}} \let\caption@warmup\relax @@ -1303,7 +1313,7 @@ \def\FP@captype{#1}% \begin{lrbox}{\FP@floatCorpusBOX}% \minipage\hsize % changes from LR mode to vertical mode - \caption@freeze{#1}% + \caption@freezetype{#1}% \ignorespaces}% \renewcommand*\FP@floatEnd{% \endminipage @@ -1601,7 +1611,8 @@ \rotatebox{90}{% \ifdim\captionwidth=\z@ \setcaptionwidth{.8\vsize}% - \l@addto@macro\caption@singleline{\caption@setbox{none}}% + \l@addto@macro\caption@singleline{% + \caption@setup{parbox=none}}% \fi \let\caption@calcmargin\relax \caption@@make{#1}{#2}}% @@ -1613,7 +1624,7 @@ \def\SC@zfloat#1#2#3[#4]{% \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]% \SC@RestoreCommands - \caption@freeze{#2}% + \caption@freezetype{#2}% \let\SC@label\label}% \providecommand*\SC@RestoreCommands{% \let\caption=\SC@orig@caption \let\label=\SC@orig@label}% @@ -1700,15 +1711,15 @@ \let\caption@ORI@threeparttable\threeparttable \renewcommand*\threeparttable{% \caption@settype{table}% - \caption@setposition a% ? - \caption@clearmargin + \caption@setposition a% ? + \caption@clearmargin \caption@setoptions{threeparttable}% \caption@ORI@threeparttable}% \let\caption@ORI@measuredfigure\measuredfigure \renewcommand*\measuredfigure{% \caption@settype{figure}% - \caption@setposition a% ? - \caption@clearmargin + \caption@setposition a% ? + \caption@clearmargin \caption@setoptions{measuredfigure}% \caption@ORI@measuredfigure}% \def\TPT@caption#1[#2]#3{% diff --git a/Master/texmf-dist/tex/latex/caption/caption3.sty b/Master/texmf-dist/tex/latex/caption/caption3.sty index c6b49254cd9..c621116bf6e 100644 --- a/Master/texmf-dist/tex/latex/caption/caption3.sty +++ b/Master/texmf-dist/tex/latex/caption/caption3.sty @@ -39,15 +39,26 @@ \NeedsTeXFormat{LaTeX2e}[1994/12/01] \def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${% \def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }} -\caption@tempa $Id: caption3.sty 71 2013-04-14 15:14:26Z sommerfeldt $ -\ProvidesPackage{caption3}[\caption@tempa v1.5-\caption@tempb caption3 kernel (AR)] +\caption@tempa $Id: caption3.dtx 88 2013-05-02 05:15:09Z sommerfeldt $ +\ProvidesPackage{caption3}[\caption@tempa v1.6-\caption@tempb caption3 kernel (AR)] \providecommand*\@nameundef[1]{% \expandafter\let\csname #1\endcsname\@undefined} -\providecommand\l@addto@macro[2]{% - \begingroup - \toks@\expandafter{#1#2}% - \edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}% - \@tempa} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname currentgrouplevel\endcsname\relax + \PackageInfo{caption3}{TeX engine: TeX} + \let\caption@ifeTeX\@secondoftwo + \providecommand\l@addto@macro[2]{% + \begingroup + \toks@\expandafter{#1#2}% + \xdef\caption@addto@temp{\the\toks@}% + \endgroup + \let#1\caption@addto@temp} +\else + \PackageInfo{caption3}{TeX engine: e-TeX} + \let\caption@ifeTeX\@firstoftwo + \providecommand\l@addto@macro[2]{% + \edef#1{\unexpanded\expandafter{#1#2}}} +\fi \def\bothIfFirst#1#2{% \protected@edef\caption@tempa{#1}% \ifx\caption@tempa\@empty \else @@ -552,7 +563,7 @@ \expandafter{\caption@sls}}} \newcommand*\caption@resetstyle{% \caption@setup{% - box=parbox,boxcolor=white,% + box=none,boxcolor=white,parbox=parbox,% format=plain,labelformat=default,labelsep=colon,textformat=simple,% justification=justified,font=,size=,labelfont=,textfont=,% margin=0pt,minmargin=0,maxmargin=0,% @@ -569,18 +580,24 @@ \global\long\@namedef{caption@box@#1}##1##2{#2}} \@onlypreamble\DeclareCaptionBox \DeclareCaptionOption{box}{\caption@setbox{#1}} -\newcommand*\caption@setbox[1]{% - \@ifundefined{caption@box@#1}% - {\caption@Error{Undefined box `#1'}}% - {\expandafter\let\expandafter\caption@box\csname caption@box@#1\endcsname}} +\DeclareCaptionOption{parbox}{\caption@set@box\caption@parbox{#1}} +\newcommand*\caption@setbox{% + \caption@set@box\caption@box} +\newcommand*\caption@set@box[2]{% + \@ifundefined{caption@box@#2}% + {\caption@Error{Undefined box `#2'}}% + {\expandafter\let\expandafter#1\csname caption@box@#2\endcsname}} \DeclareCaptionBox{empty}{} \DeclareCaptionBox{none}{#2} \DeclareCaptionBox{parbox}{\parbox[b]{#1}{#2}} \DeclareCaptionBox{colorbox}{\colorbox{\caption@boxcolor}{% + \setlength\caption@tempdima{#1}% \addtolength\caption@tempdima{-2\fboxsep}% - \caption@box@parbox\caption@tempdima{#2}}} + \linewidth=\caption@tempdima\hsize=\caption@tempdima + #2}} \DeclareCaptionOption{boxcolor}{\def\caption@boxcolor{#1}} -\def\caption@box@default{\caption@box@parbox} +\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}} +\def\caption@box@default{\caption@box@none} \newcommand*\DeclareCaptionFormat{% \caption@teststar\caption@declareformat\@gobble\@firstofone} \@onlypreamble\DeclareCaptionFormat @@ -1069,7 +1086,8 @@ \caption@declarelabelseparator {\caption@ifbeamertemplate{caption name own line}\@gobble\@firstofone} {default} - {\caption@ifbeamertemplate{caption name own line}{\\}{: }} + {\caption@ifbeamertemplate{caption name own line}{\\}% + {\usebeamertemplate{caption label separator}}} \DeclareCaptionDefaultFont{font}{% \usebeamerfont*{caption}% \usebeamercolor[fg]{caption}} @@ -1312,29 +1330,31 @@ \begingroup \caption@stepthecounter \caption@beginhook - \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}% - \caption@calcmargin - \@tempdima\captionmargin - \ifdim\captionmargin@=\z@ \else - \caption@ifoddpage{}{\advance\@tempdima\captionmargin@}% - \fi - \caption@ifh{\advance\@tempdima\caption@indent}% - \hspace\@tempdima - \caption@tempdima\captionwidth - \caption@ifh{\advance\caption@tempdima-\caption@indent}% - \caption@parbox\caption@tempdima{% - \caption@ifh{% - \ifdim\caption@indent=\z@ - \leavevmode - \else - \hskip-\caption@indent - \fi}% - \caption@@@make{#1}{#2}}% - \@tempdima\captionmargin - \ifdim\captionmargin@=\z@ \else - \caption@ifoddpage{\advance\@tempdima\captionmargin@}{}% - \fi - \hspace\@tempdima + \caption@box\linewidth{% + \caption@ifslc{\caption@slc{#1}{#2}\caption@singleline\relax}{}% + \caption@calcmargin + \caption@tempdima\captionmargin + \ifdim\captionmargin@=\z@ \else + \caption@ifoddpage{}{\advance\caption@tempdima\captionmargin@}% + \fi + \caption@ifh{\advance\caption@tempdima\caption@indent}% + \hspace\caption@tempdima + \caption@tempdima\captionwidth + \caption@ifh{\advance\caption@tempdima-\caption@indent}% + \caption@parbox\caption@tempdima{% + \caption@ifh{% + \ifdim\caption@indent=\z@ + \leavevmode + \else + \hskip-\caption@indent + \fi}% + \caption@@@make{#1}{#2}}% + \caption@tempdima\captionmargin + \ifdim\captionmargin@=\z@ \else + \caption@ifoddpage{\advance\caption@tempdima\captionmargin@}{}% + \fi + \hspace\caption@tempdima + }% \caption@endhook \endgroup \global\caption@starfalse} @@ -1410,7 +1430,6 @@ \endgroup} \newcommand*\caption@l@stepcounter[1]{% \advance\csname c@#1\endcsname\@ne\relax} -\newcommand*\caption@parbox{\caption@box} \newcommand*\caption@applyfont{% \caption@hj\captionfont\captionsize} \newcommand\caption@@@make[2]{% @@ -1559,6 +1578,19 @@ \fi} \@onlypreamble\caption@@@@@@declaresublistentry \newcommand*\caption@subtypelist{} +\newcommand*\caption@restorecounters{% + \caption@restore@counters + \global\let\caption@restore@counters\@empty} +\newcommand*\caption@restore@counters{} +\newcommand*\caption@savesubcounters{% + \def\@elt##1{\caption@savecounter{sub##1}}% + \caption@subtypelist + \let\@elt\relax}% +\newcommand*\caption@savecounter[1]{% + \edef\caption@tempa{% + \noexpand\l@addto@macro\noexpand\caption@restore@counters + {\noexpand\setcounter{#1}{\number\value{#1}}}}% + \caption@tempa} \newcommand*\caption@For{\caption@withoptargs\caption@@For} \newcommand\caption@@For[3]{% \caption@AtBeginDocument#1{% diff --git a/Master/texmf-dist/tex/latex/caption/newfloat.sty b/Master/texmf-dist/tex/latex/caption/newfloat.sty index b945f492bbb..c72ffd9ab61 100644 --- a/Master/texmf-dist/tex/latex/caption/newfloat.sty +++ b/Master/texmf-dist/tex/latex/caption/newfloat.sty @@ -6,7 +6,7 @@ %% %% newfloat.dtx (with options: `package') %% -%% Copyright (C) 1994-2013 Axel Sommerfeldt +%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% http://sourceforge.net/projects/latex-caption/ %% @@ -24,17 +24,23 @@ %% %% This Current Maintainer of this work is Axel Sommerfeldt. %% -%% This work consists of the files caption.ins, caption.dtx, caption2.dtx, -%% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx, -%% the derived files caption.sty, caption2.sty, caption3.sty, -%% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty, -%% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. +%% This work consists of the files +%% CHANGELOG, README, SUMMARY, caption.ins, +%% caption.dtx, caption2.dtx, caption3.dtx, +%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, +%% newfloat.dtx, and totalcount.dtx +%% the derived files +%% caption.sty, caption2.sty, caption3.sty, +%% bicaption.sty, ltcaption.sty, subcaption.sty, +%% newfloat.sty, and totalcount.sty +%% and the user manuals +%% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] \def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${% \def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }} -\caption@tempa $Id: newfloat.sty 62 2013-02-03 10:40:15Z sommerfeldt $ -\ProvidesPackage{newfloat}[\caption@tempa v1.0-\caption@tempb Defining new floating environments (AR)] +\caption@tempa $Id: newfloat.sty 91 2013-05-11 12:25:57Z sommerfeldt $ +\ProvidesPackage{newfloat}[\caption@tempa v1.1-\caption@tempb Defining new floating environments (AR)] \newcommand*\newfloat@Info[1]{% \PackageInfo{newfloat}{#1}} \newcommand*\newfloat@InfoNoLine[1]{% @@ -45,6 +51,16 @@ If you do not understand this error, please take a closer look\MessageBreak at the documentation of the `newfloat' package.\MessageBreak\@ehc} \RequirePackage{keyval}[1997/11/10] +\newcommand*\newfloat@def[2]{% + \newfloat@ifundefined{#1}{% + \@namedef{#1}{#2}}} +\newcommand*\newfloat@let[2]{% + \newfloat@ifundefined{#1}{% + \expandafter\let\csname #1\endcsname#2}} +\newcommand*\newfloat@ifundefined[2]{% + \@ifundefined{#1}{#2}{% + \newfloat@Info{% + \expandafter\string\csname#1\endcsname\space is already defined}}} \newcommand*\DeclareFloatingEnvironment{% \@testopt\@DeclareFloatingEnvironment{}} \@onlypreamble\DeclareFloatingEnvironment @@ -55,7 +71,7 @@ \edef\@tempa{% \noexpand\g@addto@macro\noexpand\newfloat@Type{\@cdr#2\@nil}}% \@tempa - \newcounter{#2}% + \newfloat@ifundefined{c@#2}{\newcounter{#2}}% \ifdefined\c@float@type % from float package \expandafter\edef\csname ftype@#2\endcsname{\the\value{float@type}}% \addtocounter{float@type}{\value{float@type}}% @@ -71,25 +87,36 @@ \advance\newfloat@ftype\newfloat@ftype \fi\fi \newfloat@Info{float type `#2'=\@nameuse{ftype@#2}}% - \@namedef{fnum@#2}{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}% - \expandafter\newcommand\csname #2name\endcsname{}% - \expandafter\let\csname #2name\endcsname\newfloat@Type - \@namedef{fleg#2}{\@nameuse{#2name}}% legend naming (memoir) - \@namedef{flegtoc#2}##1{}% - \newenvironment{#2}{\@float{#2}}{\end@float}% - \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% - \expandafter\newcommand\csname listof#2s\endcsname{\newfloat@listof{#2}}% - \expandafter\newcommand\csname listof#2es\endcsname{\newfloat@listof{#2}}% + \newfloat@def{fnum@#2}% + {\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}% + \newfloat@let{#2name}{\newfloat@Type}% + \newfloat@def{fleg#2}{\@nameuse{#2name}}% legend naming (memoir) + \newfloat@ifundefined{flegtoc#2}{\@namedef{flegtoc#2}##1{}}% + \ifcsname @tufte@float\endcsname + \newenvironment{#2}[1][htbp]% + {\begin{@tufte@float}[##1]{#2}{}}% + {\end{@tufte@float}}% + \newenvironment{#2*}[1][htbp]% + {\begin{@tufte@float}[##1]{#2}{star}}% + {\end{@tufte@float}}% + \else + \newenvironment{#2}{\@float{#2}}{\end@float}% + \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% + \fi + \newfloat@def{listof#2}{\newfloat@listof{#2}}% + \newfloat@def{listof#2s}{\@nameuse{listof#2}}% + \newfloat@def{listof#2es}{\@nameuse{listof#2s}}% + \newfloat@def{newfloat@listof#2@hook}{}% \ifdefined\l@figure - \expandafter\let\csname l@#2\endcsname\l@figure + \newfloat@let{l@#2}{\l@figure}% \else - \@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}% + \newfloat@def{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}% \fi - \expandafter\newcommand\csname list#2name\endcsname{}% - \expandafter\xdef\csname list#2name\endcsname{List of \newfloat@Type s}% + \edef\newfloat@tempa{List of \newfloat@Type s}% + \newfloat@let{list#2name}{\newfloat@tempa}% \expandafter\let\csname fst@#2\endcsname\@undefined - \newfloat@setplacement{#2}{tbp}% - \newfloat@setfileext{#2}{lo#2}% + \newfloat@ifundefined{fps@#2}{\newfloat@setplacement{#2}{tbp}}% + \newfloat@ifundefined{ext@#2}{\newfloat@setfileext{#2}{lo#2}}% \newfloat@setoptions*{#2}{#1}% \@expandtwoargs\newfloat@announce{#2}{\@nameuse{ext@#2}}% \@ifnextchar[\newfloat@DFE@setname\relax} @@ -102,18 +129,18 @@ \KV@@newfloat@listname{#1}} \@onlypreamble\newfloat@DFE@setlistname \newcommand*\newfloat@listof[1]{% - \ifcsname listoftoc\endcsname - \expandafter\listoftoc\expandafter{\@nameuse{ext@#1}}% - \else - \begingroup - \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname - \expandafter\let\expandafter\ext@figure\csname ext@#1\endcsname - \let\newfloat@ORI@starttoc\@starttoc - \renewcommand*\@starttoc[1]{% - \expandafter\newfloat@ORI@starttoc\expandafter{\ext@figure}}% - \listoffigures - \endgroup - \fi} + \@expandtwoargs\newfloat@list@of{#1}{\@nameuse{ext@#1}}} +\newcommand*\newfloat@list@of[2]{% + \begingroup + \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname + \def\ext@figure{#2}% + \let\newfloat@starttoc\@starttoc + \def\@starttoc##1{\newfloat@starttoc{#2}}% + \let\newfloat@listoftoc\listoftoc + \def\listoftoc##1{\newfloat@listoftoc{#2}}% + \@nameuse{newfloat@listof#1@hook}% + \listoffigures + \endgroup} \newcommand*\newfloat@setoptions{% \@ifstar {\newfloat@@setoptions\@firstofone}% @@ -235,19 +262,18 @@ \newcommand*\newfloat@announce[2]{% \@cons\newfloat@list{{#1}}% \@cons\newfloat@@list{{#1}}% - \@ifundefined{newfloat@ext@#2}{% + \newfloat@ifundefined{newfloat@ext@#2}{% \@namedef{newfloat@ext@#2}{#1}% \ifcsname c@lofdepth\endcsname - \@ifundefined{c@#2depth}{% + \newfloat@ifundefined{c@#2depth}{% \newcounter{#2depth}% - \setcounter{#2depth}{1}% - }{}% + \setcounter{#2depth}{1}}% \fi \ifcsname addtotoclist\endcsname \addtotoclist[float]{#2}% - \@namedef{listof#2name}{\@nameuse{list#1name}}% + \newfloat@def{listof#2name}{\@nameuse{list#1name}}% \fi - }{}% + }% \ifcsname contentsuse\endcsname \contentsuse{#1}{#2}% \fi @@ -271,14 +297,16 @@ \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}% \@tempa} \providecommand*\newfloat@hook[1]{} +\newcommand\PrepareListOf[1]{% + \expandafter\g@addto@macro\csname newfloat@listof#1@hook\endcsname} +\@onlypreamble\PrepareListOf \newcommand*\newfloat@list{} \newcommand*\newfloat@addtolist[1]{% \newfloat@ifinlist{#1}{}{% \ifcsname ext@#1\endcsname \@cons\newfloat@list{{#1}}% \@namedef{newfloat@ext@\@nameuse{ext@#1}}{#1}% - \@ifundefined{@ifchapterlistsgap@#1}{% - \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden}{}% + \newfloat@let{@ifchapterlistsgap@#1}{\@iden}% \else \newfloat@Error{`#1' does not seem to be a floating environment}% \fi}} diff --git a/Master/texmf-dist/tex/latex/caption/totalcount.sty b/Master/texmf-dist/tex/latex/caption/totalcount.sty index 350bbb2f815..e609df916cf 100644 --- a/Master/texmf-dist/tex/latex/caption/totalcount.sty +++ b/Master/texmf-dist/tex/latex/caption/totalcount.sty @@ -6,7 +6,7 @@ %% %% totalcount.dtx (with options: `package') %% -%% Copyright (C) 1994-2013 Axel Sommerfeldt +%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% http://sourceforge.net/projects/latex-caption/ %% @@ -37,45 +37,58 @@ %% caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{totalcount}[2008/02/27 v0.7 Total values of counters (AR)] +\ProvidesPackage{totalcount}[2008/03/09 v1.0 Total values of counters (AR)] \newcommand*\DeclareTotalCounter[1]{% \@ifundefined{c@#1}% {\PackageError{totalcount}{Undefined counter `#1'}\@ehc}% - {\newcounter{total@#1}% + {\newcounter{totalcount@#1}% \@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}% - \@namedef{total#1es}{\nfss@text{\reset@font\bfseries ??}}% - \@cons\total@counters{{#1}}}} + \@namedef{total#1es}{\@nameuse{total#1s}}% + \expandafter\newif\csname iftotal#1s\endcsname + \@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}% + \@cons\totalcount@counters{{#1}}}} \@onlypreamble\DeclareTotalCounter -\let\total@counters\@empty -\newcommand*\total@xspace{} -\DeclareOption{xspace}{\renewcommand*\total@xspace{\xspace}} +\let\totalcount@counters\@empty +\newcommand*\totalcount@xspace{} +\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}} \DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}} \ProcessOptions\relax -\ifx\total@xspace\@empty\else +\ifx\totalcount@xspace\@empty\else \RequirePackage{xspace} \fi -\newcommand*\total@addtocounter[1]{% - \@ifundefined{c@total@#1}{}{% - \addtocounter{total@#1}{\value{#1}}}} -\let\total@stpelt@ORI\@stpelt +\newcommand*\totalcount@addtocounter[1]{% + \@ifundefined{c@totalcount@#1}{}{% + \addtocounter{totalcount@#1}{\value{#1}}}} +\let\totalcount@stpelt@ORI\@stpelt \renewcommand*\@stpelt[1]{% - \total@addtocounter{#1}\total@stpelt@ORI{#1}} + \totalcount@addtocounter{#1}% + \totalcount@stpelt@ORI{#1}} +\newcommand*\totalcount@set[2]{% + \@ifundefined{c@totalcount@#1}{}{% + \global\@namedef{total#1s}{#2\totalcount@xspace}% + \ifnum#2=0\relax \else + \global\@nameuse{total#1strue}% + \fi}} \AtBeginDocument{\AtEndDocument{% \begingroup \@tempswafalse + \if@filesw + \immediate\write\@mainaux{% + \string\providecommand\string\totalcount@set[2]{}}% + \fi \def\@elt#1{% - \total@addtocounter{#1}% - \xdef\total@tempa{\the\value{total@#1}}% - \xdef\total@tempb{\total@tempa\noexpand\total@xspace}% - \expandafter\ifx\csname total#1s\endcsname\total@tempb \else + \totalcount@addtocounter{#1}% + \edef\totalcount@tempa{\the\value{totalcount@#1}}% + \expandafter\let\expandafter\totalcount@tempb\csname total#1s\endcsname + \@expandtwoargs\totalcount@set{#1}{\totalcount@tempa}% + \expandafter\ifx\csname total#1s\endcsname\totalcount@tempb \else \@tempswatrue \fi \if@filesw \immediate\write\@mainaux{% - \string\gdef\string\total#1s{\total@tempa\string\total@xspace}% - \string\gdef\string\total#1es{\total@tempa\string\total@xspace}}% + \string\totalcount@set{#1}{\totalcount@tempa}}% \fi}% - \total@counters + \totalcount@counters \if@tempswa \PackageWarningNoLine{totalcount}{% Total counter(s) have changed.\MessageBreak -- cgit v1.2.3