summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex')
-rw-r--r--Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex1198
1 files changed, 833 insertions, 365 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex b/Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex
index 055fc87d798..0e84fc54c33 100644
--- a/Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex
+++ b/Master/texmf-dist/source/latex/koma-script/doc/english/tocbasic.tex
@@ -38,77 +38,57 @@
%% standard classes created by The LaTeX3 Project 1994-1996.
%%
%%% From File: tocbasic.dtx
-\def\tocbasicversion{2011/05/30 v3.09a}
+\def\tocbasicversion{2012/04/04 v3.10b}
\ProvidesFile{tocbasic.tex}
[\tocbasicversion\space KOMA-Script package
(manual)%
]
-\chapter{Package \Package{tocbasic} for Class and Package Authors}
+\translator{Markus Kohm}
+
+
+\chapter[{Management of Tables and Lists of Contents Using
+ \Package{tocbasic}}]
+ {Management of Tables and Lists of Contents Using
+ \Package{tocbasic}\protect\footnote{This chapter has been generated from the
+ source of the package. It's not a 1-to-1 translation of the German
+ manual. Currently translation has not been finished}}
\labelbase{tocbasic}
-\textsc{Note: This is only a short version of the documentation. The german
- \KOMAScript{} guide does contain a long version with usefull examples, that
- should also be translated!}
-
-If a package creates it's list ``list of something''---something like ``list
-of figures'', ``list of tables'', ``list of listings'', ``list of
-algorithms'', etc. also known as \emph{toc-files}---have to do some
-operations, that are equal for all those packages. Also it may be usefull
-for classes and other packages to know about these additional
-toc-files. This packages implements some basic functionality for all those
-packages. Using this package will also improve compatibility with
-\KOMAScript{} and---let us hope---other classes and packages.
-
-\section{Legal Note}
-\label{sec:tocbasic.legalnote}
-
-You are allowed to destribute this part of \KOMAScript{} without the main
-part of \KOMAScript{}. The files ``\File{scrlogo.dtx}'' and
-``\File{tocbasic.dtx}'' may be distributed together under the conditions
-of the \LaTeX{} Project Public License, either version~1.3c of this license
-or (at your option) any later version.
-
-The latest version of this license is in
-\mbox{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.
-
-
-\section{Using Package \Package{tocbasic}}
-\label{sec:tocbasic.usage}
-
-This package was made to be used by class and package authors. Because of
-this the package has no options. If different packages would load it with
-different options a option clash would be the result. So using options
-wouldn't be a good idea.
-
-This package may be used by by other class and package authors. It is also
-allowed to distribute it without the main part of \KOMAScript{} (see
-section~\ref{sec:tocbasic.legalnote}. Because of this, it does not use any
-\KOMAScript{} package, that isn't allowed to be distributed without the main
-part of \KOMAScript{}, too. Currently \Package{tocbasic} does only need
-package \Package{keyval} from the graphics bundle.
-
-There are two kind of commands. The first kind are basic command. Those
-are used to inform other packages about the extensions used for files that
-represent a list of something. Classes or packages may use this information
-e.g, for putting something to every of those files. Packages may also ask,
-if an extension is already in use. This does even work, if \Macro{nofiles}
-was used. The second kind are commands to create the list of something.
-
-\subsection{Basic Commands}
+\BeginIndex{Package}{tocbasic}%
+\BeginIndex{}{table of contents}%
+\BeginIndex{}{list>of contents}%
+\BeginIndex{}{file>extension}%
+The main purpose of package \Package{tocbasic} is to provide features for
+authors of classes and packages to create own tables or lists of contents like
+the list of figures and the list of tables and thereby allow other classes or
+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
+(see \cite{package:babel})%^^A
+. So automatic change of language will be provides inside
+all these tables and lists of contents. Using \Package{tocbasic} will
+exculpate authors of classes and packages from implementation of such
+features.
+
+\KOMAScript{} itself uses \Package{tocbasic} not only for the table of
+contents but also for the already mentioned lists of figures and tables.
+
+\section{Basic Commands}
\label{sec:tocbasic.basics}
-Basic commands are used to handle a list of all extensions known for files
-representing a list of something. Entries to such files are written using
-\Macro{addtocontents} or \Macro{addcontentsline} typically. There are also
-commands to do something for all known extensions. And there are commands to
-set or unset features of an extension or the file represented by the
-extension. Typically an extension also has an owner. This owner may be a
-class or package or a term decided by the author of the class or package
-using \Package{tocbasic}, e.g., \KOMAScript{} uses the owner \texttt{float}
-for list of figures ans list of tables and the default owner for the table of
-contents.
+Basic commands are used to handle a list of all extensions\textnote{file
+ extension, table or list of contents} known for files representing a table
+of contents or list of something. Entries to such files are written using
+\Macro{addtocontents}\important{\Macro{addtocontents},
+ \Macro{addcontentsline}} or \Macro{addcontentsline} typically. There are
+also commands to do something for all known extensions. And there are
+commands to set or unset features of an extension or the file represented by
+the extension. Typically an extension also has an owner\textnote{file owner}.
+This owner may be a class or package or a term decided by the author of the
+class or package using \Package{tocbasic}, e.\,g., \KOMAScript{} uses the
+owner \texttt{float} for list of figures and list of tables, and the file name
+of the class file as owner for the table of contents.
\begin{Declaration}
\Macro{ifattoclist}\Parameter{extension}\Parameter{true
@@ -116,13 +96,14 @@ contents.
\end{Declaration}
\BeginIndex{Cmd}{ifattoclist}%
This command
-may be used to ask, wether a \PName{extension} is already a known extension or
-not. If the \PName{extension} is already known the \PName{true part} will be
-used, otherwise the \PName{false part} will be used.
+may be used to ask, wether or not a \PName{extension} is already a known
+extension. If the \PName{extension} is already known the \PName{true
+ instructions} will be used, otherwise the \PName{false instructions} will be
+used.
\begin{Example}
Maybe you want to know if the extension ``\File{foo}'' is already in use to
report an error, if you can not use it:
- \begin{lstlisting}
+\begin{lstcode}
\ifattoclist{foo}{%
\PackageError{bar}{%
extension `foo' already in use%
@@ -136,7 +117,7 @@ used, otherwise the \PName{false part} will be used.
}{%
\PackageInfo{bar}{using extension `foo'}%
}
- \end{lstlisting}
+\end{lstcode}
\end{Example}
\EndIndex{Cmd}{ifattoclist}%
@@ -145,98 +126,107 @@ used, otherwise the \PName{false part} will be used.
\end{Declaration}
\BeginIndex{Cmd}{addtotoclist}%
This command
-adds the \PName{extension} to the list of known extensions. If the optional
-argument, \OParameter{owner}, was given this \PName{owner} will be stored to
-be the owner of the \PName{extension}. If you omit the optional argument,
-\Package{tocbasic} tries to find out the filename of the current processed
-class or package and stores this as owner. This will fail if
-\Macro{addtotoclist} was not used, loading a class or package but using a
-command of a class or package after loading this class or package. In this
-case the owner will be set to ``\PValue{.}''. Note that an empty
-\PName{owner} is not the same like omitting the optional argument, but an
-empty owner.
+adds the \PName{extension} to the list of known extensions. But if the
+\PName{extension} is a known one already, then an error will be reported to
+avoid double usage of the same \PName{extension}.
+
+If the optional argument, \OParameter{owner}, was given this \PName{owner}
+will be stored to be the owner of the \PName{extension}. If the optional
+argument has been omitted, \Package{tocbasic} tries to find out the file name
+of the current processed class or package and stores this as owner.
+This\textnote{Attention!} will fail if \Macro{addtotoclist} was not used,
+loading a class or package but using a command of a class or package after
+loading this class or package. In this case the owner will be set to
+``\PValue{.}''.
+Please note\textnote{Attention!} that an empty \PName{owner} is not the same
+like omitting the optional argument with the braces. An empty argument would
+result in an empty owner.
\begin{Example}
You want to add the extension ``\File{foo}'' to the list of known extension,
while loading your package with file name ``\File{bar.sty}'':
- \begin{lstlisting}
+\begin{lstcode}
\addtotoclist{foo}
- \end{lstlisting}%
+\end{lstcode}%
This will add the extension ``\PValue{foo}'' with owner ``\PValue{bar.sty}''
to the list of known extensions, if it was not already at the list of known
extensions. If the class or another package already added the extension you
will get the error:
- \begin{lstlisting}
- Package tocbasic Error: file extension `#2' cannot be used twice
+\begin{lstoutput}
+ Package tocbasic Error: file extension `foo' cannot be used twice
See the tocbasic package documentation for explanation.
Type H <return> for immediate help.
- \end{lstlisting}
- and after typing \texttt{H <return>} you will get the help:
- \begin{lstlisting}
+\end{lstoutput}
+ and after typing \texttt{H} and pressing the return key you will get the
+ help:
+\begin{lstoutput}
File extension `foo' is already used by a toc-file, while bar.sty
tried to use it again for a toc-file.
This may be either an incompatibility of packages, an error at a package,
or a mistake by the user.
- \end{lstlisting}
+\end{lstoutput}
Maybe you package has a command, that creates list of files dynamically. In
this case you should use the optional argument of \Macro{addtotoclist} to
set the owner.
- \begin{lstlisting}
+\begin{lstcode}
\newcommand*{\createnewlistofsomething}[1]{%
\addtotoclist[bar.sty]{#1}%
% Do something more to make this list of something available
}
- \end{lstlisting}
- If the user calls know, e.g.
- \begin{lstlisting}
+\end{lstcode}
+ If the user calls now, e.\,g.,
+\begin{lstcode}
\createnewlistofsomething{foo}
- \end{lstlisting}
+\end{lstcode}
this would add the extension ``\PValue{foo}'' with the owner
``\PValue{bar.sty}'' to the list of known extension or report an error, if the
- extension is already in use. You may use any owner you want. But it should
- be unique! So, if you are the author of package \Package{float} you may
- use for example owner ``\PValue{float}'' instead of owner
- ``\PValue{float.sty}'', so the \KOMAScript{} options for list of figure and
- list of table will also handle the lists of this package, that are already
- added to the known extensions, when the option is used.
+ extension is already in use.
\end{Example}
+You may use any owner you want. But it should be unique! So, if you would
+be, e.\,g., the author of package \Package{float} you could use for example
+owner ``\PValue{float}'' instead of owner ``\PValue{float.sty}'', so the
+\KOMAScript{} options for list of figure and list of table will also handle
+the lists of this package, that are already added to the known extensions,
+when the option is used. This is because \KOMAScript{} already registers file
+extension ``\PValue{lof}'' for the list of figures and file extension
+``\PValue{lot}'' for the list of tables with owner ``\PValue{float}'' and sets
+options for this owner.
\EndIndex{Cmd}{addtotoclist}%
\begin{Declaration}
- \Macro{AtAddToTocList}\OParameter{owner}\Parameter{commands}
+ \Macro{AtAddToTocList}\OParameter{owner}\Parameter{instructions}
\end{Declaration}
\BeginIndex{Cmd}{AtAddToTocList}%
This command
-adds the \PName{commands} to a internal list of commands, that should be
-processed, if a toc-file with the given \PName{owner} will be added to the
-list of known extensions using \Macro{addtotoclist}. If you omit the optional
-argument, \Package{tocbasic} tries to find out the filename of the current
-processed class or package and stores this as owner. This will fail if
-\Macro{AtAddToTocList} was not used, loading a class or package but using a
-command of a class or package after loading this class or package. In this
-case the owner will be set to ``\PValue{.}''. Note that an empty
-\PName{owner} is not the same like omitting the optional argument. With an
-empty \PName{owner} you may add \Parameter{commands}, that will be processed
-at every succefull \Macro{addtotoclist}, after processing the commands for the
-indivdual owner. While processing the \PValue{commands}, \Macro{@currext} wil
-be set to the extension of the currently added extension.
+adds the \PName{instructions} to a internal list of instructions, that will be
+processed, whenever a file extension with the given \PName{owner} will be
+added to the list of known extensions using \Macro{addtotoclist}. The
+optional argument is handled in the same kind as with command
+\Macro{addtotoclist}. With an empty \PName{owner} you may
+add \Parameter{instructions}, that will be processed at every successful
+\Macro{addtotoclist}, after processing the instructions for the individual
+owner. While processing the \PValue{instructions},
+\Macro{@currext}\IndexCmd{@currext}\important{\Macro{@currext}} will be set to
+the extension of the currently added extension.
\begin{Example}
-\Package{tocbasic} itself uses
-\begin{lstlisting}
+ \Package{tocbasic} itself uses
+\begin{lstcode}
\AtAddToTocList[]{%
\expandafter\tocbasic@extend@babel
\expandafter{\@currext}%
}
-\end{lstlisting}
-to add every extension to the \Package{tocbasic}-internal babel handling of
-toc-files. The \Macro{expandafter} are needed, because the argument of
-\Macro{tocbasic@extend@babel} has to expanded! See the description of
+\end{lstcode}
+ to add every extension to the \Package{tocbasic}-internal babel handling of
+ files.
+\end{Example}
+
+The two \Macro{expandafter} commands are needed, because the argument of
+\Macro{tocbasic@extend@babel} has to be expanded! See the description of
\Macro{tocbasic@extend@babel} at \autoref{sec:tocbasic.internals}%
, \autopageref{desc:tocbasic.cmd.tocbasic@extend@babel}
for more information.
-\end{Example}
\EndIndex{Cmd}{AtAddToTocList}%
\begin{Declaration}
@@ -246,36 +236,34 @@ for more information.
This command
removes the \PName{extension} from the list of known extensions. If the
optional argument, \OParameter{owner}, was given the \PName{extension} will
-only be removed, if it was added by this \PName{owner}. If you omit the
-optional argument, \Package{tocbasic} tries to find out the filename of the
-current processed class or package and use this as owner. This will fail if
-\Macro{removefromtoclist} was not used, loading a class or package but using a
-command of a class or package after loading this class or package. In this
-case the owner will be set to ``\PValue{.}''. Note that an empty
-\PName{owner} is not the same like omitting the optional argument, but removes
-the \PName{extension} without any owner test.
+only be removed, if it was added by this \PName{owner}. See description of
+\Macro{addtotoclist} for information of omitting optional argument. Note that
+an empty \PName{owner} is not the same like omitting the optional argument,
+but removes the \PName{extension} without any owner test.%
\EndIndex{Cmd}{removefromtoclist}%
\begin{Declaration}
- \Macro{doforeachtocfile}\OParameter{owner}\Parameter{commands}
+ \Macro{doforeachtocfile}\OParameter{owner}\Parameter{instructions}
\end{Declaration}
\BeginIndex{Cmd}{doforeachtocfile}%
-This command
-processes \PName{commands} for every known toc-file of the given
-\PName{owner}. While processing the \PName{commands} \Macro{@currext} ist the
-extension of the current toc-file for every known toc-file. If you omit the
-optional argument, \OParameter{owner}, every known toc-file will be used. If
-the optional argument is empty, only toc-files with an empty owner will be
-used.
+Until now you've learned to know commands, that result in more safety in
+handling file extensions, but also needs some additional effort. With
+\Macro{doforeachtocfile}%^^A
+you'll win for this. The command provides to processes \PName{instructions}
+for every known file extension of the given \PName{owner}. While processing
+the \PName{instructions} \Macro{@currext} is the extension of the current
+file. If you omit the optional argument, \OParameter{owner}, every known file
+extensions independent from the owner will be used. If the optional argument
+is empty, only file extensions with an empty owner will be processed.
\begin{Example}
If you want to type out all known extensions, you may simply write:
- \begin{lstlisting}
+\begin{lstcode}
\doforeachtocfile{\typeout{\@currext}}
- \end{lstlisting}
+\end{lstcode}
and if only the extensions of owner ``\PValue{foo}'' should be typed out:
- \begin{lstlisting}
+\begin{lstcode}
\doforeachtocfile[foo]{\typeout{\@currext}}
- \end{lstlisting}
+\end{lstcode}
\end{Example}
\EndIndex{Cmd}{doforeachtocfile}%
@@ -286,11 +274,24 @@ used.
This command
redefines \LaTeX{} kernel macro \Macro{@starttoc} to add all not yet added
extensions to the list of known extensions and use \Macro{tocbasic@starttoc}
-instead of \Macro{@starttoc}.
+instead of \Macro{@starttoc}. See \autoref{sec:tocbasic.internals}%^^A
+, \autopageref{desc:tocbasic.cmd.tocbasic@starttoc}
+for more information about \Macro{tocbasic@starttoc} and \Macro{@starttoc}.
+
+This means, that after using \Macro{tocbasicautomode} every table of contents
+or list of something, that will be generated using \Macro{@starttoc} will be
+at least partial under control of \Package{tocbasic}. Whether or not this will
+make the wanted result, depends on the individual table of contents and lists
+of something. At least the \Package{babel} control extension for
+all those tables of contents and lists of something will work. Nevertheless,
+it would be better, if the author of the corresponding class or package will
+use \Package{tocbasic} explicitly. In that case additional advantages of
+\Package{tocbasic} may be used, that will be described at the following
+sections.%
\EndIndex{Cmd}{tocbasicautomode}%
-\subsection{Creating a List of Something}
-\label{sec:tocbasic.more}
+\section{Creating a Table of Contents or List of Something}
+\label{sec:tocbasic.toc}
At the previous section you've seen commands to handle a list of known
extensions and to trigger commands while adding a new extension to this
@@ -300,29 +301,35 @@ handle the file corresponding with an extension or the list of known
extensions.
\begin{Declaration}
- \Macro{addtoeachtocfile}\OParameter{owner}\Parameter{contents}
+ \Macro{addtoeachtocfile}\OParameter{owner}\Parameter{content}
\end{Declaration}
\BeginIndex{Cmd}{addtoeachtocfile}%
This command
-writes \PName{contents} to every known toc-file of \PName{owner}. If you omit
-the optional argument, \PName{contents} it written to every known
-toc-file. While writing the contents, \Macro{@currext} is the extension of
-the currently handled toc-file.
+writes \PName{content} to the files of every known file extension of
+\PName{owner} using \LaTeX{} kernel command \Macro{addtocontents}. If you omit
+the optional argument, \PName{content} it written to the files of every known
+file extension. Bay the way: The practical file name is build from
+\Macro{jobname} and the file extension. While writing the \PName{content},
+\Macro{@currext}\IndexCmd{@currext}\important{\Macro{@currext}} is the
+extension of the currently handled file.
\begin{Example}
You may add a vertical space of one text line to all toc-files.
- \begin{lstlisting}
+\begin{lstcode}
\addtoeachtocfile{%
\protect\addvspace{\protect\baselineskip}%
}
- \end{lstlisting}
+\end{lstcode}
And if you want to do this, only for the toc-files of owner
``\PValue{foo}'':
- \begin{lstlisting}
+\begin{lstcode}
\addtoeachtocfile[foo]{%
\protect\addvspace{\protect\baselineskip}%
}
- \end{lstlisting}
+\end{lstcode}
\end{Example}
+Commands, that shouldn't be expanded while writing, should be prefixed by
+\Macro{protect} in the same way like they should be in the argument of
+\Macro{addtocontents}.
\EndIndex{Cmd}{addtoeachtocfile}%
\begin{Declaration}
@@ -331,268 +338,359 @@ the currently handled toc-file.
\end{Declaration}
\BeginIndex{Cmd}{addcontentslinetoeachtocfile}%
This command
-is something like \Macro{addcontentsline} not only for one file, but all known
-toc-files or all known toc-files of a given owner.
+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.
\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{lstlisting}
+\begin{lstcode}
\addcontentslinetoeachtocfile{chapter}{%
\protect\numberline{\thechapter}#1}
- \end{lstlisting}
+\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.
\EndIndex{Cmd}{addcontentslinetoeachtocfile}%
\begin{Declaration}
+ \Macro{listoftoc}\OParameter{list of title}\Parameter{extension}
+\\
\Macro{listoftoc*}\Parameter{extension}
\\
- \Macro{listoftoc}\OParameter{list of title}\Parameter{extension}
+ \Macro{listofeachtoc}\OParameter{owner}
+\\
+ \Macro{listof\PName{file-extension}name}
\end{Declaration}
\BeginIndex{Cmd}{listoftoc*}%
\BeginIndex{Cmd}{listoftoc}%
-This commands
-may be used to set the ``list of'' of a toc-file. The star version
-\Macro{listoftoc*} needs only one argument, the extension of the toc-file. It
-does setup the vertical and horizontal spacing of paragraphs, calls before and
-after hooks and reads the toc-file. You may use it as direct replacement of
-the \LaTeX{} kernel macro \Macro{@starttoc}.
-
-The version without star, sets the whole toc-file with title, optional table
-of contents entry, and running heads. If the optional argument
-\OParameter{list of title} was given, it will be used as title term, optional
-table of contents entry and running head. Note: If the optional argument is
-empty, this term will be empty, too! If you omit the optional argument, but
-\Macro{listof\PName{extension}name} was defined, that will be used.
+\BeginIndex{Cmd}{listofeachtoc}%
+\BeginIndex{Cmd}{listof\PName{file-extension}name}%
+These commands
+may be used to set the ``list of'' corresponding to file
+extension. The\important{\Macro{listoftoc*}} star version \Macro{listoftoc*}
+needs only one argument, the extension of the file. It does setup the vertical
+and horizontal spacing of paragraphs, calls before hooks, reads the file, and
+last but not least calls the after hooks. You may interpret it as direct
+replacement of the \LaTeX{} kernel macro
+\Macro{@starttoc}\IndexCmd{@starttoc}\important{\Macro{@starttoc}}.
+
+The\important{\Macro{listoftoc}} version without star, sets the whole file
+with title, optional table of contents entry, and running heads. If the
+optional argument \OParameter{list of title} was given, it will be used as
+title term, optional table of contents entry and running head. Please
+note\textnote{Attention!}: If the optional argument is empty, this term will
+be empty, too! If you omit the optional argument, but
+\Macro{listof\PName{extension}name} was defined, that will be used. If that is
+also not defined, a standard ersatz name will be used and reported by a
+warning message.
+
+The\important{\Macro{listofeachtoc}} command \Macro{listofeachtoc} outputs all
+lists of something of the given \PName{owner} or of all known file
+extensions. Thereby\textnote{Attention!}
+\Macro{listof\PName{file-extension}name} should be defined to get the correct
+titles.
+It\textnote{Hint!} is recommended to define
+\Macro{listof\PName{file-extension}name} for all used file extensions, because
+the user itself may use \Macro{listofeachtoc}.
\begin{Example}
- You have a new ``list of algorithms'' with extension \PValue{loa} and want to
- show it.
- \begin{lstlisting}
- \listof[list of algorithm]{loa}
- \end{lstlisting}
- Maybe you want, that the ``list of algorithms'' will create an entry at the
- table of contents. You may set
- \begin{lstlisting}
- \setuptoc{loa}{totoc}
- \end{lstlisting}
- But maybe the ``list of algorithms'' should not be set with a title. So you
- may use
- \begin{lstlisting}
+ Assumed, you have a new ``list of algorithms'' with extension \PValue{loa}
+ and want to show it:
+\begin{lstcode}
+ \listoftoc[List of Algorithms]{loa}
+\end{lstcode}
+ will do it for you. But maybe the ``list of algorithms'' should not be set
+ with a title. So you may use
+\begin{lstcode}
\listof*{loa}
- \end{lstlisting}
+\end{lstcode}
Note that in this case no entry at the table of contents will be created,
even if you'd used the setup command above.
+ See command \Macro{setuptoc}
+ at \autopageref{desc:tocbasic.cmd.setuptoc}
+ for more information about the
+ attribute of generating entries into the table of contents using
+ \Macro{setuptoc}.
+
+ If you've defined
+\begin{lstcode}
+ \newcommand*{\listofloaname}{%
+ List of Algorithms%
+ }
+\end{lstcode}
+ before, then
+\begin{lstcode}
+ \listoftoc{loa}
+\end{lstcode}
+ would be enough to print the list of algorithms with the wanted heading. For
+ the user it may be easier to operate, if you'd define
+\begin{lstcode}
+ \newcommand*{\listofalgorithms}{\listoftoc{loa}}
+\end{lstcode}
+ additionally.
\end{Example}
-The default heading new following features using \Macro{setuptoc}:
-\begin{description}
-\item[\texttt{totoc}] writes the title of the list of to the table of contents
-\item[\texttt{numbered}] uses a numbered headings for the list of
-\item[\texttt{leveldown}] uses not the top level heading (e.g., \Macro{chapter}
- with book) but the first sub level (e.g., \Macro{section} with book).
-\end{description}
+Because\textnote{Attention!} \LaTeX{} normally opens a new file for each of
+those lists of something immediately, the call of each of those commands may
+result in an error like:
+\begin{lstoutput}
+ ! No room for a new \write .
+ \ch@ck ...\else \errmessage {No room for a new #3}
+ \fi
+\end{lstoutput}
+if there are no more write handles left. Loading package
+\Package{scrwfile}\important{\Package{scrwfile}}\IndexPackage{scrwfile}
+(see \autoref{cha:scrwfile})
+may solve this problem.
+\EndIndex{Cmd}{listof\PName{Dateierweiterung}name}%
+\EndIndex{Cmd}{listofeachtoc}%
\EndIndex{Cmd}{listoftoc*}%
\EndIndex{Cmd}{listoftoc}%
\begin{Declaration}
- \Macro{BeforeStartingTOC}\OParameter{extension}\Parameter{commands}
+ \Macro{BeforeStartingTOC}\OParameter{extension}\Parameter{instructions}
\\
- \Macro{AfterStartingTOC}\OParameter{extension}\Parameter{commands}
+ \Macro{AfterStartingTOC}\OParameter{extension}\Parameter{instructions}
\end{Declaration}
\BeginIndex{Cmd}{BeforeStartingTOC}%
\BeginIndex{Cmd}{AfterStartingTOC}%
-This commands
-may be used to process \PName{commands} before or after loading the toc-file
-with given \PName{extension} using \Macro{listoftoc*} or \Macro{listoftoc}. If
-you omit the optional argument (or set an empty one) the general hooks will be
-set. The general before hook will be called before the individuel one and the
-general after hook will be called after the individuel one. While calling the
-hooks \Macro{@currext} is the extension of the toc-file and should not be
-changed.
+Sometimes it's useful, to process \PName{instructions} immediately before
+reading the helper file of a list of something.
+These commands
+may be used to process \PName{instructions} before or after loading the file
+with given \PName{extension} using \Macro{listoftoc*}, \Macro{listoftoc}, or
+\Macro{listofeachtoc}. If you omit the optional argument (or set an empty
+one) the general hooks will be set. The general before hook will be called
+before the individuel one and the general after hook will be called after the
+individuel one. While calling the hooks
+\Macro{@currext}\IndexCmd{@currext}\important{\Macro{@currext}} is the
+extension of the toc-file and should not be changed.
+
+An example\textnote{Example} for usage of \Macro{AfterStartingTOC} may be
+found in \autoref{sec:scrwfile.clonefilefeature} at
+\autopageref{example:scrwfile.AfterStartingTOC}.
\EndIndex{Cmd}{AfterStartingTOC}%
\EndIndex{Cmd}{BeforeStartingTOC}%
\begin{Declaration}
- \Macro{BeforeTOCHead}\OParameter{extension}\Parameter{commands}
+ \Macro{BeforeTOCHead}\OParameter{file extension}\Parameter{instructions}
\\
- \Macro{AfterTOCHead}\OParameter{extension}\Parameter{commands}
+ \Macro{AfterTOCHead}\OParameter{file extension}\Parameter{instructions}
\end{Declaration}
\BeginIndex{Cmd}{BeforeTOCHead}%
\BeginIndex{Cmd}{AfterTOCHead}%
This commands
-may be used to process \PName{commands} before or after setting the title of a
-toc-file with given \PName{extension} using \Macro{listoftoc*} or
-\Macro{listoftoc}. If you omit the optional argument (or set an empty one) the
-general hooks will be set. The general before hook will be called before the
-individuel one and the general after hook will be called after the individuel
-one. While calling the hooks \Macro{@currext} is the extension of the toc-file
-and should not be changed.
+may be used to process \PName{instructions} before or after setting the title
+of a list of something corresponding to given \PName{file extension} using
+\Macro{listoftoc*} or \Macro{listoftoc}. If you omit the optional argument (or
+set an empty one) the general hooks will be set. The general before hook will
+be called before the individuel one and the general after hook will be called
+after the individuel one. While calling the hooks
+\Macro{@currext}IndexCmd{@currext}\important{\Macro{@currext}} is the
+extension of the corresponding file and should not be changed.
\EndIndex{Cmd}{AfterTOCHead}%
\EndIndex{Cmd}{BeforeTOCHead}%
\begin{Declaration}
- \Macro{listofeachtoc}\OParameter{owner}
-\end{Declaration}
-\BeginIndex{Cmd}{listofeachtoc}%
-This command
-sets all toc-files or all toc-files of the given \PName{owner} using
-\Macro{listoftoc}. You should have defined
-\Macro{listof\PName{extension}name} for each toc-file, otherwise you'll get a
-warning.
-\EndIndex{Cmd}{listofeachtoc}%
-
-\begin{Declaration}
- \Macro{MakeMarkcase}
+ \Macro{MakeMarkcase}\Parameter{text}
\end{Declaration}
\BeginIndex{Cmd}{MakeMarkcase}%
-This command
-will be used to change the case of the letters at the running
-head. The default is, to use \Macro{@firstofone} for \KOMAScript{} classes and
-\Macro{MakeUppercase} for all other classes. If you are the class author you
-may define \Macro{MakeMarkcase} on your own. If \Package{scrpage2} or another
-package, that defines \Macro{MakeMarkcase} will be used, \Package{tocbasci}
-will not overwrite that Definition.
+Whenever \Package{tocbasic} sets a mark for a running head, The text of the
+mark will be an argument of \Macro{MakeMarkcase}%^^A
+. This command may be used, to change the case of the letters at the running
+head if wanted. The default is, to use
+\Macro{@firstofone}\IndexCmd{@firstofone}\important{\Macro{@firstofone}} for
+\KOMAScript{} classes. This means the text of the running head will be set
+without change of case.
+\Macro{MakeUppercase}\IndexCmd{MakeUppercase}\important{\Macro{MakeUppercase}}
+will be used for all other classes. If you are the class author you may define
+\Macro{MakeMarkcase} on your own. If \Package{scrpage2} or another package,
+that defines \Macro{MakeMarkcase} will be used, \Package{tocbasic} will not
+overwrite that definition.
+\begin{Example}
+ For incomprehensible reasons, you want to set the running heads in lower
+ case letters only. To make this automatically for all running heads, that
+ will be set by \Package{tocbasic}, you define:
+\begin{lstcode}
+ \let\MakeMarkcase\MakeLowercase
+\end{lstcode}
+\end{Example}
+Please\textnote{Hint!} allow me some words about \Macro{MakeUppercase}, First
+of all this command isn't fully expandable. This means, that problems may
+occur using it in the context of other commands. Beyond that typographers
+accord, that whenever setting whole words or phrases in capitals, letter
+spacing is absolutely necessary. But correct letter spacing of capitals
+shouldn't be done with a fix white space between all letters. Different pairs
+of letters need different space between each other. Additional some letters
+build holes in the text, that have to be taken into account. Packages like
+\Package{ulem} or \Package{soul} doesn't provide this and
+\Macro{MakeUppercase} doesn't do anything like this. Also automatic letter
+spacing using package \Package{microtype} is only one step to a less-than-ideal
+solution, because it cannot recognize and take into account the glyphs of the
+letters. Because of this\textnote{Attention!} typesetting whole words and
+phrases is expert work and almost ever must be hand made. So average users are
+recommended to not do that or to use it only spare and not at exposed places
+like running heads.%
\EndIndex{Cmd}{MakeMarkcase}%
\begin{Declaration}
- \Macro{deftocheading}\Parameter{extension}\Parameter{definition}
+ \Macro{deftocheading}\Parameter{file extension}\Parameter{definition}
\end{Declaration}
\BeginIndex{Cmd}{deftocheading}%
-This command
-defines a heading command, that will be used instead of the
-default heading using \Macro{listoftoc}. The heading command has exactly one
-argument. You may reference to that argument using \texttt{\#1} at your
-\PName{defintion}.
+The package \Package{tocbasic} contains a standard definition for typesetting
+headings of tables of contents or lists of something. This standard definition
+is configurable by several features, described at \Macro{setuptoc} next. But
+if all those features are not enough, an alternative heading command may be
+defined using \Macro{deftocheading}%^^A
+. Thereby \PName{file extension} is the file extension of the corresponding
+helper file. The \PName{definition} of the heading command may use one single
+parameter \PValue{\#1}. While calling the newly defined command inside of
+\Macro{listoftoc} or \Macro{listofeachtoc} that \PValue{\#1} will be replaced by the
+corresponding heading term.
\EndIndex{Cmd}{deftocheading}%
\begin{Declaration}
- \Macro{setuptoc}\Parameter{extension}\Parameter{featurelist}
+ \Macro{setuptoc}\Parameter{file extension}\Parameter{feature list}
\\
- \Macro{unsettoc}\Parameter{extension}\Parameter{featurelist}
+ \Macro{unsettoc}\Parameter{file extension}\Parameter{feature list}
\end{Declaration}
\BeginIndex{Cmd}{setuptoc}%
\BeginIndex{Cmd}{unsettoc}%
This commands
-set up and unset features binded to an \PName{extension}. The
-\PName{featurelist} is a comma seperated list of single
+set up and unset features bound to an \PName{file extension}. The
+\PName{feature list} is a comma seperated list of single
features. \Package{tocbasic} does know following features:
\begin{description}
-\item[\texttt{totoc}] writes the title of the list of to the table of contents
-\item[\texttt{numbered}] uses a numbered headings for the list of
-\item[\texttt{leveldown}] uses not the top level heading (e.g., \Macro{chapter}
- with book) but the first sub level (e.g., \Macro{section} with book).
-\item[\texttt{onecolumn}] switchs to internal one column mode, if the toc
- is set in internal two column mode and no \texttt{leveldown} was used.
-\item[\texttt{nobabel}] prevents the extension to be added to the babel
- handling of toc-files. To make this work, you have to set the feature
- before adding the extension to the list of known extension.
-\item[\texttt{noprotrusion}] prevents disabling character protrusion at the
- lists of something. Character protrusion at the lists will be disabled by
- default if package \Package{microtype} or another package, that supports
- \Macro{microtypesetup}, was loaded. So if you want protrusion at the lists,
- you have to set this feature. But note, that with character protrusion
- entries at the list may be set wrong. This is a known issue of character
- protrusion.
+\item[\texttt{leveldown}] uses not the top level heading below
+ \Macro{part}\,---\,\Macro{chapter} if available, \Macro{section}
+ otherwise\,---\,but the first sub level. This feature will be evaluated by
+ the internal heading command. On the other hand, if an user defined heading
+ command has been made with \Macro{deftocheading}, that user is responsible
+ for the evaluation of the feature. The \KOMAScript{} classes set this
+ feature using option
+ \OptionValue{listof}{leveldown}important{\OptionValue{listof}{leveldown}}%
+ \IndexOption{listof~=\PValue{leveldown}} for all file extensions of the
+ owner \PValue{float}.
+\item[\texttt{nobabel}] prevents usage of the language switch of
+ \Package{babel}\IndexPackage{babel} at the helper file with the
+ corresponding \PName{file extension}. This feature should be used only for
+ helper files, that contain text in one language only. Changes of the
+ language inside of the document will not longer regarded at the helper
+ file. Package
+ \Package{scrwfile}\important{\Package{scrwfile}}\IndexPackage{scrwfile} uses
+ this feature also for clone destinations, because those will get the
+ language change from the clone source already.
+\item[\texttt{noprotrusion}] prevents\ChangedAt{v3.10}{\Package{tocbasic}}
+ disabling character protrusion at the lists of something. Character
+ protrusion at the lists will be disabled by default if package
+ \Package{microtype}\IndexPackage{microtype} or another package, that
+ supports \Macro{microtypesetup}\IndexCmd{microtypesetup}, was loaded. So if
+ you want protrusion at the lists, you have to set this feature. But
+ note\textnote{Attention!}, that with character protrusion entries at the
+ list may be set wrong. This is a known issue of character protrusion.
+\item[\texttt{numbered}] uses a numbered heading for the table of contents or
+ list of something and because of this also generates an entry to the table
+ of contents. This feature will be evaluated by the internal heading
+ command. On the other hand, if an user defined heading command has been made
+ with \Macro{deftocheading}, that user is responsible for the evaluation of
+ the feature. The \KOMAScript{} classes set this feature using option
+ \OptionValue{listof}{numbered}\important{\OptionValue{listof}{numbered}}%
+ \IndexOption{listof~=\PValue{numbered}} for all file extensions of the owner
+ \PValue{float}.
+\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
+ \Macro{onecolumn}\IndexCmd{onecolumn}. This\textnote{Attention!} will be
+ done only, if the corresponding table of contents or list of something
+ doesn't use feature \PValue{leveldown}\important{\PValue{leveldown}}. The
+ \KOMAScript{} classes \Class{scrbook} and \Class{scrreprt} activate this
+ feature with \Macro{AtAddToTocList} (see \autoref{sec:tocbasic.basics}%^^A
+ , \autopageref{desc:tocbasic.cmd.AtAddToTocList}%^^A
+ ) for all lists of something with owner \PValue{float} or with themselves as
+ owner. With this, e.\,g., the table of contents, the list of figures and the
+ list of tables of both classes will be single columned automatically. The
+ multiple-column-mode of package \Package{multicol}\IndexPackage{multicol}
+ will not be recognized or changed by this option.
+\item[\texttt{totoc}] writes the title of the corresponding table of contents
+ or the list of something to the table of contents. This feature will be
+ evaluated by the internal heading command. On the other hand, if an user
+ defined heading command has been made with \Macro{deftocheading}, that user
+ is responsible for the evaluation of the feature. The \KOMAScript{} classes
+ set this feature using option
+ \OptionValue{listof}{totoc}\important{\OptionValue{listof}{totoc}}%
+ \IndexOption{listof~=\PValue{totoc}} for all file extensions of the owner
+ \PValue{float}.
\end{description}
-Classes and packages may know features, too, e.g, the \KOMAScript{} classes
+Classes and packages may know features, too, e.\,g, the \KOMAScript{} classes
know following additional features:
\begin{description}
\item[\texttt{chapteratlist}] activates special code to be put into the list
at start of a new chapter. This code may either be vertical space or the
heading of the chapter.
+ See \Option{listof}\IndexOption{listof}\important{\Option{listof}} in
+ \autoref{sec:maincls.floats}, \autopageref{desc:maincls.option.listof} for
+ more information about such features.
\end{description}
+\begin{Example}
+ Because \KOMAScript{} classes use \Package{tocbasic} for the list of figures
+ and list of tables, there's one more way to remove chapter structuring at
+ those:
+\begin{lstcode}
+ \unsettoc{lof}{chapteratlist}
+ \unsettoc{lot}{chapteratlist}
+\end{lstcode}
+
+ And if you want to have the chapter structuring of the \KOMAScript{} classes
+ at your own list of algorithms with \PName{file extension} ``\PValue{load}''
+ from the previous examples, you may use
+\begin{lstcode}
+ \setuptoc{loa}{chapteratlist}
+\end{lstcode}
+ And if classes with \Macro{chapter} should also force single column mode for
+ the list of algorithms you may use
+\begin{lstcode}
+ \ifundefinedorrelax{chapter}{}{%
+ \setuptoc{loa}{onecolumn}%
+ }
+\end{lstcode}
+ Usage of \Macro{ifundefinedorrelax} presumes package \Package{scrbase}%^^A
+ \ (see \autoref{sec:scrbase.if},
+ \autopageref{desc:scrbase.cmd.ifundefinedorrelax})%^^A
+ .
+
+ It\textnote{Hint!} doesn't matter if you're package would be used with
+ another class. You should never the less set this feature. And if the other
+ class would also recognize the feature your package would automatically use
+ the feature of that class.
+\end{Example}
+As you may see, packages, that use \Package{tocbasic}, already provide several
+interesting features, without the need of a lot of implementation effort. Such
+an effort would be needed only without \Package{tocbasic} and because of this,
+most packages currently lack of such features.%
\EndIndex{Cmd}{unsettoc}%
\EndIndex{Cmd}{setuptoc}%
\begin{Declaration}
- \Macro{iftocfeature}\Parameter{extension}\Parameter{feature}%^^A
- \Parameter{true-part}\Parameter{false-part}
+ \Macro{iftocfeature}\Parameter{file extension}\Parameter{feature}%^^A
+ \Parameter{true-instructions}%^^A
+ \Parameter{false-instructions}
\end{Declaration}
\BeginIndex{Cmd}{iftocfeature}%
This command
-may be used, to test, if a \PName{feature} was set for \PName{extension}. If
-so the \PName{true-part} will be processed, otherwise the \PName{false-part}
-will be.
+may be used, to test, if a \PName{feature} was set for \PName{file
+ extension}. If so the \PName{true-instructions} will be processed, otherwise
+the \PName{false-instruction} will be. This may be useful, e.\,g., if you
+define your own heading command using \Macro{deftocheading} but want to
+support the features \PValue{totoc}, \PValue{numbered} or \PValue{leveldown}.
\EndIndex{Cmd}{iftocfeature}%
-\subsection{Generating new Lists of and new Floats}
-\label{sec:tocbasic.highlevel}
-
-There is one simple command to generate either a new list of foo or a new list
-of a new float.
-
-\begin{Declaration}
- \Macro{DeclareNewTOC}\OParameter{options}\Parameter{extension}
-\end{Declaration}
-\BeginIndex{Cmd}{DeclareNewTOC}%
-This command
-declares at least a new list of \PName{extension}. Depending on the
-\PName{options} it may also define a new float. The mandatory argument
-\PName{extension} is the extension of the help file for that list. See the
-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{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.
-\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{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{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}
-
-\subsection{Internal Commands for Class and Package Authors}
+\section{Internal Commands for Class and Package Authors}
\label{sec:tocbasic.internals}
Commands with prefix \Macro{tocbasic@} are internal but class and package
@@ -600,30 +698,78 @@ authors may use them. But even if you are a class or package author you
should not change them!
\begin{Declaration}
- \Macro{tocbasic@extend@babel}\Parameter{extension}
+ \Macro{tocbasic@extend@babel}\Parameter{file extension}
\end{Declaration}
\BeginIndex{Cmd}{tocbasic@extend@babel}%
-This command
-extends the babel handling of toc-files. By default babel writes language
-selections only to \PValue{toc}, \PValue{lot} and
-\PValue{lof}. \Package{tocbasic} adds every \PName{extension} added to the
-list of known extensions (see \Macro{addtotoclist}, \autoref{sec:tocbasic.basics}%
-, \autopageref{desc:tocbasic.cmd.addtotoclist}%
-) using \Macro{tocbasic@extend@babel}. Note: This should be called only once
-per \PName{extension}. \Macro{tocbasic@extend@babel} does nothing, if the
-feature \PValue{nobabel} was set for \PName{extension} before using
-\Macro{addtotoclist}.
+The Package \Package{babel}\IndexPackage{babel}
+(see \cite{package:babel})
+respectively a \LaTeX{} kernel that has been extended by the language
+management of \Package{babel} writes instructions to change the language
+inside of the files with the file extensions \File{toc}, \File{lof}, and
+\File{lot} into those files at every change of the current language
+either at the begin of the document or inside the document. Package
+\Package{tocbasic} extends this mechanism with
+\Macro{tocbasic@extend@babel}
+to be used for other file extensions too. Argument \PName{file extension} has
+to be expandable! Otherwise the meaning of the argument may change until it
+will be used really.
+
+Normally this command will be used by default for every \PName{file extension}
+that will be added to the list of known extensions using
+\Macro{addtotoclist}. The may be suppressed using feature
+\PValue{nobabel}\important{\PValue{nobabel}} (see \Macro{setuptoc},
+\autoref{sec:tocbasic.toc}%^^A
+, \autopageref{desc:tocbasic.cmd.setuptoc}%^^A
+). For the file extensions \File{toc}, \File{lof}, and \File{lot} this will be
+done automatically by \Package{tocbasic} to avoid double language switching in
+the corresponding files.
+
+Normally there isn't any reason to call this command yourself. But there may
+by lists of something, that should not be under control of \Package{tocbasic},
+and to are not in \Package{tocbasic}'s list of known file extensions, but
+nevertheless should be handled by the language change mechanism of
+\Package{babel}. The command may be used explicitly for those files. But pleas
+note, that this should be done only once per file extension!%
\EndIndex{Cmd}{tocbasic@extend@babel}%
\begin{Declaration}
\Macro{tocbasic@starttoc}\Parameter{extension}
\end{Declaration}
\BeginIndex{Cmd}{tocbasic@starttoc}
-This command is something like the \LaTeX{} kernel macro \Macro{@starttoc},
-but does some additional settings before using \Macro{@starttoc}. It does set
-\Macro{parskip} zu zero, \Macro{parindent} to zero, \Macro{parfillskip} to
-zero plus one fil, \Macro{@currext} to the \PName{extension}, and processes
-hooks before and after reading the toc-file.
+This command
+is something like the \LaTeX{} kernel macro
+\Macro{@starttoc}\IndexCmd{@starttoc}\important{\Macro{@starttoc}}. It's the
+command behind \Macro{listoftoc*} (siehe \autoref{sec:tocbasic.toc}%^^A
+, \autopageref{desc:tocbasic.cmd.listoftoc*}%^^A
+). Authors of classes or packages who want to participate from the advantages
+of \Package{tocbasic} should at least use this command. Nevertheless it's
+recommended to use \Macro{listoftoc}. Command \Macro{tocbasic@starttoc}
+internally uses \Macro{\@starttoc}, but sets
+\Length
+{parskip}\IndexLength{parskip}\important{\Length{parskip}\\
+ \Length{parindent}\\
+ \Length{parfillskip}} and
+\Length
+{parindent}\IndexLength{parindent} to 0 and
+\Length
+{parfillskip} to 0 until infinite before. Moreover,
+\Macro{@currext}\important{\Macro{@currext}}\IndexCmd{@currext} will be set to
+the file extension of the current helper file, so this will be available while
+the execution of the hooks, that will be done before and after reading the
+helper files.
+
+Because\textnote{Attention!} of \LaTeX{} will immediately open a new helper
+file for writing after reading that file, the usage of
+\Macro{tocbasic@starttoc} may result in an error message like
+\begin{lstoutput}
+ ! No room for a new \write .
+ \ch@ck ...\else \errmessage {No room for a new #3}
+ \fi
+\end{lstoutput}
+if there are no more unused write handles. This may be solved, e.\,g., using
+package
+\Package{scrwfile}\important{\Package{scrwfile}}\IndexPackage{scrwfile}.
+See \autoref{cha:scrwfile} for more information about that package.%
\EndIndex{Cmd}{tocbasic@starttoc}
\begin{Declaration}
@@ -632,10 +778,27 @@ hooks before and after reading the toc-file.
\end{Declaration}
\BeginIndex{Cmd}{tocbasic@@before@hook}%
\BeginIndex{Cmd}{tocbasic@@after@hook}%
-This macros
-are processed before and after loading a toc-file. If you don't use
-\Macro{listoftoc} or \Macro{listoftoc*} or \Macro{tocbasic@starttoc} to load
-the toc-file, you should call these, too. But you should not redefine them!
+The hook \Macro{tocbasic@@before@hook} will be executed immediately before
+reading a helper file for a table of contents or list of something even
+before execution of the instructions of a \Macro{BeforeStartingTOC}
+command. It is permitted to extend this hook using
+\Macro{g@addto@macro}\IndexCmd{g@addto@macro}.
+
+Similarly \Macro{tocbasic@@after@hook} will be executed immediately after
+reading such a helper file and before execution of instructions of
+\Macro{AfterStartingTOC}. It is permitted to extend this hook using
+\Macro{g@addto@macro}\IndexCmd{g@addto@macro}.
+
+\KOMAScript{} uses these hooks, to provide the automatic width calculation of
+the place needed by heading numbers. Only classes and packages should use
+these hooks. Users\textnote{Attention!} should really use
+\Macro{BeforeStartingTOC} and \Macro{AfterStartingTOC} instead. Authors of
+packages should also favor those commands! These hooks shouldn't be used to
+generate any output!
+
+If neither\textnote{Attention!} \Macro{listofeachtoc} nor \Macro{listoftoc}
+nor \Macro{listoftoc*} are used for the output of a table of contents or list
+of something, the hooks should be executed explicitly.%
\EndIndex{Cmd}{tocbasic@@before@hook}%
\EndIndex{Cmd}{tocbasic@@after@hook}%
@@ -645,12 +808,14 @@ the toc-file, you should call these, too. But you should not redefine them!
\end{Declaration}
\BeginIndex{Cmd}{tocbasic@\PName{extension}@before@hook}%
\BeginIndex{Cmd}{tocbasic@\PName{extension}@after@hook}%
-This macros
-are processed before and after loading a toc-file. If you don't use
-\Macro{listoftoc} or \Macro{listoftoc*} or \Macro{tocbasic@starttoc} to load
-the toc-file, you should call these, too. But you should not redefine them!
-The first macro is processed just before \Macro{tocbasic@@before@hook}, the
-second one just after \Macro{tocbasic@@after@hook}
+These hooks are processed after \Macro{tocbasic@@before@hook}, respectively
+before \Macro{tocbasic@@after@hook} before and after loading the helper file
+with the corresponding file \PName{extension}. Authors\textnote{Attention!}
+of classes and packages should never manipulate them! But if
+neither\textnote{Attention!} \Macro{listofeachtoc} nor \Macro{listoftoc} nor
+\Macro{listoftoc*} are used for the output of a table of contents or list of
+something, the hooks should be executed explicitly, if they are
+defined. Please note, that they even can be undefined.%
\EndIndex{Cmd}{tocbasic@\PName{extension}@after@hook}%
\EndIndex{Cmd}{tocbasic@\PName{extension}@before@hook}%
@@ -660,10 +825,12 @@ second one just after \Macro{tocbasic@@after@hook}
\BeginIndex{Cmd}{tocbasic@listhead}%
This command
is used by \Macro{listoftoc} to set the heading of the list, either the
-default heading or the indiviually defined heading. If you define your own
+default heading or the individually defined heading. If you define your own
list command not using \Macro{listoftoc} you may use
-\Macro{tocbasic@listhead}. In this case you should define \Macro{@currext} to
-be the extension of the toc-file before using \Macro{tocbasic@listhead}.
+\Macro{tocbasic@listhead}. In this case you should define
+\Macro{@currext}\important{\Macro{@currext}}\IndexCmd{@currext} to be the file
+extension of the corresponding helper file before using
+\Macro{tocbasic@listhead}.
\EndIndex{Cmd}{tocbasic@listhead}%
\begin{Declaration}
@@ -673,8 +840,309 @@ be the extension of the toc-file before using \Macro{tocbasic@listhead}.
This command
is used in \Macro{tocbasic@listhead} to set the individual headings, optional
toc-entry, and running head, if it was defined. If it was not defined it will
-be defined and used in \Macro{tocbasic@listhead}.
+be defined and used in \Macro{tocbasic@listhead} automatically.
\EndIndex{Cmd}{tocbasic@listhead@\PName{extension}}%
+
+\section{A Complete Example}
+\label{sec:tocbasic.example}
+
+This section will show you a complete example of a user defined floating
+environment with list of that kind of floats and \KOMAScript{} integration
+using \Package{tocbasic}. This example uses internal commands, that have a
+``\texttt{@}'' in their name. This means\textnote{Attention}, that the code
+has to be put into a own package or class, or has to be placed between
+\Macro{makeatletter}\important[i]{\Macro{makeatletter}\\\Macro{makeatother}}%
+\IndexCmd{makeatletter} and \Macro{makeatother}\IndexCmd{makeatother}.
+
+First\textnote{environment} of all, a new floating environment will be
+needed. This could simply be done using:
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newenvironment{remarkbox}{%
+ \@float{remarkbox}%
+ }{%
+ \end@float
+ }
+\end{lstcode}
+To the new environment is named \Environment{remarkbox}.
+
+Each\textnote{placement} floating environment has a default
+placement. This is build by some of the well known placement options:
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\fps@remarkbox}{tbp}
+\end{lstcode}
+So, the new floating environment should be placed by default only either at
+the top of a page, at the bottom of a page, or on a page on its own.
+
+Floating\textnote{type} environments have a numerical floating
+type. Environments with the same active bit at the floating type cannot change
+their order. Figures and table normally use type~1 and 2. So a figure that
+comes later at the source code than a table, may be output earlier than the
+table and vica versa.
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\ftype@remarkbox}{4}
+\end{lstcode}
+The new environment has floating type~4, so it may pass figures and floats and
+may be passed by those.
+
+The\textnote{number} captions of floating environment also have numbers.
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcounter{remarkbox}
+ \newcommand*{\remarkboxformat}{%
+ Remark~\theremarkbox\csname autodot\endcsname}
+ \newcommand*{\fnum@remarkbox}{\remarkboxformat}
+\end{lstcode}
+Here first a new counter has been defined, that is independent from chapters
+or the counters of other structural levels. \LaTeX{} itself also defines
+\Macro{theremarkbox} with the default Arabic representation of the counter's
+value. Afterwards this has been used defining the formatted output of the
+counter. Last this formatted output has been used for the output of the
+environment number of the \Macro{caption} command.
+
+Floating\textnote{file extension} environments have lists of themselves and
+those need a helper file with name \Macro{jobname} and a file extension.
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\ext@remarkbox}{lor}
+\end{lstcode}
+The file extension of the helper file for the list of
+\Environment{remarkbox}es is ``\File{lor}''.
+
+This was the definition of the floating environment. But the list of this new
+environment's captions is still missing. To reduce the implementation effort
+package \Package{tocbasic} will be used for this. This will be loaded using
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \usepackage{tocbasic}
+\end{lstcode}
+inside of document preambles. Authors of classes or packages would use
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \RequirePackage{tocbasic}
+\end{lstcode}
+instead.
+
+Now\textnote{extension} we register the file name extension for package
+\Package{tocbasic}:
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \addtotoclist[float]{lor}
+\end{lstcode}
+Thereby the owner \PValue{float} has been used, to allude all further
+\KOMAScript{} options for lists of something also to the new one.
+
+Next\textnote{title} we define a title or heading for the list of
+\Environment{remarkbox}es:
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\listoflorname}{List of Remarks}
+\end{lstcode}
+You may use package \Package{scrbase} to additionally support titles in other
+languages than English.
+
+Also\textnote{entry} a command is needed to define the layout of the entries
+to the list of remarks:
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\l@remarkbox}{\l@figure}
+\end{lstcode}
+Here simply the entries to the list of remarks get the same layout like the
+entries to the list of figure. This would be the easiest solution. A more
+explicit would be, e.\,g.,
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\l@remarkbox}{\@dottedtocline{1}{1em}{1.5em}}
+\end{lstcode}
+
+Additionally\textnote{chapter entry} you may want structure the list of
+remarks depending on chapters.
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \setuptoc{lor}{chapteratlist}
+\end{lstcode}
+The \KOMAScript{} classes provide that feature and may other classes do so
+too. Unfortunately the standard classes do not.
+
+This\textnote{list of remarks} would already be enough. Now, users may already
+select different kinds of headings either using the corresponding options of
+the \KOMAScript{} classes, or \Macro{setuptoc}, e.\,g., with or without entry
+in the table of contents, with or without number. But a simply
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\listofremarkboxes}{\listoftoc{lor}}
+\end{lstcode}
+may make the usage a little bit easier again.
+
+As you've seen only five commands refers to the list of remarks. Only three of
+them are necessary. Nevertheless the new list of remarks already provides
+optional numbering of the heading and optional not numbered entry into the
+table of contents. Optional even a lower document structure level may be used
+for the heading. Running headers are provides with the \KOMAScript{} classes,
+the standard classes, and all classes that explicitly support
+\Package{tocbasic}. Supporting classes even pay attention to this new list of
+remarks at every new \Macro{chapter}. Even changes of the current language are
+handled inside the list of remarks like they will inside the list of figures
+or inside the list of tables.
+
+Moreover.\textnote{additional features} an author of a package may add more
+features. For example, options to hide \Macro{setuptoc} from the users may be
+added. On the other hand, the \Package{tocbasic} manual may be referenced to
+describe the corresponding features. The advantage of this would be that user
+would get information about new features provides by \Package{tocbasic}. But
+if the user should be able to set the features of the remarks even without
+knowledge about the file extension \File{lor} a simple
+\begin{lstcode}[belowskip=\dp\strutbox plus 1pt]
+ \newcommand*{\setupremarkboxes}{\setuptoc{lor}}
+\end{lstcode}
+would be enough to use a list of features argument to
+\Macro{setupremarkboxes} as list of features of file extension \File{lor}.
+
+\section{Everything with One Command Only}
+\label{sec:tocbasic.highlevel}
+
+The example from the previous section shows, that using \Package{tocbasic} to
+define floating environments and lists with the captions of those floating
+environments is easy. The following example will show, that is may be even
+easier.
+
+\begin{Declaration}
+ \Macro{DeclareNewTOC}\OParameter{options}\Parameter{extension}
+\end{Declaration}
+\BeginIndex{Cmd}{DeclareNewTOC}%
+This command
+declares\ChangedAt{v3.06}{\Package{tocbasic}} in one step only a new list of
+something, the heading of that list, the term used for the entries to the
+list, and to manage the file name \PName{extension}. Additionally optional
+floating and non-floating environments may be defined, and inside of both such
+environments \Macro{caption}\important{\Macro{caption}}\IndexCmd{caption} may
+be used. The additional features \Macro{captionabove}\important[i]{%
+ \Macro{captionabove}\\
+ \Macro{captionbelow}}, \Macro{captionbelow}, and \Environment{captionbeside}
+of the \KOMAScript{} classes
+(see \autoref{sec:maincls.floats})
+may also be used inside of those environments.
+
+Argument \PName{extension} is the file name extension of the helper file, that
+represents the list of something. See \autoref{sec:tocbasic.basics} for more
+information about this. This argument is mandatory and must not be empty!
+
+Argument \PName{options} is a comma separated list, like you know it from,
+e.\,g., \Macro{KOMAoptions}%
+\ (see \autoref{sec:typearea.options})%^^A
+. Nevertheless\textnote{Attention!}, those options cannot be set using
+\Macro{KOMAoptions}\IndexCmd{KOMAoptions}! An overview of all available
+options
+may be found in \autoref{tab:tocbasic.DeclareNewTOC-options}.
+
+\begin{desclist}
+ \renewcommand*{\abovecaptionskipcorrection}{-\normalbaselineskip}%
+ \desccaption[{Options for command \Macro{DeclareNewTOC}}]{%
+ Options for command
+ \Macro{DeclareNewTOC}\ChangedAt{v3.06}{\Package{tocbasic}}%
+ \label{tab:tocbasic.DeclareNewTOC-options}%
+ }{%
+ Options for command \Macro{DeclareNewTOC} (continuation)%
+ }%
+ \entry{\KOption{atbegin}\PName{instructions}}{%
+ The \PName{instructions} will be executed at the begin of the floating or
+ non-floating environment.%
+ }%
+ \entry{\KOption{atend}\PName{instructions}}{%
+ The \PName{instructions} will be executed at the end of the floating or
+ non-floating environment.%
+ }%
+ \entry{\KOption{counterwithin}\PName{\LaTeX{} counter}}{%
+ If you define a float or non-float, the captions will be numbered and a
+ counter \PName{type} (see option \Option{type}) will be defined. You may
+ declare another counter to be the parent \LaTeX{} 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} or \Macro{refstepcounter}.%
+ }%
+ \entry{\Option{float}}{%
+ 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 addendum ``\PValue{*}''.%
+ }%
+ \entry{\KOption{floatpos}\PName{float positions}}{%
+ 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.%
+ }%
+ \entry{\KOption{floattype}\PName{number}}{%
+ The numerical 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.%
+ }%
+ \entry{\Option{forcenames}}{%
+ If set, the names will be even defined, if they where already defined
+ before.%
+ }%
+ \entry{\KOption{hang}\PName{length}}{%
+ 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.%
+ }%
+ \entry{\KOption{indent}\PName{length}}{%
+ 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.%
+ }%
+ \entry{\KOption{level}\PName{number}}{%
+ 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.%
+ }%
+ \entry{\KOption{listname}\PName{string}}{%
+ 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.%
+ }%
+ \entry{\KOption{name}\PName{string}}{%
+ The name of an element. If no name is given, the value of \PValue{type}
+ with upper case first char will be used.%
+ }%
+ \entry{\Option{nonfloat}}{%
+ If set, a non floating environment will be defined. The name of the
+ environment is the value of \PName{type} with postfix ``\PValue{-}''.%
+ }%
+ \entry{\KOption{owner}\PName{string}}{%
+ The owner as described in the sections before. If no owner was given owner
+ \PValue{float} will be used.%
+ }%
+ \entry{\KOption{type}\PName{string}}{%
+ 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.%
+ }%
+ \entry{\KOption{types}\PName{string}}{%
+ the plural of the type. If no plural was given the value of \PValue{type}
+ with addendum ``s'' will be used.%
+ }%
+\end{desclist}
+
+\begin{Example}
+ Using \Macro{DeclareNewTOC} reduces the example from
+ \autoref{sec:tocbasic.example} to:
+\begin{lstcode}
+ \DeclareNewTOC[%
+ type=remarkbox,%
+ types=remarkboxes,%
+ float,% define a floating environment
+ floattype=4,%
+ name=Remark,%
+ listname={List of Remarks}%
+ ]{lor}
+ \setuptoc{lor}{chapteratlist}
+\end{lstcode}
+ Beside environments \Environment{remarkbox} and \Environment{remarkbox*} the
+ counter
+\Counter
+ {remarkbox}, the commands \Macro{theremarkbox},
+ \Macro{remarkboxname}, and \Macro{remarkboxformat} that are used for
+ captions; the commands \Macro{listremarkboxnames} and
+ \Macro{listofremarkboxes} that are used at the list of remarks; and some
+ internal commands that depends on the file name extension \File{lor} are
+ defined. If the package should use a default for the floating type, option
+ Option{floattype} may be omitted. If option \Option{nonfloat} will be used
+ 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.
+\end{Example}
+\EndIndex{Cmd}{DeclareNewTOC}%
+\EndIndex{Package}{tocbasic}%
+\EndIndex{}{table of contents}%
+\EndIndex{}{list>of contents}%
+\EndIndex{}{file>extension}%
\endinput
%%
%% End of file `tocbasic.tex'.