summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption3.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-21 23:25:38 +0000
committerKarl Berry <karl@freefriends.org>2011-08-21 23:25:38 +0000
commit4bf6d40e1871037aeeadbc08a3aaadf63bd5afc6 (patch)
treeb449d37a95705baa0f91a85a60cfc32120fffdc2 /Master/texmf-dist/source/latex/caption/caption3.dtx
parent4a9457dbad19d024d5327f667ed95f5cae64d41c (diff)
caption (21aug11 and earlier)
git-svn-id: svn://tug.org/texlive/trunk@23635 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/caption3.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption3.dtx90
1 files changed, 63 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx
index cc40823cbc1..cf6d48a3072 100644
--- a/Master/texmf-dist/source/latex/caption/caption3.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption3.dtx
@@ -25,7 +25,7 @@
% caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{4056}
+% \CheckSum{4127}
%
% \iffalse
%<*driver>
@@ -200,7 +200,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2011/08/06 v1.3 caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2011/08/18 v1.3b caption3 kernel (AR)]
% \end{macrocode}
%
% \subsection{Generic helpers}
@@ -252,6 +252,23 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\caption@ifundefined}
+% \changes{v1.3a}{2011/08/12}{This macro added}
+% \changes{v1.3b}{2011/08/18}{Made expandable}
+% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, but does
+% not define the undefined macro as \cs{relax}.
+% \begin{macrocode}
+\newcommand*\caption@ifundefined[1]{%
+ \ifx#1\@undefined
+ \expandafter\@firstoftwo
+ \else\ifx#1\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@ifinlist}
% \changes{v1.1}{2007/07/29}{Rewritten}
% This helper macro checks if the first argument is in the comma separated
@@ -1337,7 +1354,7 @@
% of the \package{subfig} package (Sigh!)}
% \begin{macrocode}
\providecommand*\caption@ifkomaclass{%
- \@ifundefined{scr@caption}\@gobble\@firstofone}
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
\@onlypreamble\caption@ifkomaclass
% \end{macrocode}
% \begin{macrocode}
@@ -1862,7 +1879,7 @@
% \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised}
% \begin{macrocode}
\DeclareCaptionFont{singlespacing}{%
- \@ifundefined{setspace@singlespace}{}{%
+ \caption@ifundefined\setspace@singlespace{}{%
\setstretch\setspace@singlespace}}% normally 1
\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}
\DeclareCaptionFont{doublespacing}{\doublespacing}
@@ -2047,9 +2064,9 @@
% Usually these skips are defined within the document class, but some
% document classes don't do so.
% \begin{macrocode}
-\@ifundefined{abovecaptionskip}{%
+\caption@ifundefined\abovecaptionskip{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
-\@ifundefined{belowcaptionskip}{%
+\caption@ifundefined\belowcaptionskip{%
\newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
% \end{macrocode}
% \end{macro}
@@ -2341,7 +2358,7 @@
% \begin{macro}{\caption@ifamsclass}
% \begin{macrocode}
\providecommand*\caption@ifamsclass{%
- \@ifundefined{@captionheadfont}\@gobble\@firstofone}
+ \caption@ifundefined\@captionheadfont\@gobble\@firstofone}
\@onlypreamble\caption@ifamsclass
% \end{macrocode}
% \end{macro}
@@ -2418,7 +2435,7 @@
\begingroup\edef\@tempa{\endgroup
\noexpand\caption@g@addto@list\noexpand\caption@sty@default
{margin=\the\captionmargin
- \@ifundefined{smf@makecaption}{}{,maxmargin=.1\linewidth}}}
+ \caption@ifundefined\smf@makecaption{}{,maxmargin=.1\linewidth}}}
\@tempa
\caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin}
\DeclareCaptionLabelSeparator{default}{.\enspace}
@@ -2525,7 +2542,7 @@
% \begin{macro}{\caption@ifkomaclass}
% \begin{macrocode}
\providecommand*\caption@ifkomaclass{%
- \@ifundefined{scr@caption}\@gobble\@firstofone}
+ \caption@ifundefined\scr@caption\@gobble\@firstofone}
\@onlypreamble\caption@ifkomaclass
% \end{macrocode}
% \end{macro}
@@ -2581,7 +2598,7 @@
% \begin{macro}{\caption@ifntgclass}
% \begin{macrocode}
\providecommand*\caption@ifntgclass{%
- \@ifundefined{CaptionFonts}\@gobble\@firstofone}
+ \caption@ifundefined\CaptionFonts\@gobble\@firstofone}
\@onlypreamble\caption@ifntgclass
% \end{macrocode}
% \end{macro}
@@ -2618,7 +2635,7 @@
% \begin{macro}{\caption@ifthesisclass}
% \begin{macrocode}
\providecommand*\caption@ifthesisclass{%
- \@ifundefined{cph@font}{\@gobble}{\@ifundefined{cpb@font}\@gobble\@firstofone}}
+ \caption@ifundefined\cph@font{\@gobble}{\caption@ifundefined\cpb@font\@gobble\@firstofone}}
% \end{macrocode}
% \end{macro}
%
@@ -2651,7 +2668,7 @@
% \changes{v1.1}{2006/05/14}{\package{frenchb} package support added}
%
% \begin{macrocode}
-\@ifundefined{FB@makecaption}{}{%
+\caption@ifundefined\FB@makecaption{}{%
% \end{macrocode}
% \begin{macrocode}
\caption@CheckCommand\@makecaption{%
@@ -2691,7 +2708,7 @@
% \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added}
%
% \begin{macrocode}
-\@ifundefined{frenchTeXmods}{}{%
+\caption@ifundefined\frenchTeXmods{}{%
% \end{macrocode}
% \begin{macrocode}
\caption@CheckCommand\@makecaption{%
@@ -2707,7 +2724,7 @@
\@mcORI{#1}{\relax\captionfont{#2}}%
\else
\@mcORI{#1}{#2}%
- \fi}}
+ \fi}}%
% \end{macrocode}
% \begin{macrocode}
\caption@CheckCommand\@makecaption{%
@@ -2722,7 +2739,7 @@
\@mcORI{#1}{\relax\captionfont{#2}}%
\else
\@mcORI{#1}{#2}%
- \fi}}
+ \fi}}%
% \end{macrocode}
% \begin{macrocode}
\DeclareCaptionDefaultFont{textfont}{\itshape}%
@@ -2734,12 +2751,29 @@
%
% \subsubsection{The hungarian and magyar Babel option}
% \changes{v1.3}{2009/03/29}{\package{magyar} package support added}
+% \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised}
%
% \begin{macrocode}
\DeclareCaptionListFormat{subperiod}{#2.}
% \end{macrocode}
%
% \begin{macrocode}
+\caption@ifundefined\hunnewlabel{}{%
+ \caption@CheckCommand\@makecaption{%
+ % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system]
+ \def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1. #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {#1. #2\csname par\endcsname}
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\caption@tempa#1{\@ifundefined{extras#1}{}{%
\expandafter\addto\csname extras#1\endcsname{%
% change default labelsep and listformat
@@ -2749,6 +2783,8 @@
% change default labelsep and listformat
\caption@setdefaultlabelsep{colon}%
\caption@setdefaultlistformat{subsimple}}%
+% \end{macrocode}
+% \begin{macrocode}
}}
% \end{macrocode}
% \begin{macrocode}
@@ -3245,9 +3281,9 @@
\KV@caption@DCT@within\caption@within@default
\caption@DeclareWithinOption{#2}%
\KV@caption@DCT@placement{tbp}%
- \@ifundefined{c@float@type}%
+ \caption@ifundefined\c@float@type
{\newcounter{float@type}%
- \setcounter{float@type}{\@ifundefined{c@figure}14}}%
+ \setcounter{float@type}{\caption@ifundefined\c@figure14}}%
{}%
\caption@Debug{float type `#2'=\the\value{float@type}}%
\expandafter\xdef\csname ftype@#2\endcsname{\the\value{float@type}}%
@@ -3258,7 +3294,7 @@
\newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}%
\expandafter\newcommand\csname listof#2s\endcsname{\caption@listof{#2}}%
\expandafter\newcommand\csname listof#2es\endcsname{\caption@listof{#2}}%
- \@ifundefined{l@figure}%
+ \caption@ifundefined\l@figure
{\@namedef{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}}%
{\expandafter\let\csname l@#2\endcsname\l@figure}%
% \end{macrocode}
@@ -3277,14 +3313,14 @@
\caption@setkeys[caption]{caption@DCT}{#1}%
% \end{macrocode}
% \begin{macrocode}
- \@ifundefined{float@exts}{\newtoks\float@exts}{}%
+ \caption@ifundefined\float@exts{\newtoks\float@exts}{}%
\let\float@do=\relax
\edef\@tempa{\noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#2}}}}%
\@tempa
- \@ifundefined{float@addtolists}{%
+ \caption@ifundefined\float@addtolists{%
\newcommand\float@addtolists[1]{%
\def\float@do####1{\addtocontents{####1}{##1}}\the\float@exts}%
- \@ifundefined{@chapter}{}{\caption@PatchChapter}}{}%
+ \caption@ifundefined\@chapter{}{\caption@PatchChapter}}{}%
% \end{macrocode}
% \begin{macrocode}
\@ifnextchar[\@@DeclareCaptionType\relax}
@@ -3302,7 +3338,7 @@
\@onlypreamble\@@@DeclareCaptionType
% \end{macrocode}
% \begin{macrocode}
-\let\DeclareFloatingEnvironment\DeclareCaptionType % old command name
+\let\DeclareFloatingEnvironment\DeclareCaptionType % alternative command name
\@onlypreamble\DeclareFloatingEnvironment
% \end{macrocode}
% \end{macro}
@@ -3311,7 +3347,7 @@
% \changes{v1.2b}{2008/04/13}{This macro added}
% The default `within' value.
% \begin{macrocode}
-\newcommand*\caption@within@default{\@ifundefined{c@chapter}{none}{chapter}}
+\newcommand*\caption@within@default{\caption@ifundefined\c@chapter{none}{chapter}}
\@onlypreamble\caption@within@default
% \end{macrocode}
% \end{macro}
@@ -3357,7 +3393,7 @@
\define@key{caption@DCT}{placement}{\@namedef{fps@\caption@type}{#1}}
\@onlypreamble@key{caption@DCT}{placement}
\define@key{caption@DCT}{within}{%
- \@ifundefined{c@chapter}{}{\@removefromreset\caption@type{chapter}}%
+ \caption@ifundefined\c@chapter{}{\@removefromreset\caption@type{chapter}}%
\@removefromreset\caption@type{section}%
\begingroup
\caption@setkeys[caption]{caption@within}{#1}%
@@ -3375,7 +3411,7 @@
\@addtoreset\caption@type{section}%
\caption@within{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}}
%\@onlypreamble@key{caption@within}{section}
-\@ifundefined{c@chapter}{}{%
+\caption@ifundefined\c@chapter{}{%
\define@key{caption@within}{chapter}[]{%
\@addtoreset\caption@type{chapter}%
\caption@within{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}}
@@ -3547,7 +3583,7 @@
% \end{macrocode}
% \begin{macrocode}
% scrreprt/scrbook.cls
- \@ifundefined{KOMAClassName}{}{%
+ \caption@ifundefined\KOMAClassName{}{%
\caption@Debug{document class `\KOMAClassName' detected}%
\let\caption@patch@chapter\@gobblethree}%
% \end{macrocode}
@@ -3843,7 +3879,7 @@
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@declaresublistentry{%
- \@ifundefined{l@chapter}%
+ \caption@ifundefined\l@chapter
{\caption@@declaresublistentry\l@subsubsection}%
{\caption@@declaresublistentry\l@subsection}}
\@onlypreamble\caption@declaresublistentry