diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-11 22:52:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-11 22:52:26 +0000 |
commit | b99aff7fb5a21795eb841a12a8fc470e804fa9a6 (patch) | |
tree | 84e5fcbeefe5a62ce5a01b6da1b72c593735d861 /Master/texmf-dist/tex/latex/caption/caption3.sty | |
parent | 24c628b30e23e7037f962faaac95678b62764b1f (diff) |
caption (11may13)
git-svn-id: svn://tug.org/texlive/trunk@30407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/caption/caption3.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/caption/caption3.sty | 110 |
1 files changed, 71 insertions, 39 deletions
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{% |