diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-05 23:06:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-05 23:06:06 +0000 |
commit | 024228db99693079b2ebbc9aff20e89811eb8810 (patch) | |
tree | 8e8882ca17c8963d54f2abffdeeed1322cbdde66 /Master/texmf-dist/source/latex/koma-script/tocbasic.dtx | |
parent | 4e8d3cd79b79589e4265bb196afe87ebaa3cc5cc (diff) |
koma-script (5apr11)
git-svn-id: svn://tug.org/texlive/trunk@21983 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/tocbasic.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/koma-script/tocbasic.dtx | 187 |
1 files changed, 129 insertions, 58 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx index 3d94017db18..055b5b8382e 100644 --- a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx +++ b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx @@ -1,4 +1,4 @@ -% \CheckSum{1146} +% \CheckSum{1211} % \iffalse meta-comment % ====================================================================== % tocbasic.dtx @@ -66,7 +66,7 @@ %%% From File: tocbasic.dtx %<*dtx|package|driver|doc|load> % \fi -\def\tocbasicversion{2010/10/01 v3.07a} +\def\tocbasicversion{2011/03/23 v3.09} % \iffalse %</dtx|package|driver|doc|load> %<*dtx> @@ -1007,56 +1007,69 @@ prior sections for more informations about this. The optional parameter \PName{options} is a comma separated list of \emph{key}=\emph{value} pairs. \begin{description} -\item[\normalfont\PValue{owner}=\PName{string}]\hfill\\* - The owner as described in the sections before. If no owner was given owner - \PValue{float} will be used. -\item[\normalfont\PValue{type}=\PName{string}]\hfill\\* - sets the type of the new declared list. The type will be used e.g. to - defined a \Macro{listof}\PName{string}. If no type is set up the extension - from the mandatory argument will be used. -\item[\normalfont\PValue{types}=\PName{string}]\hfill\\* - the plural of the type. If no plural was given the value of \PValue{type} - with postfix ``s'' will be used. -\item[\normalfont\PValue{name}=\PName{string}]\hfill\\* - The name of an element. If no name is given, the value of \PValue{type} with - upper case first char will be used. -\item[\normalfont\PValue{listname}=\PName{string}]\hfill\\* - The name of the list of foo. If not given the value of \PValue{types} with - upper case first char prefixed by ``List of '' will be used. -\item[\normalfont\PValue{forcenames}]\hfill\\* - If set, the names will be even defined, if they where already defined - before. -\item[\normalfont\PValue{level}=\PName{number}]\hfill\\* - The level of the entries of that list. If not given level 1 will be used - like standard classes use for entries to list of figures or list of tables. -\item[\normalfont\PValue{indent}=\PName{length}]\hfill\\* - The indent value for the entries of that list. If not given, 1\,em will be - used like standard classes use for entries to list of figures or list of - tables. -\item[\normalfont\PValue{hang}=\PName{length}]\hfill\\* - The amount of the hanging indent of the entries for that list. If not given, - 1.5\,em will be used like standard classes use for entries to list of - figures or list of tables. +\item[\normalfont\PValue{atbegin}=\PName{code}]\hfill\\* + The \PName{code} will be executed at the begin of the float or nonfloat + environment. +\item[\normalfont\PValue{atend}=\PName{code}]\hfill\\* + The \PName{code} will be executed at the end of the float or nonfloat + environment. +%^^A not yet implemented +%^^A \item[\normalfont\PValue{captionpos}=\PName{position}]\hfill\\* +%^^A If \PName{position} is \PValue{top} or \PValue{above} the spacing above +%^^A and below the caption will be done for captions above objects. If +%^^A \PName{position} is \PValue{bot}, \PValue{bottom}, or \PValue{below} the +%^^A spacing above and below the caption will be done for captions below +%^^A objects. +\item[\normalfont\PValue{counterwithin}=\PName{parent counter}]\hfill\\* + If you define a float or nonfloat, the captions will be numbered. You may + declare another counter to be the parent counter. In this case, the parent + counter will be set before the float counter and the float counter will be + reset whenever the parent counter is increased using \Macro{stepcounter} + oder \Macro{refstepcounter}. \item[\normalfont\PValue{float}]\hfill\\* If set, float environments for that type will be defined. The names of the environments are the value of \PName{type} and for double column floats the value of \PName{type} with postfix ``\PValue{*}''. +\item[\normalfont\PValue{floatpos}=\PName{float positions}]\hfill\\* + The default floating-position of the float. If no float position was given, + ``tbp'' will be used like the standard classes do for figures and tables. \item[\normalfont\PValue{floattype}=\PName{number}]\hfill\\* The numericle float type of the defined floats. Float types with common bits cannot be reordered. At the standard classes figures has float type 1 and tables has float type 2. If no float type was given, 16 will be used. -\item[\normalfont\PValue{floatpos}=\PName{float positions}]\hfill\\* - The default floating-position of the float. If no float position was given, - ``tbp'' will be used like the standard classes do for figures and tables. +\item[\normalfont\PValue{forcenames}]\hfill\\* + If set, the names will be even defined, if they where already defined + before. +\item[\normalfont\PValue{hang}=\PName{length}]\hfill\\* + The amount of the hanging indent of the entries for that list. If not given, + 1.5\,em will be used like standard classes use for entries to list of + figures or list of tables. +\item[\normalfont\PValue{indent}=\PName{length}]\hfill\\* + The indent value for the entries of that list. If not given, 1\,em will be + used like standard classes use for entries to list of figures or list of + tables. +\item[\normalfont\PValue{level}=\PName{number}]\hfill\\* + The level of the entries of that list. If not given level 1 will be used + like standard classes use for entries to list of figures or list of tables. +\item[\normalfont\PValue{listname}=\PName{string}]\hfill\\* + The name of the list of foo. If not given the value of \PValue{types} with + upper case first char prefixed by ``List of '' will be used. +\item[\normalfont\PValue{name}=\PName{string}]\hfill\\* + The name of an element. If no name is given, the value of \PValue{type} with + upper case first char will be used. \item[\normalfont\PValue{nonfloat}]\hfill\\* If set, a non floating environment will be defined. The name of the environment is the value of \PName{type} with postfix ``\PValue{-}''. -\item[\normalfont\PValue{counterwithin}=\PName{parent counter}]\hfill\\* - If you define a float or nonfloat, the captions will be numbered. You may - declare another counter to be the parent counter. In this case, the parent - counter will be set before the float counter and the float counter will be - reset whenever the parent counter is increased using \Macro{stepcounter} - oder \Macro{refstepcounter}. +\item[\normalfont\PValue{owner}=\PName{string}]\hfill\\* + The owner as described in the sections before. If no owner was given owner + \PValue{float} will be used. +\item[\normalfont\PValue{type}=\PName{string}]\hfill\\* + sets the type of the new declared list. The type will be used e.g. to + defined a \Macro{listof}\PName{string}. If no type is set up the extension + from the mandatory argument will be used. +\item[\normalfont\PValue{types}=\PName{string}]\hfill\\* + the plural of the type. If no plural was given the value of \PValue{type} + with postfix ``s'' will be used. \end{description} @@ -1475,6 +1488,8 @@ be defined and used in \Macro{tocbasic@listhead}. % \end{macro} % % \begin{macro}{\doforeachtocfile} +% \changes{v3.09}{2011/03/01}{\cs{@currext} defined using \cs{edef} instead +% of \cs{def}} % This command does the second, mandatory argument for each toc-file at the % list of toc-files. If the first, optional argument was given this will be % done only for the toc-files of that owner. NOTE: An empty first argument @@ -1577,7 +1592,7 @@ be defined and used in \Macro{tocbasic@listhead}. \setlength{\parskip}{\z@}% \setlength{\parindent}{\z@}% \setlength{\parfillskip}{\z@\@plus 1fil}% - \def\@currext{#1}% + \edef\@currext{#1}% \csname tocbasic@@before@hook\endcsname \csname tb@#1@before@hook\endcsname \@starttoc{#1}% @@ -1643,6 +1658,8 @@ be defined and used in \Macro{tocbasic@listhead}. % \begin{macro}{\listoftoc*} % \changes{v1.0a}{2008/11/12}{\cs{twocolumn} fixed}% % \changes{v1.01}{2008/11/13}{new feature \texttt{onecolumn}} +% \changes{v3.09}{2011/03/01}{\cs{@currext} defined using \cs{edef} instead +% of \cs{def}} % Command to handle the hole list of something. There are additional hooks % for this. The first optional argument is the title for this list. If the % optional argument was omitted \cs{listof\#2name} will be used. The star @@ -1667,7 +1684,7 @@ be defined and used in \Macro{tocbasic@listhead}. }{% \expandafter\let\expandafter\list@fname\csname listof#2name\endcsname }% - \def\@currext{#2}% + \edef\@currext{#2}% \iftocfeature{\@currext}{onecolumn}{% \iftocfeature{\@currext}{leveldown}{}{% \if@twocolumn @@ -1957,6 +1974,7 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{type}{#1}{\edef\tb@nt@type{#1}}% } % \end{macrocode} +% \begin{macro}{\tb@nt@counterwithin} % If a counter will be defined, this counter may depend on another counter % (like figure counter depends on chapter counter at book classes). If the % value is empty, the counter does not depend on any other counter. @@ -1965,6 +1983,8 @@ be defined and used in \Macro{tocbasic@listhead}. \edef\tb@nt@counterwithin{#1}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@types} % Sometimes the plural of the type is needed and may be defined by a % seperate option. % \begin{macrocode} @@ -1972,6 +1992,8 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{types}{#1}{\edef\tb@nt@types{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@ext} % Don't tell the user, that the mandatory argument of the command may be % overloaded by this option. This was only done to simplify the definition. % \begin{macrocode} @@ -1979,12 +2001,16 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{extension}{#1}{\edef\tb@nt@ext{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@owner} % The owner of the new list extension. % \begin{macrocode} \define@key{tocbasic}{owner}{% \tb@ifvalueisnotempty{owner}{#1}{\edef\tb@nt@owner{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@name} % We need a name/term for the entries of the new list. This may e.g. be used % for |caption| output. A |\<type>name| will also be defined. % \begin{macrocode} @@ -1992,12 +2018,15 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{name}{#1}{\edef\tb@nt@name{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@listname} % The list itself has a heading. A |\list<type>name| will also be defined. % \begin{macrocode} \define@key{tocbasic}{listname}{% \tb@ifvalueisnotempty{listname}{#1}{\edef\tb@nt@listname{#1}}% } % \end{macrocode} +% \end{macro} % \begin{macro}{\iftb@forcenames} % \changes{v3.06}{2010/06/01}{new internal} % The |\...name| commands will only be defined, if they are not already @@ -2011,6 +2040,7 @@ be defined and used in \Macro{tocbasic@listhead}. } % \end{macrocode} % \end{macro} +% \begin{macro}{\tb@nt@level} % Each entry to a TOC/list of has a numeric level. You may set up your own % level. % \begin{macrocode} @@ -2018,6 +2048,8 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{level}{#1}{\tb@numkey\tb@nt@level{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@indent} % Earch entry of a TOC/list of is idented on the left side. This is the % amount of the indention of the number part. % \begin{macrocode} @@ -2025,6 +2057,8 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{indent}{#1}{\tb@dimkey\tb@nt@indent{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@hang} % Earch entry of a TOC/list of is idented on the left side. This is the % amount of the indention of the text of the entry. % \begin{macrocode} @@ -2032,6 +2066,7 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{hang}{#1}{\tb@dimkey\tb@nt@hang{#1}}% } % \end{macrocode} +% \end{macro} % \begin{macro}{\iftb@float} % \changes{v3.06}{2010/06/01}{new internal} % This boolean indicates, that float environments should also be defined. @@ -2053,6 +2088,7 @@ be defined and used in \Macro{tocbasic@listhead}. } % \end{macrocode} % \end{macro} +% \begin{macro}{\tb@nt@floattype} % Simply the value for the |\ftype@...| macro. It has to be % $1<=\textrm{value}<=31$. % \begin{macrocode} @@ -2060,12 +2096,33 @@ be defined and used in \Macro{tocbasic@listhead}. \tb@ifvalueisnotempty{floattype}{#1}{\tb@numkey\tb@nt@floattype{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@floatpos} % Simply the value for the |\fps@...| macro. % \begin{macrocode} \define@key{tocbasic}{floatpos}{% \tb@ifvalueisnotempty{floatpos}{#1}{\edef\tb@nt@floatpos{#1}}% } % \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@atbegin} +% \changes{v3.09}{new optional identifier \texttt{atbegin}} +% Additional code executed at the begin of a new defined environment. +% \begin{macrocode} +\define@key{tocbasic}{atbegin}{% + \tb@ifvalueisnotempty{atbegin}{#1}{\def\tb@nt@atbegin{#1}}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\tb@nt@atend} +% \changes{v3.09}{new optional identifier \texttt{atbend}} +% Additional code executed at the end of a new defined environment. +% \begin{macrocode} +\define@key{tocbasic}{atend}{% + \tb@ifvalueisnotempty{atend}{#1}{\def\tb@nt@atend{#1}}% +} +% \end{macrocode} +% \end{macro} % Now the command to define a new list and maybe float or nonfloat. % \begin{macrocode} \newcommand*{\DeclareNewTOC}[2][]{% @@ -2083,7 +2140,9 @@ be defined and used in \Macro{tocbasic@listhead}. \def\tb@nt@level{1}% \def\tb@nt@indent{1em}% \def\tb@nt@hang{1.5em}% - \let\tb@nt@counterwithin\@empty% + \let\tb@nt@counterwithin\@empty + \let\tb@nt@atbegin\@empty + \let\tb@nt@atend\@empty \setkeys{tocbasic}{#1}% % \end{macrocode} % First of all, every TOC needs a extension, that should be added to the @@ -2142,19 +2201,23 @@ be defined and used in \Macro{tocbasic@listhead}. \expandafter\newcommand\expandafter*\csname ftype@\tb@nt@type\expandafter \endcsname{\tb@nt@floattype}% \begingroup - \edef\@tempa{% - \noexpand\endgroup - \noexpand\newenvironment{\tb@nt@type}{% - \noexpand\@float{\tb@nt@type}% - }{% - \noexpand\end@float - }% - \noexpand\newenvironment{\tb@nt@type*}{% - \noexpand\@dblfloat{\tb@nt@type}% - }{% - \noexpand\end@dblfloat - }% - }% + \edef\@tempa{% + \noexpand\endgroup + \noexpand\newenvironment{\tb@nt@type}{% + \noexpand\@float{\tb@nt@type}% + \noexpand\csname \tb@nt@type @atbegin\noexpand\endcsname + }{% + \noexpand\csname \tb@nt@type @atend\noexpand\endcsname + \noexpand\end@float + }% + \noexpand\newenvironment{\tb@nt@type*}{% + \noexpand\@dblfloat{\tb@nt@type}% + \noexpand\csname \tb@nt@type @atbegin\noexpand\endcsname + }{% + \noexpand\csname \tb@nt@type @atend\noexpand\endcsname + \noexpand\end@dblfloat + }% + }% \@tempa \@tempswatrue \fi @@ -2169,7 +2232,9 @@ be defined and used in \Macro{tocbasic@listhead}. \noexpand\trivlist\noexpand\item\noexpand\relax \noexpand\minipage{\noexpand\linewidth}% \noexpand\def\noexpand\@captype{\tb@nt@type}% + \noexpand\csname \tb@nt@type @atbegin\noexpand\endcsname }{% + \noexpand\csname \tb@nt@type @atend\noexpand\endcsname \noexpand\endminipage\noexpand\endtrivlist }% }% @@ -2177,7 +2242,7 @@ be defined and used in \Macro{tocbasic@listhead}. \@tempswatrue \fi % \end{macrocode} -% The counter of float and nonfloat environments: +% The counter and hooks of float and nonfloat environments: % \begin{macrocode} \if@tempswa \@ifundefined{c@\tb@nt@type}{% @@ -2212,6 +2277,10 @@ be defined and used in \Macro{tocbasic@listhead}. }% }% \@tempa + \expandafter\newcommand\expandafter*\csname \tb@nt@type @atbegin\expandafter + \endcsname\expandafter{\tb@nt@atbegin}% + \expandafter\newcommand\expandafter*\csname \tb@nt@type @atend\expandafter + \endcsname\expandafter{\tb@nt@atend}% \fi } % \end{macrocode} @@ -2274,6 +2343,8 @@ be defined and used in \Macro{tocbasic@listhead}. % \end{macro} % \end{macro} % +% +% % \iffalse %</package> %<*load> |