diff options
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrkernel-index.dtx')
-rw-r--r-- | macros/latex/contrib/koma-script/source/scrkernel-index.dtx | 379 |
1 files changed, 155 insertions, 224 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrkernel-index.dtx b/macros/latex/contrib/koma-script/source/scrkernel-index.dtx index a58dcf853d..34972167b6 100644 --- a/macros/latex/contrib/koma-script/source/scrkernel-index.dtx +++ b/macros/latex/contrib/koma-script/source/scrkernel-index.dtx @@ -1,8 +1,7 @@ -% \CheckSum{242} % \iffalse meta-comment % ====================================================================== % scrkernel-index.dtx -% Copyright (c) Markus Kohm, 2002-2019 +% Copyright (c) Markus Kohm, 2002-2022 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -18,54 +17,17 @@ % The Current Maintainer and author of this work is Markus Kohm. % % This work consists of all files listed in manifest.txt. -% ---------------------------------------------------------------------- -% scrkernel-index.dtx -% Copyright (c) Markus Kohm, 2002-2019 -% -% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz, -% Version 1.3c, verteilt und/oder veraendert werden. -% Die neuste Version dieser Lizenz ist -% http://www.latex-project.org/lppl.txt -% und Version 1.3c ist Teil aller Verteilungen von LaTeX -% Version 2005/12/01 oder spaeter und dieses Werks. -% -% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained" -% (allein durch den Autor verwaltet). -% -% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm. -% -% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== -% \fi -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% -% \iffalse -%%% From File: $Id: scrkernel-index.dtx 3262 2019-10-10 08:25:29Z kohm $ +%%% From File: $Id: scrkernel-index.dtx 3706 2022-02-15 09:36:50Z kohm $ %<option>%%% (run: option) %<body>%%% (run: body) %<*dtx> -% \fi \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \begingroup \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} - \filedate$Date: 2019-10-10 10:25:29 +0200 (Thu, 10 Oct 2019) $ + \filedate$Date: 2022-02-15 10:36:50 +0100 (Di, 15. Feb 2022) $ \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} - \filerevision$Revision: 1872 $ + \filerevision$Revision: 3706 $ \edef\reserved@a{% \noexpand\endgroup \noexpand\ProvidesFile{scrkernel-index.dtx}% @@ -74,60 +36,94 @@ (index)]% }% \reserved@a -% \iffalse -\documentclass[parskip=half-]{scrdoc} -\usepackage[english,ngerman]{babel} -\CodelineIndex -\RecordChanges -\GetFileInfo{scrkernel-index.dtx} -\title{\KOMAScript{} \partname\ \texttt{\filename}% - \footnote{Dies ist Version \fileversion\ von Datei \texttt{\filename}.}} -\date{\filedate} -\author{Markus Kohm} - +\documentclass[USenglish]{koma-script-source-doc} +\usepackage{babel} +\setcounter{StandardModuleDepth}{2} \begin{document} - \maketitle - \tableofcontents - \DocInput{\filename} +\DocInput{scrkernel-index.dtx} \end{document} %</dtx> % \fi % -% \selectlanguage{ngerman} -% -% \changes{v2.95}{2002/07/01}{% -% erste Version aus der Aufteilung von \texttt{scrclass.dtx}} -% -% \section{Index} -% -% Der Index unterscheidet sich bei \KOMAScript{} scheinbar nicht -% wesentlich von dem, was die Standardklassen zu bieten haben. In -% Wirklichkeit sind die Unterschiede jedoch erheblich. +% \changes{v2.95}{2002/07/01}{new by splitting \file{scrclass.dtx}} +% \changes{v3.36}{2022/02/15}{switch over from \cls*{scrdoc} to +% \cls*{koma-script-source-doc}} +% \changes{v3.36}{2022/02/15}{whole implementation documentation in English} +% +% \GetFileInfo{scrkernel-index.dtx} +% \title{Index Code of the +% \href{https://komascript.de}{\KOMAScript} Classes} +% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}} +% \date{Revision \fileversion{} of \filedate} +% \maketitle +% \begin{abstract} +% The index code of the \KOMAScript{} classes in \file{scrkernel-index.dtx} +% is somehow different from the code of the standard classes. It provides +% several options and other configuration possibilities. +% \end{abstract} +% \tableofcontents +% +% \section{User Manual} +% +% You can find the user documentation the commands implemented here in the +% \KOMAScript{} manual, either the German \file{scrguide} or the English +% \file{scrguien}. +% +% \MaybeStop{\PrintIndex} % -% Briefe haben keinen Index. +% \section{Implementation of the Index} % -% \StopEventually{\PrintIndex\PrintChanges} +% The letter class \cls*{scrlttr2} does not provide an index. All other +% classes do. % -% \iffalse +% \begin{macrocode} %<*!letter> -% \fi -% -% \iffalse -%<*option> -% \fi +% \end{macrocode} % -% \subsection{Anweisungen und Einstellungen für die Optionen} % -% Einige Anweisungen und Einstellungen werden bereits benötigt, bevor die -% Optionen abgearbeitet werden. +% \subsection{Options} % +% \begin{option}{index} +% \changes{v2.98c}{2008/03/04}{added} +% \changes{v3.17}{2015/03/12}{internal value storage} +% \changes{v3.18}{2015/06/15}{new value \opt{numbered}} +% \changes{v3.18}{2015/06/15}{new value \opt{leveldown}} +% \changes{v3.18}{2015/06/15}{new value \opt{standardlevel}} +% \changes{v2.7a}{2001/01/04}{improved link generation with \cls*{scrbook} or +% \cls*{scrreprt} and \pkg{hyperref}} +% \changes{v2.98c}{2008/03/04}{redefining \cs{idx@@heading} instead of +% \cs{idx@@heading}} +% \changes{v3.18}{2015/06/15}{new value \opt{leveldown}} +% The option allow several values for several features: +% \begin{labeling}{\opt{=standardlevel}:} +% \item[\opt{=default}:] use not numbered heading without ToC entry, but +% without affecting the heading level; +% \item[\opt{=totoc}:] use not numbered heading with ToC entry, but +% without affecting the heading level; +% \item[\opt{=numbered}:] use numbered heading (with ToC entry), but +% without affecting the heading level; +% \item[\opt{=leveldown}:] use a subheading (e.g. \cs{subsection} instead +% of \cs{section} in \cls*{scrartcl}), without affecting numbered or not and +% ToC entry or not; +% \item[\opt{=standardlevel}:] don't use a subheading, without affecting +% numbered or not and ToC entry or not. +% \end{labeling} +% To do so, the option redefines \cs{idx@heading}. % \begin{macro}{\idx@@heading} -% \changes{v2.98c}{2008/03/04}{neu (intern)}%^^A -% \changes{v3.18}{2015/06/15}{Beachtung von \texttt{leveldown}}%^^A -% Diese Anweisung wird verwendet, um nur die Überschrift zu setzen (nichts -% weiter!). Sie hat genau ein Argument, nämlich den Text der Überschrift und -% wird innerhalb von |\idx@heading| verwendet. +% \changes{v2.98c}{2008/03/04}{added} +% \changes{v3.18}{2015/06/15}{using \opt{leveldown}} +% This is the macro to print the heading of the index (nothing else). It has +% one mandatory argument: the text to be used as heading. There will be one +% additional code level above this: \cs{idx@heading}, that will be defined in +% the \texttt{body} run. \cs{idx@heading} has to be defined before, so it can +% be redefined by the \opt{index} option. In opposite to the standard classes +% we want to use \cs{chapter} in two column mode. This can be done, because of +% significant changes of \cs{chapter} definition. Note: If someone uses the +% standard classes hack of package \pkg*{scrhack} or even another headings +% package like \pkg*{titlesec} this could fail. But this is not my problem, +% because usage of such packages and hacks is not recommended at all. % \begin{macrocode} +%<*option> \newcommand*{\idx@@heading}{% \ifidx@leveldown %<article> \expandafter\subsection @@ -138,46 +134,10 @@ \fi*% } % \end{macrocode} -% \end{macro} -% -% -% \subsection{Optionen für den Index} -% -% \begin{option}{index} -% \changes{v2.98c}{2008/03/04}{Neue Option}%^^A -% \changes{v3.17}{2015/03/12}{interne Speicherung der Werte}%^^A -% \changes{v3.18}{2015/06/15}{neuer Wert \texttt{numbered}}%^^A -% \changes{v3.18}{2015/06/15}{neuer Wert \texttt{leveldown}}%^^A -% \changes{v3.18}{2015/06/15}{neuer Wert \texttt{standardlevel}}%^^A -% \begin{macro}{\idx@@heading} -% Die Option sorgt dafür, dass der Index auch im Inhaltsverzeichnis -% erscheint. Dazu wird das interne Makro \cs{idx@@heading} umdefiniert, über -% das die Überschrift gesetzt und der Kolumnentitel angepasst wird. -% \changes{v2.4c}{1996/04/04}{Kolumnentitel werden nun korrekt -% behandelt}%^^A -% \changes{v2.4g}{1996/11/04}{Index auch bei \textsf{scrartcl}%^^A -% wieder zweispaltig} -% \changes{v2.6c}{2000/06/10}{im Index kann nach der Überschrift -% eine Präambel gesetzt werden}%^^A -% \changes{v2.7a}{2001/01/04}{für \textsf{scrbook} und -% \textsf{scrreprt} die Link-Erzeugung mit \texttt{hyperref} -% verbessert} -% \changes{v2.7j}{2001/05/27}{Setzen der Präambel in die -% \texttt{theindex}-Umgebung verschoben} -% \changes{v2.9l}{2003/01/19}{\cs{if@twoside} durch -% \cs{if@openright} ersetzt} -% \changes{v2.98c}{2008/03/04}{statt \cs{idx@heading} wird nun -% \cs{idx@@heading} umdefiniert} -% \changes{v3.18}{2015/06/15}{Beachtung von \texttt{leveldown}}%^^A -% An dieser Stelle muss dafür gesorgt werden, dass im Falle von -% \textsf{scrbook} und \textsf{scrreprt} das Makro \cs{@schapter} -% verwendet wird. Damit dies hier möglich ist mussten tiefreifendere -% Änderungen am \LaTeX-Kernel bzw. am Gliederungsbefehl \cs{chapter} -% vorgenommen werden. -% \begin{macro}{\ifidx@leveldown} -% \changes{v3.18}{2015/06/15}{neuer Schalter (intern)}%^^A -% Für den ab Version~3.18neuen Wert \texttt{leveldown} und dessen -% Gegenstück \texttt{standardlevel} wird außerdem ein Schalter benötigt. +% \begin{macro}{\idx@leveldowntrue,\idx@leveldownfalse,\ifidx@leveldown} +% \changes{v3.18}{2015/06/15}{added} +% The boolean switch \cs{ididx@leveldown} is needed to distinguish the heading +% level to be used (option values \opt{leveldown} and \opt{standardlevel}). % \begin{macrocode} \newif\ifidx@leveldown \KOMA@key{index}{% @@ -261,86 +221,59 @@ \KOMA@kav@add{.\KOMAClassFileName}{index}{notoc} \KOMA@kav@add{.\KOMAClassFileName}{index}{standardlevel} % \end{macrocode} -% \end{macro} -% \end{macro} -% \end{option} +% \end{macro}^^A \ifidx@leveldown … +% \end{macro}^^A \idx@@heading +% \end{option}^^A index % % \begin{option}{idxtotoc} -% \changes{v2.3h}{1995/01/21}{neue Option}%^^A -% \changes{v2.98c}{2008/03/04}{obsolete}%^^A -% \changes{v3.01a}{2008/11/20}{deprecated}%^^A +% \changes{v2.3h}{1995/01/21}{new} +% \changes{v2.98c}{2008/03/04}{obsolete} +% \changes{v3.01a}{2008/11/20}{deprecated} % \begin{macrocode} \KOMA@DeclareDeprecatedOption{idxtotoc}{index=totoc} +%</option> % \end{macrocode} % \end{option} % % -% \iffalse -%</option> -%<*body> -% \fi -% -% \subsection{Definitionen für den Index} +% \subsection{User commands and macros} % +% \begin{command}{\setindexpreamble} +% \changes{v2.6c}{2000/06/10}{added} +% \changes{v2.6d}{2000/07/20}{\cs{let} replaced by \cs{newcommand*}} +% \changes{v2.95}{2002/07/01}{\cs{let} and \cs{def}} % \begin{macro}{\index@preamble} -% \changes{v2.6c}{2000/06/10}{neu (intern)}%^^A -% \begin{macro}{\setindexpreamble} -% \changes{v2.6c}{2000/06/10}{neu}%^^A -% \changes{v2.6d}{2000/07/20}{Befehl funktioniert nachdem \cs{let}%^^A -% durch \cs{newcommand*} ersetzt wurde} -% \changes{v2.95}{2002/07/01}{\cs{let} und \cs{def}} -% Analog zu \cs{bibpreamble} kann \cs{index@preamble} vom Benutzer mit -% \cs{setindexpreamble} auf einen Text gesetzt werden, der nach der -% Indexüberschrift eingefügt wird. Hier wird ein echtes internes Makro -% verwendet, da nicht auf Kompatibilität geachtet werden muss. +% \changes{v2.6c}{2000/06/10}{added} +% The index preamble is placed between the heading an the index itself. The +% user can define it using \cs{setindexpreamble}. \cs{index@preamble} is the +% storage. Note: \cs{setindexpreamble} does read the argument itself. This +% makes it easier to patch the user level command. But because of this it has +% to long. % \begin{macrocode} +%<*body> \newcommand*{\index@preamble}{} \let\index@preamble=\relax \newcommand{\setindexpreamble}[1]{\def\index@preamble{#1}} % \end{macrocode} % \end{macro} -% \end{macro} +% \end{command} % % \begin{macro}{\idx@heading} -% \changes{v2.3h}{1995/01/21}{neu (intern)}%^^A -% \changes{v2.4c}{1995/04/04}{Kolumnentitel werden nun korrekt behandelt}%^^A -% \changes{v2.4g}{1996/11/04}{Index auch bei \texttt{scrartcl} wieder -% zweispaltig}%^^A -% \changes{v2.6c}{2000/06/10}{Verwendung von \cs{index@preamble} eingefügt}%^^A -% \changes{v2.7j}{2001/05/27}{Setzen der Präambel in die -% \texttt{theindex}-Umgebung verschoben}%^^A -% \changes{v2.9l}{2003/01/19}{\cs{if@twoside} durch \cs{if@openright} -% ersetzt}%^^A -% \changes{v2.98c}{2008/03/04}{Verwendung von \cs{idx@@heading}}%^^A -% \changes{v3.10}{2011/08/31}{\cs{MakeMarkcase} wird beachtet}%^^A -% \changes{v3.10a}{2012/03/08}{Falsche Klammerung der letzten Änderung -% behoben}%^^A -% \changes{v3.12}{2013/09/24}{Index wird nie in andere Verzeichnisse -% eingetragen (außer Inhaltsverzeichnis)}%^^A -% \changes{v3.25}{2017/10/13}{\cs{@mkright} und \cs{@mkdouble} verwenden}%^^A -% Befehl zum Setzen der Überschrift des Indexes. Bis Version 2.7a sah diese -% Definition so aus: -% \begin{verbatim} -% \newcommand*{\idx@heading}{% -% \if@twoside\cleardoublepage\else\clearpage\fi% -% \@mkboth{\indexname}{\indexname}% -% \twocolumn[% -% %<article> \section*% -% %<report|book> \@makeschapterhead% -% {\indexname}\index@preamble] -% } -% \end{verbatim}\vspace{-\baselineskip} -% Dagegen ist grundsätzlich nichts zu sagen. Allerdings gibt es seit -% Version 2.7b die neue Methode der Kapitel-Präambel, die extra -% eingeführt wurde, um die \textsf{hyperref}-Links -- insbesondere -% den des Index -- zumindest bei Verwendung von \texttt{hpdftex.def} -% zu verbessern. Deshalb wurde die Implementierung entsprechend -% abgeändert. Außerdem wurde das Setzen der Präambel aus -% Konsistenzgründen in Version 2.7j übereinstimmten mit der -% \texttt{thebibliography}-Umgebung in die \texttt{theindex}-Umgebung -% verschoben. +% \changes{v2.3h}{1995/01/21}{added} +% \changes{v2.4c}{1996/04/04}{handling of running heads fixed} +% \changes{v2.4g}{1996/11/04}{two-columned index with \cls*{scrartcl} fixed} +% \changes{v2.6c}{2000/06/10}{support for index preamble after heading} +% \changes{v2.7j}{2001/05/27}{output of preamble moved to \env{theindex}} +% \changes{v2.9l}{2003/01/19}{\cs{if@twoside} replaced by \cs{if@openright}} +% \changes{v2.98c}{2008/03/04}{using \cs{idx@@heading}} +% \changes{v3.10}{2011/08/31}{using \cs{MakeMarkcase}} +% \changes{v3.10a}{2012/03/08}{brackets from previous change fixed} +% \changes{v3.12}{2013/09/24}{never make an index entry to the other ToC but +% the table of contents} +% \changes{v3.25}{2017/10/13}{using \cs{@mkright} and \cs{@mkdouble}} % \changes{v3.26}{2018/09/03}{usage of \cs{addsecmark} or \cs{subsectionmark} -% instead of \cs{@mkright}}%^^A +% instead of \cs{@mkright}} +% Macro to make the index heading and preamble. % \begin{macrocode} \newcommand*{\idx@heading}{% %<report|book> \if@openright\cleardoublepage\else\clearpage\fi% @@ -363,13 +296,13 @@ % \end{macro} % % \begin{environment}{theindex} -% \changes{v2.8d}{2001/07/05}{\cs{indexpagestyle} statt -% \texttt{plain}} -% \changes{v2.3h}{1995/01/21}{Verwendung von \cs{idx@heading}} -% \changes{v2.7j}{2001/05/27}{Setzen der Präambel in die -% \texttt{theindex}-Umgebung verschoben} -% \changes{v3.19}{2015/08/25}{Seitenstil nur ändern wenn nicht leer}%^^A -% Der Index ist wie üblich definiert. +% \changes{v2.8d}{2001/07/05}{\cs{indexpagestyle} instead of \pstyle{plain}} +% \changes{v2.3h}{1995/01/21}{using \cs{idx@heading}} +% \changes{v2.7j}{2001/05/27}{output of preamble added} +% \changes{v3.19}{2015/08/25}{using \cs{indexpagestyle} only if not empty} +% This definition is similar to the definition of the standard classes. As +% addition it supports a preamble text, a variable heading, and resets the +% paragraph end line fill. % \begin{macrocode} \newenvironment{theindex}{% \if@twocolumn @@ -380,7 +313,7 @@ \columnseprule \z@ \columnsep 35\p@ %<book|report> \setchapterpreamble{\index@preamble}% - \idx@heading% + \idx@heading %<article> \index@preamble\par\nobreak \ifx\indexpagestyle\@empty\else\thispagestyle{\indexpagestyle}\fi \parindent\z@ @@ -392,16 +325,12 @@ } % \end{macrocode} % \begin{macro}{\@idxitem} -% Hier haben wird den Anfang eines Eintrags in den Index -% \begin{macro}{\subitem} -% \changes{v2.3g}{1996/01/14}{Verwendung von \cs{@idxitem} spart -% Speicher} -% \begin{macro}{\subsubitem} -% \changes{v2.3g}{1996/01/14}{Verwendung von \cs{@idxitem} spart -% Speicher} -% \begin{macro}{\indexspace} -% und ebenso Unter- und Unteruntereinträge sowie ein vertikaler -% Abstand. +% A new index entry +% \begin{command}{\subitem,\subsubitem} +% \changes{v2.3g}{1996/01/14}{using \cs{@idxitem} saves memory} +% sub-entry, sub-sub-entry, +% \begin{command}{\indexspace} +% or (vertical) distance. % \begin{macrocode} \newcommand*\@idxitem{\par\hangindent 40\p@} % \begin{macrocode} @@ -411,38 +340,40 @@ \par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax } % \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{environment} +% \end{command}^^A \indexspace +% \end{command}^^A \subitem,\subsubitem +% \end{macro}^^A \@idxitem +% \end{environment}^^A theindex % % -% \subsection{Standardbezeichner} +% \subsection{Language dependent terms} % -% \begin{macro}{\indexname} -% Names des Index: +% \begin{command}{\indexname} +% \changes{v3.36}{2022/02/15}{explicit definition for English languages} +% The name of the index (used by \cs{idx@heading}). % \begin{macrocode} \newcommand*\indexname{Index} +\providecaptionname{american,australian,british,canadian,english,newzealand,% + UKenglish,ukenglish,USenglish,usenglish}\indexname{Index} +%</body> % \end{macrocode} -% \end{macro} +% \end{command} % % -% \iffalse -%</body> -% \fi -% -% \iffalse +% \begin{macrocode} %</!letter> -% \fi -% +% \end{macrocode} % % \Finale -% +% \PrintChanges +% \endinput -% -% end of file `scrkernel-index.dtx' -%%% Local Variables: -%%% mode: doctex -%%% TeX-master: t -%%% End: +% Local Variables: +% mode: doctex +% ispell-local-dictionary: "en_US" +% eval: (flyspell-mode 1) +% TeX-master: t +% TeX-engine: luatex-dev +% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx")) +% End: + |