diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/tocbasic.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/koma-script/tocbasic.dtx | 593 |
1 files changed, 376 insertions, 217 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx index c63f13673c2..d48a5a1481f 100644 --- a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx +++ b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx @@ -1,8 +1,8 @@ -% \CheckSum{1234} +% \CheckSum{1335} % \iffalse meta-comment % ====================================================================== % tocbasic.dtx -% Copyright (c) Markus Kohm, 2008-2012 +% Copyright (c) Markus Kohm, 2008-2013 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -19,11 +19,10 @@ % % This work consists of files `tocbasic.dtx' and `scrlogo.dtx' at least. % -% To create `tocbasic.sty' run `tex tocbasic.dtx'. Using LaTeX instead -% of TeX would generate the implementation documentation. +% This work consists of all files listed in manifest.txt. % ---------------------------------------------------------------------- % tocbasic.dtx -% Copyright (c) Markus Kohm, 2008-2012 +% Copyright (c) Markus Kohm, 2008-2013 % % Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz, % Version 1.3c, verteilt und/oder veraendert werden. @@ -37,12 +36,7 @@ % % Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm. % -% Dieses Werk besteht mindestens aus den Dateien `tocbasic.dtx' und -% `scrlogo.dtx'. -% -% `tocbasic.sty' kann durch den Aufruf `tex tocbasic.dtx' erzeugt -% werden. Bei Verwendung von LaTeX statt TeX wird hingegen die -% Implementierungsdokumentation erzeugt. +% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== % \fi % @@ -63,49 +57,61 @@ % Right brace \} Tilde \~} % % \iffalse -%%% From File: tocbasic.dtx -%<*dtx|package|driver|doc|load> -% \fi -\def\tocbasicversion{2012/04/04 v3.10b} -% \iffalse -%</dtx|package|driver|doc|load> +%%% From File: $Id: tocbasic.dtx 1533 2013-12-10 18:06:14Z mjk $ %<*dtx> -\def\LaTeXformat{LaTeX2e} -\ifx\fmtname\LaTeXformat\def\MainBodyWork{% -\ProvidesFile{tocbasic.dtx} +\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi +\ProvidesFile{tocbasic.dtx}[% %</dtx> -%<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01] -%<driver>\ProvidesFile{tocbasic.drv} -%<doc>\ProvidesFile{tocbasic.tex} -%<package>\ProvidesPackage{tocbasic} +%<package>\NeedsTeXFormat{LaTeX2e}[1995/12/01] +%<doc>\ProvidesFile{tocbasic.tex}[% +%<package>\ProvidesPackage{tocbasic}[% %<*dtx|package|driver|doc> - [\tocbasicversion\space KOMA-Script package +%!KOMAScriptVersion + package %</dtx|package|driver|doc> -%<driver> (driver)% -%<package> (handling toc-files)% -%<doc> (manual)% +%<driver> (driver)% +%<package|doc> (handling toc-files)% %<*dtx> - (dtx)% + (dtx)% %</dtx> %<*dtx|package|driver|doc> - ] +] %</dtx|package|driver|doc> -%<*dtx|driver> -\IfFileExists{scrdoc.cls}{% - \documentclass[halfparskip-]{scrdoc} -}{% - \documentclass{ltxdoc} - \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em% - M\kern.05em A\kern.1em-\kern.1em Script}} -} +%<*dtx> +\ifx\documentclass\undefined + \input scrdocstrip.tex + \@@input scrkernel-version.dtx + \@@input scrstrip.inc + \KOMAdefVariable{COPYRIGHTFROM}{2008} + \generate{\usepreamble\defaultpreamble + \useWarning\@gobbletwo + \file{tocbasic.tex}{% + \from{tocbasic.dtx}{doc}% + }% + } + \generate{\usepreamble\defaultpreamble + \file{tocbasic.sty}{% + \from{tocbasic.dtx}{package}% + \from{scrlogo.dtx}{logo}% + }% + }% + \@@input scrstrop.inc +\else + \let\endbatchfile\relax +\fi +\endbatchfile +%</dtx> +%<*driver> +\documentclass[halfparskip-]{scrdoc} \usepackage[latin1]{inputenc} \usepackage[english]{babel} +\usepackage{array} \usepackage{listings} \lstset{breaklines,prebreak=\mbox{$\hookleftarrow$},language=[LaTeX]TeX, basicstyle=\small} \lstnewenvironment{lstcode}[1][]{% \lstset{breaklines,prebreak=\mbox{$\hookleftarrow$},language=[LaTeX]TeX, - basicstyle=\ttfamily\small,##1}% + basicstyle=\ttfamily\small,#1}% }{} \lstnewenvironment{lstoutput}[1][]{}{} \CodelineIndex @@ -114,139 +120,7 @@ \sloppy \DocInput{\filename} \end{document} -%</dtx|driver> -%<*dtx> -}% -\else - \let\MainBodyWork\relax -\fi - -\MainBodyWork - -\def\batchfile{tocbasic.dtx} -%</dtx> -%<ins>\def\batchfile{tocbasic.ins} -%<*dtx|ins> -\input docstrip.tex - -\let\ifbeta=\iffalse - -\ifToplevel{\ifx\generate\undefined - \errhelp{Install a new version of docstrip.} - \errmessage{Old docstrip in input path} - \batchmode - \csname @@end\endcsname - \fi - \Msg{************************************************************} - \Msg{*} - \Msg{* KOMA-Script} - \Msg{* a versatile LaTeX2e bundle} - \Msg{*} - \Msg{* This is `\batchfile', a batchfile to unpack some or all} - \Msg{* parts of KOMA-Script. See `liesmich.txt' (german) or} - \Msg{* `readme.txt' (english) for additional information.} - \Msg{*} - \Msg{* Files of an old KOMA-Script installation may be} - \Msg{* overwritten without asking!} - \Msg{*} - \Msg{************************************************************} -} - -% ---------- some docstrip switchs ------------------------------------- - -\ifToplevel{% - \keepsilent - \askforoverwritefalse -} - -% ---------- defining preambles ---------------------------------------- - -\preamble - -Copyright (c) 2007-2012 -Markus Kohm and any individual authors listed elsewhere in this file. - -This file was generated from file(s) of the KOMA-Script bundle. ---------------------------------------------------------------- - -This work may be distributed and/or modified under the conditions of -the LaTeX Project Public License, version 1.3c of the license. -The latest version of this license is in - http://www.latex-project.org/lppl.txt -and version 1.3c or later is part of all distributions of LaTeX -version 2005/12/01 or later and of this work. - -This work has the LPPL maintenance status "author-maintained". - -The Current Maintainer and author of this work is Markus Kohm. - -This file may only be distributed together with the files -`scrlogo.dtx' and `tocbasic.dtx'. You may however distribute the files -`scrlogo.dtx' and `tocbasic.dtx' without this file. -See also `tocbasic.dtx' for additional information. - -If this file is a beta version, you are not allowed to distribute it. - -Currently there is only a short english manual at `tocbasic.dtx', that -should also be found as `tocbasic.pdf'. - -The KOMA-Script bundle (but maybe not this file) was based upon the -LaTeX2.09 Script family created by Frank Neukam 1993 and the LaTeX2e -standard classes created by The LaTeX3 Project 1994-1996. - -\endpreamble - -% ---------- File generation ------------------------------------------- - -\generate{\usepreamble\defaultpreamble - \file{tocbasic.ins}{% - \from{tocbasic.dtx}{ins}% - }% -% \file{tocbasic.drv}{% -% \from{tocbasic.dtx}{driver}% -% }% - \file{tocbasic.tex}{% - \from{tocbasic.dtx}{doc}% - }% -} - -\generate{\usepreamble\defaultpreamble - \file{tocbasic.sty}{% - \ifbeta\from{scrbeta.dtx}{package,tocbasic}\fi - \from{tocbasic.dtx}{package}% - \from{scrlogo.dtx}{logo}% - }% -}% - -% ---------- end of docstrip process ----------------------------------- - -\ifToplevel{% - \Msg{************************************************************} - \Msg{*} - \Msg{* KOMA-Script} - \Msg{* a versatile LaTeX2e bundle} - \Msg{*} - \Msg{* To finish the installation you have to move some} - \Msg{* files into a directory searched by TeX.} - \Msg{* See INSTALL.TXT (english) or INSTALLD.TXT (german)} - \Msg{* from KOMA-Script bundle for additional information.} - \Msg{*} - \Msg{* You may also produce the implementation documentation} - \Msg{* including also a short version of the english manual.} - \Msg{* To produce it, do} - \Msg{* \space\space pdflatex tocbasic.dtx} - \Msg{* \space\space mkindex tocbasic} - \Msg{* \space\space pdflatex tocbasic.dtx} - \Msg{* after finishing the installation.} - \Msg{*} - \Msg{* Happy TeXing} - \Msg{*} - \Msg{************************************************************} -} - -\bye -%</dtx|ins> -%<*dtx> +%</driver> % \fi % % \providecommand*{\DescribeCounter}{\DescribeMacro} @@ -304,7 +178,6 @@ standard classes created by The LaTeX3 Project 1994-1996. % \maketitle % \begin{abstract} % \iffalse -%</dtx> %<*doc> \translator{Markus Kohm} @@ -333,7 +206,7 @@ packages some types of controll about these. For examples package \Package{tocbasic} delegates language control of all these tables and lists of contents to package \Package{babel}\IndexPackage{babel}%^^A %\iffalse^^A -(see \cite{package:babel})%^^A +\ (see \cite{package:babel})%^^A %\fi^^A . So automatic change of language will be provides inside all these tables and lists of contents. Using \Package{tocbasic} will @@ -733,55 +606,117 @@ Commands, that shouldn't be expanded while writing, should be prefixed by \EndIndex{Cmd}{addtoeachtocfile}% % \fi -% \iffalse + +%\iffalse^^A meta-comment \begin{Declaration} - \Macro{addcontentslinetoeachtocfile}\OParameter{owner}\Parameter{level}% - \Parameter{contentsline} +%\fi^^A meta-comment +% \DescribeMacro{\addxcontentsline} +% The command + \Macro{addxcontentsline}% + \Parameter{extension}\Parameter{level}\OParameter{number}%^^A + \Parameter{text} +%\iffalse^^A meta-comment \end{Declaration} -\BeginIndex{Cmd}{addcontentslinetoeachtocfile}% -This command -%<*dtx> +\BeginIndex{Cmd}{addxcontentsline}% +The command \Macro{addxcontentsline} +%\fi^^A meta-comment +adds an entry of given \PName{level} to toc-file with \PName{extension}. If +the \Parameter{number} is empty or omitted the entry won't have a number for +the entry with the given \PName{text}. Entries without number may be left +aligned to the number of the numbered entries of the same \PName{level} or +indented like the text of the numbered entries of the same \PName{level}, +depending on the \PValue{numberline} feature. + +\begin{Example} + Maybe you are not using a \KOMAScript{} class but need a not numbered + chapter with entry to the table of contents. This may be done using +\begin{lstcode} + \cleardoublepage + \csname phantomsection\endcsname + \addxcontentsline{toc}{chapter} + {Chapters without Numbers} + \chapter*{Chapters without Numbers} + \markboth{Chapters without Numbers}{} +\end{lstcode} + As you can see, you simply have to replace usual \Macro{addcontentsline} by + \Macro{addxcontentsline} to support the \Package{tocbasic} feature + \PValue{numberline}. +\end{Example} + +Note, that \Macro{addxcontentsline} uses +\Macro{add\PName{level}\PName{extension}entry} if such a macro exists and +\Macro{tocbasic@addxcontentsline} otherwise. Therefore you cannot define +a macro \Macro{add\PName{level}\PName{extension}entry} using +\Macro{addxcontentsline} but \Macro{tocbasic@addxcontentsline}. + +It is recommended to use \Macro{addxcontentsline} instead of +\Macro{addcontentsline} whenever possible.% +%\iffalse^^A meta-comment +\EndIndex{Cmd}{addxcontentsline} +%\fi^^A meta-comment + + +% \iffalse +\begin{Declaration} % \fi -\DescribeMacro{\addcontentslinetoeachfile} -Command \Macro{addcontentslinetoeachtocfile}\OParameter{owner}%^^A -\Parameter{level}\Parameter{contentsline} +% \DescribeMacro{\addcontentslinetoeachfile} +% \DescribeMacro{\addxcontentslinetoeachfile} +% The command + \Macro{addcontentslinetoeachtocfile}\OParameter{owner}\Parameter{level}%^^A + \Parameter{contentsline}\\ % \iffalse -%</dtx> + \Macro{addxcontentslinetoeachtocfile}\OParameter{owner}%^^A + \Parameter{level}\OParameter{number}\Parameter{text} +\end{Declaration} +\BeginIndex{Cmd}{addcontentslinetoeachtocfile}% +\BeginIndex{Cmd}{addxcontentslinetoeachtocfile}% +The first command % \fi is something like \Macro{addcontentsline} from \LaTeX{} kernel. In difference to that it writes the \PName{contentsline} not only into one file, but into all files of all known file extensions or of all known file extensions of a given owner. + +The Command \Macro{addxcontentslinetoeachtocfile}%^^A +% \OParameter{owner}\Parameter{level}\OParameter{number}\Parameter{text}%^^A +\ is similar but uses +\Macro{addxcontentsline} instead of \Macro{addcontentsline} and +therefore supports \Package{tocbasic} feature \PValue{numberline}. \begin{Example} You are a class author and want to write the chapter entry not only to the table of contents toc-file but to all toc-files, while \texttt{\#1} is the title, that should be written to the files. \begin{lstcode} - \addcontentslinetoeachtocfile{chapter}{% - \protect\numberline{\thechapter}#1} + \addxcontentslinetoeachtocfile + {chapter}[\thechapter]{#1}% \end{lstcode} In this case the current chapter number should be expanded while writing into the file. So it isn't protected from expansion using \Macro{protect}. \end{Example} -While writing -\Macro{@currext}\IndexCmd{@currext}\important{\Macro{@currext}} is the file -extension of the file into which \PName{contentsline} will be written. +While writing \Macro{@currext}\IndexCmd{@currext}\important{\Macro{@currext}} +is the file extension of the file into which \PName{contentsline} will be +written. + +It is recommended to use \Macro{addxcontentslinetoeachtocfile} instead +of \Macro{addcontentslinetoeachtocfile} whenever possible. % \iffalse +\EndIndex{Cmd}{addxcontentslinetoeachtocfile}% \EndIndex{Cmd}{addcontentslinetoeachtocfile}% % \fi + % \iffalse %<*dtx> % \fi -\DescribeMacro{\listoftoc} -\DescribeMacro{\listoftoc*} -\DescribeMacro{\listofeachtoc} +\DescribeMacro{\listoftoc}%^^A +\DescribeMacro{\listoftoc*}%^^A +\DescribeMacro{\listofeachtoc}%^^A Commands % \iffalse %</dtx> \begin{Declaration} % \fi - \Macro{listoftoc}\OParameter{list of title}\Parameter{extension} + \Macro{listoftoc}\OParameter{list of title}\Parameter{extension}%^^A % \iffalse \\ %<*dtx> @@ -790,7 +725,7 @@ Commands % \iffalse %</dtx> % \fi - \Macro{listoftoc*}\Parameter{extension} + \Macro{listoftoc*}\Parameter{extension}%^^A % \iffalse \\ %<*dtx> @@ -799,7 +734,7 @@ Commands % \iffalse %</dtx> % \fi - \Macro{listofeachtoc}\OParameter{owner} + \Macro{listofeachtoc}\OParameter{owner}%^^A % \iffalse \\ %<*dtx> @@ -1128,6 +1063,11 @@ features. \Package{tocbasic} does know following features: \OptionValue{listof}{numbered}\important{\OptionValue{listof}{numbered}}% \IndexOption{listof~=\PValue{numbered}} for all file extensions of the owner \PValue{float}. +\item[\texttt{numberline}] \leavevmode\ChangedAt{v3.12}{\Package{tocbasic}}% + redefines \Macro{nonumberline} to use \Macro{numberline}. With this the not + numbered entries generated by \KOMAScript{} or using \Macro{nonumberline} at + the very beginning of the last argument of \Macro{addcontentline} will also + be indented like numbered entries of the same type. \item[\texttt{onecolumn}] \leavevmode\ChangedAt{v3.01}{\Package{tocbasic}}% typesets the corresponding table of contents or list of something with internal one column mode of @@ -1469,6 +1409,26 @@ be defined and used in \Macro{tocbasic@listhead} automatically. \EndIndex{Cmd}{tocbasic@listhead@\PName{extension}}% % \fi +%\iffalse^^A meta-comment +\begin{Declaration} +%\fi^^A meta-comment +% \DescribeMacro{\tocbasic@addxcontentsline} +% The command + \Macro{tocbasic@addxcontentsline}% + \Parameter{extension}\Parameter{level}\Parameter{number}\Parameter{text} +%\iffalse^^A meta-comment +\end{Declaration} +\BeginIndex{Cmd}{tocbasic@addxcontentsline}% +This command +%\fi^^A meta-comment +uses \Macro{addcontentsline} to either create a numbered or not numbered text +entry to toc-file with given \PName{extension}. Note, that all parameters of +\Macro{tocbasic@addxcontentsline} are mandatory. But you may use an +empty \PName{number} argument, if you don't want a number. +%\iffalse^^A meta-comment +\EndIndex{Cmd}{tocbasic@addxcontentsline} +%\fi^^A meta-comment + \section{A Complete Example} \label{sec:tocbasic.example} @@ -1799,6 +1759,81 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. additionally, then a non-floating environment \Environment{remarkbox-} will be also defined. You may use \Macro{caption}\IndexCmd{caption} inside of that non-floating environment as usual for floating environments. +%\iffalse + \hyperref[tab:tocbasic.comparison]{Figure~\ref*{tab:tocbasic.comparison}} + showes a comparison of the commands, counters and environments of the + example environment \Environment{remarkbox} and of the commands, counters + and environments for figures.% + \begin{table} + \centering + \caption{Comparison of example environment \Environment{remarkbox} + and environment \Environment{figure}} + \label{tab:tocbasic.comparison} + \begin{tabularx}{\textwidth}{ll>{\raggedright}p{6em}X} + \toprule + \Environment{remarkbox} & \Environment{figure} + & options of \Macro{DeclareNewTOC} & short description \\[1ex] + \midrule + \Environment{remarkbox} & \Environment{figure} + & \Option{type}, \Option{float} + & floating environments of the respective types\\[1ex] + \Environment{remarkbox*} & \Environment{figure*} + & \Option{type}, \Option{float} + & columns spanning floating environments of the respective types\\[1ex] + \Counter{remarkbox} & \Counter{figure} + & \Option{type}, \Option{float} + & counter used by \Macro{caption}\\[1ex] + \Macro{theremarkbox} & \Macro{thefigure} + & \Option{type}, \Option{float} + & output command to the respective counters\\[1ex] + \Macro{remarkboxformat} & \Macro{figureformat} + & \Option{type}, \Option{float} + & formating command to the respective counters used by + \Macro{caption}\\[1ex] + \Macro{remarkboxname} & \Macro{figurename} + & \Option{type}, \Option{float}, \Option{name} + & names used in the label of \Macro{caption}\\[1ex] + \Macro{listofremarkboxes} & \Macro{listoffigures} + & \Option{types}, \Option{float} + & command to show the list of the respective environments\\[1ex] + \Macro{listremarboxname} & \Macro{listfigurename} + & \Option{type}, \Option{float}, \Option{listname} + & heading text of the respective list \\[1ex] + \Macro{fps@remarkbox} & \Macro{fps@figure} + & \Option{type}, \Option{float}, \Option{floattype} + & numeric float type for order perputation\\[1ex] + \File{lor} & \File{lof} + & + & file extension of the helper file of the respective list \\ + \bottomrule + \end{tabularx} + \end{table} +%\fi + + And now a possible usage of the example environment: +\begin{lstcode} + \begin{remarkbox} + \centering + Equal should be typeset equally + and with equal formatting. + \caption{First theorem of typography} + \label{rem:typo1} + \end{remarkbox} +\end{lstcode} + A segment of an example page with this environment could be: + \begin{center}\footnotesize + \begin{tabular} + {|!{\hspace{.1\linewidth}}p{.55\linewidth}!{\hspace{.1\linewidth}}|} + \\ + \centering + Equal should be typeset equally + and with equal formatting.\\[\abovecaptionskip] + {% + \usekomafont{caption}\footnotesize{\usekomafont{captionlabel}% + Remark 1: }First theorem of typography + }\\ + \end{tabular}% + \end{center}% \end{Example} % \iffalse \EndIndex{Cmd}{DeclareNewTOC}% @@ -2142,6 +2177,11 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \end{macro} % \end{macro} % +% \subsection{Adding Entries into Toc-Files} +% +% We have a new general command to add entries to several toc-files at +% once. And we have some special commands for the table of contents. +% % \begin{macro}{\addcontentslinetoeachtocfile} % Something like a combination of \cs{addtoeachtocfile} and % \cs{addcontentsline}. @@ -2159,6 +2199,99 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \end{macrocode} % \end{macro} % +% \begin{macro}{\addxcontentsline} +% \changes{v3.12}{2013/09/24}{new} +% \changes{v3.12}{2013/09/24}{Take care of new feature \texttt{numberline}} +% \begin{macro}{\@addxcontentsline} +% \changes{v3.12}{2013/09/24}{new (internal)} +% This will be used instead of \cs{addcontentsline} to generate numbered or +% not numbered entries to a toc-file. First argument is the toc-file, second +% the entry type, e.g., \texttt{chapter}, the third is the entry number or +% empty and the fourth and last is the entry text. +% \begin{macrocode} +\newcommand*{\addxcontentsline}[2]{% + \@ifnextchar [%] + {\@addxcontentsline{#1}{#2}}% + {\@addxcontentsline{#1}{#2}[]}% +} +\newcommand*{\@addxcontentsline}{} +\def\@addxcontentsline#1#2[#3]#4{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname add#2#1entry\endcsname\relax + \tocbasic@addxcontentsline{#1}{#2}{#3}{#4}% + \else + \@nameuse{add#2#1entry}{#3}{#4}% + \fi +} +% \end{macrocode} +% \begin{macro}{\nonumberline} +% \changes{v3.12}{2013/09/24}{new} +% Either \cs{relax} or \cs{numberline} depending on the feature +% \texttt{numberline}. +% \begin{macrocode} +\newcommand*{\nonumberline}{}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\addxcontentsline} +% This may be used to either use a heading type command or the general default +% one. You are not allowed to use it in the definition of a heading type +% command like \cs{addchaptertocentry}! You may use +% \cs{tocbasic@addxcontentsline} at the definition of those commands. +% \begin{macrocode} +\newcommand*{\tocbasic@addxcontentsline}[4]{% + \if\relax\detokenize{#3}\relax + \addcontentsline{#1}{#2}{\protect\nonumberline#4}% + \else + \addcontentsline{#1}{#2}{\protect\numberline{#3}#4}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\addxcontentslinetoeachtocfile} +% \changes{v3.12}{2013/09/24}{new} +% \begin{macro}{\@addxcontentslinetoeachtocfile} +% \changes{v3.12}{2013/09/24}{new (internal)} +% \begin{macro}{\@@addxcontentslinetoeachtocfile} +% \changes{v3.12}{2013/09/24}{new (internal)} +% \begin{macro}{\@@@addxcontentslinetoeachtocfile} +% \changes{v3.12}{2013/09/24}{new (internal)} +% \begin{macro}{\@@@@addxcontentslinetoeachtocfile} +% \changes{v3.12}{2013/09/24}{new (internal)} +% Similar to \cs{addcontentslinetoeachtocfile} using +% \cs{addxcontentsline} instead of \cs{addcontentsline}. +% \begin{macrocode} +\newcommand{\addxcontentslinetoeachtocfile}{% + \@ifnextchar [%] + \@addxcontentslinetoeachtocfile\@@addxcontentslinetoeachtocfile +} +\newcommand{\@addxcontentslinetoeachtocfile}[2][]{% + \@ifnextchar [%] + {\@@@addxcontentslinetoeachtocfile[{#1}]{#2}}% + {\@@@addxcontentslinetoeachtocfile[{#1}]{#2}[]} +} +\newcommand*{\@@@addxcontentslinetoeachtocfile}{} +\def\@@@addxcontentslinetoeachtocfile[#1]#2[#3]#4{% + \doforeachtocfile[{#1}]{\addxcontentsline{\@currext}{#2}[#3]{#4}}% +} +\newcommand{\@@addxcontentslinetoeachtocfile}[1]{% + \@ifnextchar [%] + {\@@@@addxcontentslinetoeachtocfile{#1}}% + {\@@@@addxcontentslinetoeachtocfile{#1}[]}% +} +\newcommand*{\@@@@addxcontentslinetoeachtocfile}{} +\def\@@@@addxcontentslinetoeachtocfile#1[#2]#3{% + \doforeachtocfile{\addxcontentsline{\@currext}{#1}[{#2}]{#3}}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % % \subsection{Show List of Toc-File} % \label{sec:showlistoftocfile} @@ -2277,6 +2410,7 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. \fi }% }{}% + \iftocfeature{\@currext}{numberline}{\def\nonumberline{\numberline{}}}{}% \tocbasic@listhead{#1}% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname microtypesetup\endcsname\relax @@ -2322,8 +2456,10 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \end{macro} % % \begin{macro}{\tocbasic@listhead} -% \changes{v3.02a}{2009/01/20}{no explicite marks if ``numbered''} -% \changes{v3.09a}{2011/04/12}{again no explicite marks if ``numbered''} +% \changes{v3.02a}{2009/01/20}{no explicite marks if ``numbered''}% +% \changes{v3.09a}{2011/04/12}{again no explicite marks if ``numbered''}% +% \changes{v3.12}{2013/09/24}{usage of new +% \cs{tocbasic@addxcontentsline}}% % Setting the headings of a list of something. The heading is the only % argument. % \begin{macrocode} @@ -2339,7 +2475,7 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. \subsection*{##1}% \ifx\@mkboth\@gobbletwo\else\markright{\MakeMarkcase{##1}}\fi \iftocfeature{\@currext}{totoc}{% - \addcontentsline{toc}{subsection}{##1}% + \addxcontentsline{toc}{subsection}{##1}% }{}% }% }{% @@ -2349,7 +2485,7 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. \section*{##1}% \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}% \iftocfeature{\@currext}{totoc}{% - \addcontentsline{toc}{section}{##1}% + \addxcontentsline{toc}{section}{##1}% }{}% }% }% @@ -2362,7 +2498,7 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. }{% \section*{##1}% \iftocfeature{\@currext}{totoc}{% - \addcontentsline{toc}{section}{##1}% + \addxcontentsline{toc}{section}{##1}% }{}% \ifx\@mkboth\@gobbletwo\else\markright{\MakeMarkcase{##1}}\fi }% @@ -2373,7 +2509,7 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. \chapter*{##1}% \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}% \iftocfeature{\@currext}{totoc}{% - \addcontentsline{toc}{chapter}{##1}% + \addxcontentsline{toc}{chapter}{##1}% }{}% }% }% @@ -2451,6 +2587,8 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \begin{description} % \item[\texttt{totoc}] writes the title of the list of to the table of % contents +% \item[\texttt{numberline}] redefines \cs{nonumberline} to use +% \cs{numberline} % \item[\texttt{numbered}] uses a numbered headings for the list of % \item[\texttt{leveldown}] uses not the top level heading (e.\,g., % \cs{chapter} with book) but the first sub level (e.\,g., \cs{section} with @@ -2521,10 +2659,14 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \changes{v1.0a}{2008/11/11}{use of \cs{addtotoclist} instead of internal}% % \changes{v3.07a}{2010/11/25}{fix: added missing % \cs{let}\cs{@starttoc}\cs{tocbasic@starttoc}}% -% \Package{tocbasic} can overtake \Macro{@starttoc} to automaticly add all -% used extensions to the list of known extensions and use -% \Macro{tocbasic@starttoc} instead of \Macro{@starttoc} from \LaTeX{} -% kernel. +% \Package{tocbasic} can overtake \Macro{@starttoc} to automaticly add all +% used extensions to the list of known extensions and use +% \Macro{tocbasic@starttoc} instead of \Macro{@starttoc} from \LaTeX{} +% kernel. Please note, that we don't need a fix for the unfriendly +% redefinition of \Macro{@starttoc} by \Package{hyperref}, because hyperref +% does it only at the first \LaTeX{} run. So this action of \Package{hyperref} +% may only result in the need of one more \LaTeX{} run, but not in a permanent +% mistake. % \begin{macrocode} \newcommand*{\tocbasicautomode}{% \let\tb@saved@starttoc\@starttoc @@ -2692,20 +2834,22 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \end{macrocode} % \end{macro} % \begin{macro}{\tb@nt@atbegin} -% \changes{v3.09}{new optional identifier \texttt{atbegin}} +% \changes{v3.09}{2011/03/01}{new optional identifier \texttt{atbegin}} +% \changes{v3.11c}{2013/02/01}{\texttt{atbegin} argument may be empty} % 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}}% + \def\tb@nt@atbegin{#1}% } % \end{macrocode} % \end{macro} % \begin{macro}{\tb@nt@atend} -% \changes{v3.09}{new optional identifier \texttt{atbend}} +% \changes{v3.09}{2011/03/01}{new optional identifier \texttt{atbend}} +% \changes{v3.11c}{2013/02/01}{\texttt{atend} argument may be empty} % 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}}% + \def\tb@nt@atend{#1}% } % \end{macrocode} % \end{macro} @@ -2770,6 +2914,13 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. }% }\@tempa % \end{macrocode} +% \changes{v3.12}{2013/05/03}{fixed: definition of +% \cs{listof\meta{type}entryname} added as explained in the manual} +% \begin{macrocode} + \@ifundefined{listof\tb@nt@ext entryname}{% + \expandafter\let\csname listof\tb@nt@ext entryname\endcsname\tb@nt@name + }{}% +% \end{macrocode} % The setup command: % \begin{macrocode} \begingroup\edef\@tempa{\endgroup @@ -2781,20 +2932,24 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. % \end{macrocode} % The float environments: % \changes{v3.09a}{2011/05/30}{fixed: floats may have an optional argument} +% \changes{v3.12}{2013/12/10}{fixed: usage of default placement} % \begin{macrocode} \iftb@float \expandafter\newcommand\expandafter*\csname fps@\tb@nt@type\expandafter - \endcsname{\tb@nt@floatpos}% + \endcsname\expandafter{\tb@nt@floatpos}% \expandafter\newcommand\expandafter*\csname ftype@\tb@nt@type\expandafter - \endcsname{\tb@nt@floattype}% + \endcsname\expandafter{\tb@nt@floattype}% \begingroup \edef\@tempa{% \noexpand\endgroup \noexpand\newenvironment{\tb@nt@type}{% \noexpand\@ifnextchar[%] {\noexpand\tb@atbegin@after\noexpand\@float{\tb@nt@type}}% - {\noexpand\tb@atbegin@after\noexpand\@float{\tb@nt@type}% - [\expandafter\noexpand\csname fps@\tb@nt@type\endcsname]}% + {\noexpand\edef\noexpand\reserved@a{% + \noexpand\noexpand\noexpand\tb@atbegin@after + \noexpand\noexpand\noexpand\@float{\tb@nt@type}% + [\noexpand\csname fps@\tb@nt@type\noexpand\endcsname]}% + \noexpand\reserved@a}% }{% \noexpand\csname \tb@nt@type @atend\noexpand\endcsname \noexpand\end@float @@ -2802,8 +2957,11 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. \noexpand\newenvironment{\tb@nt@type*}{% \noexpand\@ifnextchar[%] {\noexpand\tb@atbegin@after\noexpand\@dblfloat{\tb@nt@type}}% - {\noexpand\tb@atbegin@after\noexpand\@dblfloat{\tb@nt@type}% - [\expandafter\noexpand\csname fps@\tb@nt@type\endcsname]}% + {\noexpand\edef\noexpand\reserved@a{% + \noexpand\noexpand\noexpand\tb@atbegin@after + \noexpand\noexpand\noexpand\@dblfloat{\tb@nt@type}% + [\noexpand\csname fps@\tb@nt@type\noexpand\endcsname]}% + \noexpand\reserved@a}% }{% \noexpand\csname \tb@nt@type @atend\noexpand\endcsname \noexpand\end@dblfloat @@ -2957,8 +3115,9 @@ may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}. %<*load> % Used at \KOMAScript{} packages and classes to load the package. % \begin{macrocode} -\edef\@tempa{\noexpand\RequirePackage{tocbasic}[\tocbasicversion]} -\@tempa +\RequirePackage{tocbasic}[% +%!KOMAScriptVersion +] % \end{macrocode} % %<*class> |