summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption3.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/caption3.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption3.dtx87
1 files changed, 72 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx
index d1b72258426..edf1839953d 100644
--- a/Master/texmf-dist/source/latex/caption/caption3.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption3.dtx
@@ -2,10 +2,10 @@
%
% This is file `caption3.dtx'.
%
-% $Id: caption3.dtx 88 2013-05-02 05:15:09Z sommerfeldt $
-% $HeadURL: svn+ssh://sommerfeldt@svn.code.sf.net/p/latex-caption/code/trunk/source/caption3.dtx $
+% $Id: caption3.dtx 111 2015-09-17 09:48:20Z sommerfeldt $
+% $HeadURL: svn+ssh://sommerfeldt@svn.code.sf.net/p/latex-caption/code/branches/3.3/source/caption3.dtx $
%
-% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 1994-2015 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -28,12 +28,12 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{3543}
+% \CheckSum{3633}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{caption3.drv}[2013/05/01 v1.6 Implementation of the caption kernel]
+\ProvidesFile{caption3.drv}[2015/09/15 v1.7 Implementation of the caption kernel]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -203,8 +203,8 @@
\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.dtx 88 2013-05-02 05:15:09Z sommerfeldt $
-\ProvidesPackage{caption3}[\caption@tempa v1.6-\caption@tempb caption3 kernel (AR)]
+\caption@tempa $Id: caption3.dtx 111 2015-09-17 09:48:20Z sommerfeldt $
+\ProvidesPackage{caption3}[\caption@tempa v1.7-\caption@tempb caption3 kernel (AR)]
% \end{macrocode}
%
% \subsection{Generic helpers}
@@ -1733,13 +1733,15 @@
% \end{macro}
%
% \changes{v1.2}{2007/12/16}{Caption label format \opt{brace} added}
-% There are four pre-defined label formats, called `empty', `simple',
-% `parens', and `brace'.
+% \changes{v1.7}{2015/09/16}{Caption label format \opt{autodot} added}
+% There are five pre-defined label formats, called `empty', `simple',
+% `parens', `brace', and `autodot'.
% \begin{macrocode}
\DeclareCaptionLabelFormat{empty}{}
\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
\DeclareCaptionLabelFormat{brace}{\bothIfFirst{#1}{\nobreakspace}#2)}
+\DeclareCaptionLabelFormat{autodot}{\bothIfFirst{#1}{\nobreakspace}\autodot}
% \end{macrocode}
%
% `default' usually maps to `simple'.
@@ -1867,8 +1869,20 @@
%
% There are three pre-defined text formats, called `empty', `simple' and `period'.
% \changes{v1.4}{2011/10/05}{Pre-defined text format `empty' added}
+% \changes{v1.7}{2015/09/16}{The text format `empty' now takes care of the \cs{label}}
+% \begin{macrocode}
+\DeclareCaptionTextFormat{empty}{%
+ \caption@get@label#1\caption@makeanchor{}\@nil
+ \caption@thelabel}
+\long\def\caption@get@label#1\caption@makeanchor#2#3\@nil{%
+ \def\caption@tempa{#2}%
+ \ifx\caption@tempa\@empty
+ \caption@getlabel#1\label{}\@nil
+ \else
+ \caption@getlabel#2\label{}\@nil
+ \fi}
+% \end{macrocode}
% \begin{macrocode}
-\DeclareCaptionTextFormat{empty}{}
\DeclareCaptionTextFormat{simple}{#1}
\DeclareCaptionTextFormat{period}{#1.}
% \end{macrocode}
@@ -1878,6 +1892,43 @@
\def\caption@tfmt@default{\caption@tfmt@simple}
% \end{macrocode}
%
+% \begin{macro}{\caption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% \changes{v1.7}{2015/09/16}{Moved from \package{bicaption} package to \package{caption3}}
+% Gets the label command out of the (first) caption text and stores it to |\caption@thelabel|.
+% \begin{macrocode}
+\long\def\caption@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\caption@thelabel\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\caption@thelabel{\label*}%
+ \caption@@getlabel#3\@nil
+ \else
+ \def\caption@thelabel{\label}%
+ \caption@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \caption@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\caption@thelabel{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\caption@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\caption@thelabel{[{#1}]}%
+ \caption@@getlabel#2\@nil}
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Fonts}
%
% \begin{macro}{\DeclareCaptionFont}
@@ -2441,10 +2492,11 @@
% \begin{macro}{\DeclareCaptionListFormat}
% \changes{v1.1}{2004/07/15}{This macro added}
% \changes{v1.2}{2007/11/17}{Renamed from \cs{DeclareCaptionListOfFormat} to \cs{DeclareCaptionListFormat}}
+% \changes{v1.7}{2015/09/15}{Argument \#3 added which holds the environment name}
% |\DeclareCaptionListFormat|\marg{name}\marg{code with \#1 and \#2}
% \begin{macrocode}
\newcommand*\DeclareCaptionListFormat[2]{%
- \global\@namedef{caption@lstfmt@#1}##1##2{#2}}
+ \global\@namedef{caption@lstfmt@#1}##1##2##3{#2}}
\@onlypreamble\DeclareCaptionListFormat
% \end{macrocode}
% \end{macro}
@@ -3051,6 +3103,7 @@
% \changes{v1.4}{2011/08/19}{Split into three macros}
% \changes{v1.4}{2011/08/30}{Support for option \opt{listtype=} added}
% \changes{v1.5}{2012/01/15}{Usage of \cs{caption@addsubcontentslines} added}
+% \changes{v1.7}{2015/09/15}{Argument \#3 which holds the environment name added to \cs{caption@lstfmt}}
% |\caption@addcontentsline|\marg{type}\marg{list entry}\par
% Makes an entry in the list-of-whatever, if requested,
% i.e.~the argument \meta{list entry} is not empty and
@@ -3083,7 +3136,7 @@
{\caption@add@contentsline
{\csname ext@#1\endcsname}%
{#1}%
- {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
+ {\caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}{#1}}%
{\ignorespaces #2}}}}
% \end{macrocode}
% \begin{macrocode}
@@ -3590,6 +3643,7 @@
% \changes{v1.4}{2011/10/09}{Support of the titletoc package added}
% \changes{v1.5}{2011/12/29}{Usage of \cs{caption@addtoreset} replaced by \cs{@addtoreset}}
% \changes{v1.5}{2013/01/10}{Bugfix: Definition of autoref string corrected}
+% \changes{v1.6}{2013/06/17}{Bugfix: \cs{c@tocdepth} will be set (locally) now}
% |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
% |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}\par
% The starred variant provides the numbering format
@@ -3677,7 +3731,8 @@
% \begin{macrocode}
\newcommand*\caption@@@@@declaresublistentry[4]{%
\@namedef{l@sub#2}{#1{2}{#3}{#4}}%
- \caption@@@@@@declaresublistentry#1{c@\csname ext@#2\endcsname depth}}
+ \expandafter\caption@@@@@@declaresublistentry
+ \expandafter#1\expandafter{\csname ext@#2\endcsname depth}}
\@onlypreamble\caption@@@@@declaresublistentry
% \end{macrocode}
% \begin{macrocode}
@@ -3685,9 +3740,11 @@
\ifx#1\relax
\def#1##1{%
\def\next{\@dottedtocline{##1}}%
- \@ifundefined{#2}{}{%
- \ifnum ##1>\@nameuse{#2}\relax
+ \@ifundefined{c@#2}{}{%
+ \ifnum ##1>\@nameuse{c@#2}\relax
\let\next\@gobblefour
+ \else
+ \c@tocdepth=\@nameuse{c@#2}\relax
\fi}%
\next}%
\fi}