diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-09 00:39:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-09 00:39:21 +0000 |
commit | 60cbc8437dcfde310f54a43fd254865ec7e5296a (patch) | |
tree | 119dc082348b649e2fa1fb8eb6ba90639fe764df /Master/texmf-dist/tex/latex/caption/newfloat.sty | |
parent | 7e39ebb4ceedd3a7699e90140504b8373cdf26cf (diff) |
caption (8jan13)
git-svn-id: svn://tug.org/texlive/trunk@28765 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/newfloat.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/newfloat.sty | 69 |
1 files changed, 57 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/caption/newfloat.sty b/Master/texmf-dist/tex/latex/caption/newfloat.sty index b4ccd4b4610..507be3322d4 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-2012 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) %% %% -------------------------------------------------------------------------- %% @@ -29,9 +29,11 @@ %% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. %% \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{newfloat}[2011/11/16 v1.0a Defining new floating environments (AR)] +\ProvidesPackage{newfloat}[2012/05/19 v1.0b Defining new floating environments (AR)] \newcommand*\newfloat@Info[1]{% \PackageInfo{newfloat}{#1}} +\newcommand*\newfloat@InfoNoLine[1]{% + \newfloat@Info{#1\@gobble}} \newcommand*\newfloat@Error[1]{% \PackageError{newfloat}{#1}\newfloat@eh} \newcommand*\newfloat@eh{% @@ -270,6 +272,8 @@ \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}{}% \else \newfloat@Error{`#1' does not seem to be a floating environment}% \fi}} @@ -297,17 +301,18 @@ \@@addchapterlistsgap{#1}{#2}}} \providecommand*\@@addchapterlistsgap[2]{% \@ifundefined{@addchapterlistsgap@#2}{% only once per extension - \@namedef{@addchapterlistsgap@#2}{}% + \@namedef{@addchapterlistsgap@#2}{#1}% \@@@addchapterlistsgap{#2}}{}} \providecommand*\@@@addchapterlistsgap[1]{% \ifdim \@chapterlistsgap>\z@ \addtocontents{#1}{\protect\addvspace{\@chapterlistsgap}}% \fi} \providecommand*\@addchapterlistsgaps{% - \def\@elt##1{% - \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% - \newfloat@list - \let\@elt\relax} + \begingroup + \def\@elt##1{% + \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% + \newfloat@list + \endgroup} \providecommand*\@chapterlistsgap@off[1]{% \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@gobble \ifcsname unsettoc\endcsname @@ -340,8 +345,25 @@ }% \newfloat@list \let\@elt\relax +\define@key{newfloat}{planb}[true]{% + \def\@tempa{#1}% + \def\@tempb{false}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@gobble + \else + \def\@tempb{true}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@iden + \else + \newfloat@Error{Invalid value `#1' for option `planb'}% + \fi + \fi} +\define@key{newfloat}{planb-fileext}{% + \newfloat@Info{Setting Plan B file extension to `#1'} + \xdef\newfloat@addtocontents@ext{#1}} + \let\@tempc\relax -\@expandtwoargs\setkeys{newfloat}{\@ptionlist{\@currname.\@currext}}% +\@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}% \AtEndOfPackage{\let\@unprocessedoptions\relax} \newcommand*\newfloatsetup{\setkeys{newfloat}} \newcommand\newfloat@replace@chapter[2]{% @@ -613,10 +635,33 @@ \@afterheading \fi} \ifx\newfloat@replace@chapter\@gobbletwo \else - \PackageWarningNoLine{newfloat}{% - Unsupported document class, or\MessageBreak - \noexpand\@chapter was already redefined by another package} - \newfloat@Info{\string\@chapter\space=\space\meaning\@chapter} + \newfloat@InfoNoLine{% + Unsupported document class, or \noexpand\@chapter\MessageBreak + was already redefined by another package} + \newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter} + \newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter} + \newfloat@ifplanb{% + \newfloat@InfoNoLine{Trying Plan B..}% + \let\newfloat@addtocontents@ORI\addtocontents + \long\def\addtocontents#1#2{% + \newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}% + \long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{% + \def\newfloat@tempa{#4}% + \ifx\newfloat@tempa\@empty + \newfloat@addtocontents@ORI{#1}{#2}% + \else + \ifx\newfloat@addtocontents@ext\@undefined + \newfloat@Info{Setting Plan B file extension to `#1'...}% + \xdef\newfloat@addtocontents@ext{#1}% + \fi + \edef\newfloat@tempa{#1}% + \ifx\newfloat@tempa\newfloat@addtocontents@ext + \begingroup + \let\addtocontents\newfloat@addtocontents@ORI + \@addchapterlistsgaps + \endgroup + \fi + \fi}} \fi \newcommand\newfloat@ForEachNew[2][newfloat@@list]{% \AtBeginDocument{% |