summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-15 22:23:40 +0000
committerKarl Berry <karl@freefriends.org>2013-04-15 22:23:40 +0000
commitc55f2ef12e38e9282affe822bee7b395651844b7 (patch)
treebc0e3a9621623275ab3a0336937e0afffb018a19 /Master/texmf-dist/source/latex/caption/caption.dtx
parent0639a522410335d1b0ada2c404a8e8b7b6b408c6 (diff)
caption (15apr13)
git-svn-id: svn://tug.org/texlive/trunk@29955 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/caption.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption.dtx113
1 files changed, 86 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption.dtx b/Master/texmf-dist/source/latex/caption/caption.dtx
index 1059245b1a2..64991dcd6fa 100644
--- a/Master/texmf-dist/source/latex/caption/caption.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption.dtx
@@ -2,7 +2,7 @@
%
% This is file `caption.dtx'.
%
-% $Id: caption.dtx 65 2013-02-03 15:09:48Z sommerfeldt $
+% $Id: caption.dtx 73 2013-04-14 19:40:46Z sommerfeldt $
% $HeadURL: svn+ssh://sommerfeldt@svn.code.sf.net/p/latex-caption/code/trunk/source/caption.dtx $
%
% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
@@ -28,7 +28,7 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{3459}
+% \CheckSum{3491}
%
% \iffalse
%<*driver>
@@ -77,9 +77,9 @@
%</driver>
% \fi
%
-% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
-% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
-% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+% \newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
+% \newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
+% \newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
% \let\class\puresf \let\package\puresf
% \let\env\purett \let\opt\purett
%
@@ -223,7 +223,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: caption.dtx 65 2013-02-03 15:09:48Z sommerfeldt $
+\caption@tempa $Id: caption.dtx 73 2013-04-14 19:40:46Z sommerfeldt $
\ProvidesPackage{caption}[\caption@tempa v3.3-\caption@tempb Customizing captions (AR)]
% \end{macrocode}
%
@@ -641,9 +641,6 @@
\g@addto@macro\@tablecaptionabovetrue{\captionsetup*[table]{position=t}}
\g@addto@macro\@tablecaptionabovefalse{\captionsetup*[table]{position=b}}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macrocode}
\if@tablecaptionabove
\@tablecaptionabovetrue
@@ -651,6 +648,31 @@
\@tablecaptionabovefalse
\fi
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@figurecaptionabovetrue}
+% \begin{macro}{\@figurecaptionabovefalse}
+% \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added}
+% \begin{macrocode}
+ \caption@ifundefined\@figurecaptionabovetrue{}{%
+% \end{macrocode}
+% \begin{macrocode}
+ \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}}
+ \g@addto@macro\@figurecaptionabovefalse{\captionsetup*[figure]{position=b}}
+% \end{macrocode}
+% \begin{macrocode}
+ \if@figurecaptionabove
+ \@figurecaptionabovetrue
+ \else
+ \@figurecaptionabovefalse
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\onelinecaptionstrue}
% \begin{macro}{\onelinecaptionsfalse}
@@ -659,9 +681,6 @@
\g@addto@macro\onelinecaptionstrue{\let\caption@ifslc\@firstoftwo}
\g@addto@macro\onelinecaptionsfalse{\let\caption@ifslc\@secondoftwo}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macrocode}
\ifonelinecaptions
\onelinecaptionstrue
@@ -669,6 +688,8 @@
\onelinecaptionsfalse
\fi
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@captionabovetrue}
% \begin{macro}{\@captionabovefalse}
@@ -829,6 +850,34 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\caption@clrflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% \begin{macro}{\caption@setflag}
+% \changes{v3.3}{2013/04/14}{This macro added}
+% Furthermore we introduce the macros \cs{caption@clrflag} and \cs{caption@setflag}
+% for clearing resp.~setting these flags.
+% \begin{macrocode}
+\newcommand*\caption@clrflag[1]{%
+ \caption@chgflag{#1}{false}}
+\newcommand*\caption@setflag[1]{%
+ \caption@chgflag{#1}{true}}
+\newcommand*\caption@chgflag[2]{%
+ \global\csname caption@#1#2\endcsname}
+% \end{macrocode}
+% The \package{floatrow} package uses \cs{FR@loc@} to keep changes
+% (flags, counters, \ldots) local. Since it is not aware of our flags above
+% we need to extend that macro (if defined).
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \caption@ifundefined\FR@loc@{}{%
+ \caption@InfoNoLine{floatrow package is loaded}%
+ \g@addto@macro\FR@loc@{%
+ \renewcommand*\caption@chgflag[2]{%
+ \csname caption@#1#2\endcsname}}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\caption@caption}
% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
@@ -1538,9 +1587,9 @@
% (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
% \begin{macrocode}
\newcommand*\caption@settype{%
- \global\caption@captionfalse
- \global\caption@subcaptionfalse
- \global\caption@ContinuedFloatfalse
+ \caption@clrflag{caption}%
+ \caption@clrflag{subcaption}%
+ \caption@clrflag{ContinuedFloat}%
\caption@set@type}
% \end{macrocode}
% \begin{macrocode}
@@ -1847,7 +1896,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@@ContinuedFloat[1]{%
- \global\caption@ContinuedFloattrue
+ \caption@setflag{ContinuedFloat}%
\stepcounter{ContinuedFloat}%
\caption@@@ContinuedFloat{#1}}
% \end{macrocode}
@@ -1919,12 +1968,12 @@
% therefore ending this part, so we set the flag to |false| in this case.)
% \begin{macrocode}
\caption@fixposition
- \caption@iftop{\global\caption@captiontrue}{\global\caption@captionfalse}%
+ \caption@iftop\caption@setflag\caption@clrflag{caption}%
% \end{macrocode}
% This part does not contain content (like sub-figures) yet,
% so we set |\if|\-|caption@sub|\-|caption| to |false|.
% \begin{macrocode}
- \global\caption@subcaptionfalse
+ \caption@clrflag{subcaption}%
% \end{macrocode}
% Support of the \textsf{memoir} document class.
% \begin{macrocode}
@@ -1934,7 +1983,7 @@
\newcommand*\caption@ref@stepcounter{%
\ifcaption@ContinuedFloat
\let\caption@tempa\caption@@refcounter
- \global\caption@ContinuedFloatfalse
+ \caption@clrflag{ContinuedFloat}%
\else
\let\caption@tempa\caption@@refstepcounter
\ifcaption@caption \else
@@ -1970,7 +2019,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@prepare@stepcounter[2]{%
- \flushsubcaptionlistentries[#2stepcounter]%
+ \caption@addsubcontentslines{#2stepcounter}%
\caption@resetContinuedFloat{#1}}
% \end{macrocode}
% \begin{macrocode}
@@ -2246,14 +2295,15 @@
\ifcaption@caption \else
% no \caption in this part of the (floating) environment yet
\let\caption@add@contentsline\caption@addsubcontentsline
+ \let\caption@addsubcontentslines\@gobble
\ifcaption@subcaption \else
% no \subcaption in this part of the (floating) environment yet
\ifcaption@ContinuedFloat
- \global\caption@ContinuedFloatfalse
+ \caption@clrflag{ContinuedFloat}%
\else
\caption@@stepcounter\@captype
\fi
- \global\caption@subcaptiontrue
+ \caption@setflag{subcaption}%
\fi
\fi
% \end{macrocode}
@@ -2334,6 +2384,7 @@
% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
% \changes{v3.3}{2012/01/15}{Debug message added}
+% \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
% Add a pending sub-caption list entry.
% \begin{macrocode}
\newcommand*\caption@addsubcontentsline[4]{%
@@ -2348,16 +2399,21 @@
\ifx\@currentHref\@undefined \else
\noexpand\def\noexpand\@currentHref{\@currentHref}%
\fi
- \protect\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
+ \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
\@tempa}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\flushsubcaptionlistentries}
% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
+% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
% Writes pending sub-caption list entries.
% \begin{macrocode}
-\newcommand*\flushsubcaptionlistentries[1][user]{%
+\newcommand*\flushsubcaptionlistentries{%
+ \caption@addsubcontentslines{user}}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand*\caption@addsubcontentslines[1]{%
\caption@Debug{\string\flushsubcaptionlistentries (#1)}%
\begingroup
\caption@subcontentslines
@@ -2372,19 +2428,19 @@
\AtBeginDocument{\caption@ifundefined\chapter{}{%
\let\caption@chapter@ORI\chapter
\def\chapter{%
- \flushsubcaptionlistentries[chapter]\caption@chapter@ORI}}}
+ \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}}
% \end{macrocode}
% Same for \cs{appendix}.
% \begin{macrocode}
\AtBeginDocument{\caption@ifundefined\appendix{}{%
\let\caption@appendix@ORI\appendix
\def\appendix{%
- \flushsubcaptionlistentries[appendix]\caption@appendix@ORI}}}
+ \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}}
% \end{macrocode}
% Flush the list of pending sub-caption list entries at the end of the document.
% \begin{macrocode}
\AtEndDocument{%
- \flushsubcaptionlistentries[AtEndDocument]}
+ \caption@addsubcontentslines{AtEndDocument}}
% \end{macrocode}
% \end{macro}
%
@@ -3826,6 +3882,7 @@
%
% \begin{macro}{\caption@wincaption}
% \changes{v3.1d}{2007/10/25}{Missing \% added}
+% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
% This one finally typesets the caption using |\caption|.
% \begin{macrocode}
\newcommand\caption@wincaption[1]{%
@@ -3837,6 +3894,8 @@
\let\caption@makecurrent\@gobbletwo
\let\caption@@start\relax
\caption@prepareslc
+ \else
+ \caption@ContinuedFloattrue
\fi
% \end{macrocode}
% The argument |#1| could contain simply the caption text