summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-01-29 22:32:58 +0000
committerKarl Berry <karl@freefriends.org>2017-01-29 22:32:58 +0000
commite02235dda0e68d2131b9cf111af5448fa125ad58 (patch)
tree37ea12425820b8b346764911b170eefcc0a68b44 /Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls
parent687ffbc778abf7b367ab1c6ed91c016e8138c2ad (diff)
koma-script (29jan17)
git-svn-id: svn://tug.org/texlive/trunk@43084 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls')
-rw-r--r--Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls969
1 files changed, 793 insertions, 176 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls b/Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls
index 5d16433a2c8..51375c5674a 100644
--- a/Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls
+++ b/Master/texmf-dist/source/latex/koma-script/doc/scrguide.cls
@@ -38,7 +38,7 @@
% \section{Identification}
%
% \begin{macrocode}
-\ProvidesClass{scrguide}[2016/04/05 v1.11 internal KOMA-Script guide class]
+\ProvidesClass{scrguide}[2016/11/26 v1.13 internal KOMA-Script guide class]
% \end{macrocode}
%
%
@@ -145,7 +145,8 @@
\RequirePackage{multicol}
\RequirePackage{marginnote}
\RequirePackage{tabularx}
-\RequirePackage{xcolor,tocstyle}% hyperref needs xcolor with tocstyle
+\RequirePackage[svgnames]{xcolor}
+\RequirePackage{tocstyle}% hyperref needs xcolor with tocstyle
\RequirePackage{tikz}
\usetikzlibrary{calc}
\RequirePackage[\uselanguage]{hyperref}
@@ -191,25 +192,35 @@
\geometry{papersize={180mm,210mm},%
includehead,includemp,reversemp,marginparwidth=4em,%
vmargin={1.5mm,3mm},hmargin=1.75mm}%
- \RequirePackage{xcolor}%
\RequirePackage{scrlayer-scrpage}%
\clearpairofpagestyles
- \ohead{\smash{%
- \rule[-\dp\strutbox]{0pt}{\headheight}\headmark\hspace{2mm}}%
+ \ihead{%
+ \smash{%
+ \hspace*{.5em}\rule[-\dp\strutbox]{0pt}{\headheight}\headmark
+ }%
}%
- \ihead[{\smash{\colorbox{yellow!50}{%
- \makebox[\dimexpr\linewidth-2\fboxsep\relax][l]{%
- \rule[-\dp\strutbox]{0pt}{\headheight}%
- \makebox[2em][r]\pagemark}}}}]%
- {\smash{\colorbox{yellow!50}{%
- \makebox[\dimexpr\linewidth-2\fboxsep\relax][l]{%
- \rule[-\dp\strutbox]{0pt}{\headheight}%
- \makebox[2em][r]\pagemark}}}}%
- \setkomafont{pageheadfoot}{\normalfont\sffamily}%
+ \ohead*{\smash{\pagemark\hspace{2mm}}}%
+ \colorlet{headbackground}{DarkBlue}%
+ \colorlet{headline}{white}%
+ \setkomafont{pageheadfoot}{\small\sffamily\bfseries\color{headline}}%
\setkomafont{pagenumber}{}%
+ \DeclareNewLayer[head,background,
+ hoffset=0pt,
+ width=\paperwidth,
+ addheight=\dimexpr \topmargin+1in+\dp\strutbox\relax,
+ addvoffset=2\dp\strutbox,
+ contents={%
+ \color{headbackground}\rule{\layerwidth}{\layerheight}}]
+ {headbackground}%
+ \AddLayersAtBeginOfPageStyle{scrheadings}{headbackground}%
\renewcommand*{\chaptermark}[1]{%
- \markboth\chaptermarkformat\chaptermarkformat}%
- \renewcommand*{\chaptermarkformat}{\chapapp~\thechapter\autodot}%
+ \@mkdouble{\ifnumbered{chapter}{\chaptermarkformat}{}##1}%
+ }%
+ \renewcommand*{\chaptermarkformat}{%
+ \makebox[\dimexpr \oddsidemargin+1in-.5em][r]{%
+ \chapapp~\thechapter:~%
+ }%
+ }%
\renewcommand*{\chapterformat}{}%
\renewcommand*{\chapterpagestyle}{scrheadings}%
\setlength{\@tempdimc}{\oddsidemargin}%
@@ -246,30 +257,76 @@
% \section{Load common paragraphs}
%
% \begin{macrocode}
-\newcounter{commonpar}
-\newcommand*{\LoadCommon}[2][\label@base]{%
- \setcounter{commonpar}{#2}%
- \@ifundefined{ifCommon#1}{%
- \expandafter\csname newif\expandafter\endcsname
- \csname ifCommon#1\endcsname
- }{}%
- \csname Common#1true\endcsname
- \input{common-#2.tex}%
- \csname Common#1false\endcsname
+\newcommand*{\ThisCommonFile}{}%
+\newcommand*{\ThisCommonLabelBase}{}
+\newcommand*{\IfThisCommonLabelBase}[1]{%
+ \expandafter\ifstr\expandafter{\ThisCommonLabelBase}{#1}%
+ \@firstoftwo\@secondoftwo
+}
+\newcommand*{\IfThisCommonLabelBaseOneOf}[1]{%
+ \begingroup
+ \@tempswafalse
+ \@for \reserved@a:=#1\do{%
+ \expandafter\IfThisCommonLabelBase\expandafter{\reserved@a}%
+ {\@tempswatrue}{}%
+ }%
+ \if@tempswa
+ \aftergroup\@firstoftwo
+ \else
+ \aftergroup\@secondoftwo
+ \fi
+ \endgroup
+}
+\newcommand*{\IfThisCommonLabelBaseNotOneOf}[1]{%
+ \begingroup
+ \@tempswafalse
+ \@for \reserved@a:=#1\do{%
+ \expandafter\IfThisCommonLabelBase\expandafter{\reserved@a}%
+ {\@tempswatrue}{}%
+ }%
+ \if@tempswa
+ \aftergroup\@secondoftwo
+ \else
+ \aftergroup\@firstoftwo
+ \fi
+ \endgroup
}
-\newcommand*{\IfCommon}[1]{%
- \ifstr{\label@base}{#1}{%
- \@firstofone
+\newcommand*{\ThisCommonFirstLabelBase}{%
+ \@nameuse{CommonFile@\ThisCommonFile @LabelBase}%
+}
+\newif\ifthiscommonfirst
+\newcommand*{\IfThisCommonFirstRun}{%
+ \ifthiscommonfirst \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo \fi
+}
+\newcommand*{\LoadCommonFile}[1]{%
+ \ifstr{\ThisCommonFile}{}{%
+ \def\ThisCommonFile{#1}%
+ \let\ThisCommonLabelBase\label@base
+ \@ifundefined{CommonFile@\ThisCommonFile @LabelBase}{%
+ \expandafter\let\csname CommonFile@\ThisCommonFile @LabelBase\endcsname
+ \ThisCommonLabelBase
+ \thiscommonfirsttrue
+ }{\thiscommonfirstfalse}%
+ \input{common-\ThisCommonFile.tex}%
+ \thiscommonfirstfalse
+ \let\ThisCommonLabelBase\@empty
+ \let\ThisCommonFile\@empty
}{%
- \@gobble
+ \ClassError{scrguide}{recursive \string\LoadCommon}{%
+ You can not use \string\LoadCommon\space inside another
+ common file.%
+ }%
}%
}
-\newcommand*{\IfNotCommon}[1]{%
- \ifstr{\label@base}{#1}{%
- \@gobble
+\newcommand*{\InternalCommonFileUsageError}{%
+ \GenericError{%
+ (common-\ThisCommonFile.tex)\@spaces
}{%
- \@firstofone
- }%
+ Common File common-\ThisCommonFile.tex Error: Unprepared usage%
+ }{%
+ You have to prepare the file for the label base \ThisCommonLabelBase.%
+ }{}%
}
% \end{macrocode}
%
@@ -542,6 +599,47 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\DeclareSpecialMarkup}
+% Command to declare special markup commands, that behave different in- and
+% outside |Description| environment. Parameters are:
+% \begin{declaration}
+% \item[\arg{command}:] The the markup command, that should be defined.
+% \item[\arg{outside definition}:] Definition of the markup command
+% outside |Description| environment.
+% \item[\arg{inside definition}:] Definition of the markup command inside
+% |Description| environment.
+% \item{\oarg{inside end definition}:] Definition of the \cs{end} command,
+% if inside |Description| an markup environment instead of an markup
+% command would be used.
+% \end{declaration}
+% At the end color \meta{command name} will be black and \cs{\meta{command
+% name}}, \cs{text\meta{command name}, \cs{Desc\meta{command name}}, and
+% optionally \cs{endDesc\meta{command name} will be defined, with
+% \cs{\meta{command name}} is \meta{command}.
+% \begin{macrocode}
+\newcommand\DeclareSpecialMarkup[3]{%
+ \newcommand*#1{}%
+ \expandafter\colorlet\expandafter{\expandafter\@gobble\string#1}{black}%
+ \expandafter\newcommand\expandafter*%
+ \csname text\expandafter\@gobble\string #1\endcsname[1]{#2}%
+ \expandafter\DeclareRobustCommand\expandafter*\expandafter#1\expandafter{%
+ \csname text\expandafter\@gobble\string #1\endcsname}%
+ \expandafter\newcommand\expandafter*%
+ \csname Desc\expandafter\@gobble\string #1\endcsname[1]{#3}%
+ \kernel@ifnextchar [%
+ {\expandafter\@optdef
+ \csname endDesc\expandafter\@gobble\string #1\endcsname}%
+ {}%]
+}
+% \end{macrocode}
+% \begin{macro}{\@optdef}
+% Helper to define a macro via optional instead of mandatory argument
+\newcommand*{\@optdef}{}
+\long\def\@optdef#1[#2]{\def#1{#2}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\Macro}
% \begin{macro}{\Option}
% \begin{macro}{\KOption}
@@ -551,7 +649,7 @@
% \begin{macro}{\Length}
% \begin{macro}{\PLength}
% \begin{macro}{\FloatStyle}
-% \begin{macro}{\Pagestyle}
+% \begin{macro}{\PageStyle}
% \begin{macro}{\Variable}
% \begin{macro}{\FontElement}
% \begin{macro}{\PName}
@@ -581,31 +679,384 @@
% environment
% \end{description}
% \begin{macrocode}
-\DeclareRobustCommand*{\Macro}[1]{\mbox{\texttt{\char`\\#1}}}
-\DeclareRobustCommand*{\Option}[1]{\mbox{\texttt{#1}}}
-\DeclareRobustCommand*{\KOption}[1]{\mbox{\Option{#1}\texttt=}}
-\DeclareRobustCommand*{\OptionValue}[2]{\mbox{\texttt{#1=#2}}}
-\DeclareRobustCommand*{\FloatStyle}[1]{\mbox{\texttt{#1}}}
-\DeclareRobustCommand*{\Pagestyle}[1]{\mbox{\texttt{#1}}}
-\DeclareRobustCommand*{\Environment}[1]{\mbox{\texttt{#1}}}
-\DeclareRobustCommand*{\Counter}[1]{\mbox{\texttt{#1}}}
-\DeclareRobustCommand*{\Length}[1]{\mbox{\texttt{\char`\\#1}}}
-\DeclareRobustCommand*{\PLength}[1]{\mbox{\PValue{#1}}}
-\DeclareRobustCommand*{\Variable}[1]{\mbox{\PValue{#1}}}
-\DeclareRobustCommand*{\FontElement}[1]{\PValue{#1}}
+\newcommand*{\LabelMacro}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Macro{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.cmd.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.cmd.#2#1}%
+ \endgroup
+}
+\DeclareRobustCommand*{\DescRef}{%
+ \kernel@ifstar {\@DescRef*}{\@DescRef\@empty}%
+}
+\newcommand*{\@DescRef}[2]{\expandafter\ref#1{\label@desc@prefix#2}}
+\DeclareRobustCommand*{\DescPageRef}{%
+ \kernel@ifstar {\@DescPageRef*}{\@DescPageRef\space}%
+}
+\newcommand*{\@DescPageRef}[2]{\expandafter\autopageref#1{\label@desc@prefix#2}}
+\DeclareSpecialMarkup{\Macro}{\mbox{\texttt{\char`\\#1}}}{%
+ \par
+ \settowidth{\leftskip}{\textMacro{#1}}% indent from left
+ \hskip-\leftskip
+ \BeginIndex{Cmd}{#1}% index entry
+ \LabelMacro{#1}%
+ \textMacro{#1}%
+}
+\newcommand*{\LabelOption}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Option{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.option.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \expandafter\gdef
+ \csname \label@desc@prefix\label@base.option.#2#1\endcsname{}%
+ \label{\label@desc@prefix\label@base.option.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\Option}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Option}{#1}% index entry
+ \LabelOption{#1}%
+ \textOption{#1}%
+}
+\DeclareSpecialMarkup{\KOption}{\mbox{\textOption{#1=}}\linebreak[0]}{%
+ \ClassWarning{scrguide}{You should replace
+ \string\KOption{#1}\string\PName{...}\MessageBreak
+ by \string\OptionVName{#1}{...}}%
+ \par
+ \leftskip\z@
+ \BeginIndex{Option}{#1}% index entry
+ \begingroup
+ \@nameuse{phantomsection}%
+ \label@sanitize
+ \expandafter\gdef
+ \csname \label@desc@prefix\label@base.option.#1\label@suffix\endcsname{}%
+ \label{\label@desc@prefix\label@base.option.#1\label@suffix}%
+ \endgroup
+ \textOption{#1=}%
+}
+\newcommand*{\maybelinebreak}{%
+ \ifvmode\else
+ \ifnum\lastpenalty<\z@\else
+ \ifnum\lastpenalty<\@medpenalty
+ \hskip\z@skip
+ \fi
+ \fi
+ \fi
+}
+\DeclareRobustCommand*{\textKValue}[1]{\maybelinebreak\mbox{\texttt{#1}}}
+\newcommand*{\KValue}{}
+\let\KValue\textKValue
+\newcommand*{\textOptionValue}[2]{%
+ \textKOption{#1}\textKValue{#2}%
+}
+\DeclareRobustCommand*{\OptionValue}{\textOptionValue}%
+\newcommand*{\LabelOptionValue}[3][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabellong{\OptionValue{#2}{#3}}%
+ \protected@edef\@currentlabelshort{\Option{#2}}%
+ \label@sanitize
+ \scr@ifundefinedorrelax{%
+ \label@desc@prefix\label@base.option.#2\label@suffix
+ }{%
+ \expandafter\gdef
+ \csname \label@desc@prefix\label@base.option.#2\label@suffix\endcsname{}%
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.option.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \let\@currentlabel\@currentlabelshort
+ \label{\label@desc@prefix\label@base.option.#2#1}%
+ }{}%
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.option.#2.#3#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \let\@currentlabel\@currentlabellong
+ \label{\label@desc@prefix\label@base.option.#2.#3#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macro}{\OptionValueRef}
+% \cs{OptionValue} by reference. Use it like
+% |\OptionValueRef[suffix]{maincls}{version}{3.20}|.
+% \begin{macrocode}
+\newcommand*{\OptionValueRef}{%
+ \kernel@ifstar {\@RefOptionValue0}{\@RefOptionValue1}%
+}
+\newcommand*{\@RefOptionValue}[1]{%
+ \kernel@ifnextchar [%]
+ {\@@RefOptionValue#1}{\@@RefOptionValue#1[]}%
+}
+\newcommand*{\@@RefOptionValue}{}
+\def\@@RefOptionValue#1[#2]#3#4#5{%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix#3.option.#4.#5#2}{%
+ \ifcase #1
+ \expandafter\scr@no@hyperref
+ \else
+ \expandafter\hyperref
+ \fi
+ [\label@desc@prefix#3.option.#4#2]%
+ {\OptionValue{\ref*{\label@desc@prefix#3.option.#4#2}}{#5}}%
+ }{%
+ \expandafter\ref\ifcase #1 *\fi{\label@desc@prefix#3.option.#4.#5#2}%
+ }%
+}
+\newcommand*{\scr@no@hyperref}[2][]{#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newcommand*{\DescOptionValue}[2]{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Option}{#1}%
+ \BeginIndex{Option}{#1~=\KValue{#2}}%
+ \LabelOptionValue{#1}{#2}%
+ \textOptionValue{#1}{#2}%
+}
+\newcommand*{\textOptionVName}[2]{%
+ \textKOption{#1}\PName{#2}%
+}
+\DeclareRobustCommand*{\OptionVName}{\textOptionVName}%
+\newcommand*{\LabelOptionVName}[3][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabellong{\OptionVName{#2}{#3}}%
+ \protected@edef\@currentlabelshort{\Option{#2}}%
+ \label@sanitize
+ \scr@ifundefinedorrelax{%
+ \label@desc@prefix\label@base.option.#2\label@suffix
+ }{%
+ \expandafter\gdef
+ \csname \label@desc@prefix\label@base.option.#2\label@suffix\endcsname{}%
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.option.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \let\@currentlabel\@currentlabelshort
+ \label{\label@desc@prefix\label@base.option.#2#1}%
+ }{}%
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.option.#2=#3#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \let\@currentlabel\@currentlabellong
+ \label{\label@desc@prefix\label@base.option.#2=#3#1}%
+ \endgroup
+}
+\newcommand*{\DescOptionVName}[2]{%
+ \par
+ \leftskip\z@
+% \BeginIndex{Option}{#1}%
+ \BeginIndex{Option}{#1~=\PName{#2}}%
+ \LabelOptionVName{#1}{#2}%
+ \textOptionVName{#1}{#2}%
+}
+\newcommand*{\LabelFloatStyle}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\FloatStyle{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.floatstyle.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.floatstyle.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\FloatStyle}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Floatstyle}{#1}%
+ \LabelFloatStyle{#1}%
+ \textFloatStyle{#1}%
+}
+\newcommand*{\LabelPageStyle}[2][\label@suffix]{%
+ \begingroup
+ \@nameuse{phantomsection}%
+ \label@sanitize
+ \label{\label@desc@prefix\label@base.pagestyle.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\PageStyle}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Pagestyle}{#1}%
+ \LabelPageStyle{#1}%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix maincls.cmd.pagestyle}{%
+ \textMacro{pagestyle}%
+ }{%
+ \begingroup
+ \let\Macro\textMacro
+ \DescRef{maincls.cmd.pagestyle}%
+ \endgroup
+ }\PParameter{#1}%
+}
+\newcommand*{\LabelEnvironment}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Environment{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.env.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.env.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\Environment}{\mbox{\texttt{#1}}}{%
+ \par
+ \settowidth{\leftskip}{\textMacro{begin}\PParameter{#1}}% siehe Macro
+ \hskip-\leftskip
+ \BeginIndex{Env}{#1}%
+ \LabelEnvironment{#1}%
+ \textMacro{begin}\PParameter{#1}%
+ \def\d@EnvironmentName{#1}% Umgebungsnamen merken für das Ende
+}[{%
+ \ifvmode\hskip-\leftskip\else \unskip\,\dots\fi% \begin{…}…\end{…}
+ \textMacro{end}\expandafter\PParameter\expandafter{\d@EnvironmentName}\par
+}]%
+\newcommand*{\LabelCounter}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Counter{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.counter.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.counter.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\Counter}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Counter}{#1}%
+ \LabelCounter{#1}%
+ \textCounter{#1}%
+}
+\newcommand*{\LabelLength}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Length{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.length.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.length.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\Length}{\mbox{\texttt{\char`\\#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Length}{#1}% index entry
+ \LabelLength{#1}%
+ \textLength{#1}%
+}
+\newcommand*{\LabelPLength}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\PLength{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.plength.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.plength.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\PLength}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{PLength}{#1}%
+ \LabelPLength{#1}%
+ \scr@ifundefinedorrelax{%
+ r@\label@desc@prefix scrlttr2-experts.cmd.@setplength}{%
+ \textMacro{@setplength}%
+ }{%
+ \begingroup
+ \let\Macro\textMacro
+ \DescRef{scrlttr2-experts.cmd.@setplength}%
+ \endgroup
+ }%
+ \PParameter{#1}\Parameter{\lengthname}%
+}
+\newcommand*{\LabelVariable}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\Variable{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.variable.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.variable.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\Variable}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{Variable}{#1}%
+ \LabelVariable{#1}%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix scrlttr2.cmd.setkomavar}{%
+ \textMacro{setkomavar}%
+ }{%
+ \begingroup
+ \let\Macro\textMacro
+ \DescRef{scrlttr2.cmd.setkomavar}%
+ \endgroup
+ }%
+ \PParameter{#1}\OParameter{\descriptionname}%
+ \Parameter{\contentname}%
+}
+\newcommand*{\LabelFontElement}[2][\label@suffix]{%
+ \begingroup
+ \protected@edef\@currentlabel{\FontElement{#2}}%
+ \label@sanitize
+ \Hy@MakeCurrentHref{\label@desc@prefix\label@base.fontelement.#2#1}%
+ \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ \label{\label@desc@prefix\label@base.fontelement.#2#1}%
+ \endgroup
+}
+\DeclareSpecialMarkup{\FontElement}{\mbox{\texttt{#1}}}{%
+ \par
+ \leftskip\z@
+ \BeginIndex{FontElement}{#1}%
+ \LabelFontElement{#1}%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.cmd.setkomafont}{%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix maincls.cmd.setkomafont}{%
+ \textMacro{setkomafont}%
+ }{%
+ \begingroup
+ \let\Macro\textMacro
+ \DescRef{maincls.cmd.setkomafont}%
+ \endgroup
+ }%
+ }{%
+ \begingroup
+ \let\Macro\textMacro
+ \DescRef{\LabelBase.cmd.setkomafont}%
+ \endgroup
+ }%
+ \PParameter{#1}\OParameter{\fontsettingname}%
+}
\DeclareRobustCommand*{\PName}[1]{\texttt{\textit{#1}}}
\DeclareRobustCommand*{\PValue}[1]{\texttt{#1}}
-\DeclareRobustCommand*{\Parameter}[1]{\texttt{\{}\PName{#1}\texttt{\}}}
+\DeclareRobustCommand*{\Parameter}[1]{%
+ \maybelinebreak\texttt{\{}\PName{#1}\texttt{\}}}
\DeclareRobustCommand*{\OParameter}[1]{%
- \texttt{[%]
+ \maybelinebreak\texttt{[%]
}\PName{#1}\texttt{%[
]}}
\DeclareRobustCommand*{\AParameter}[1]{%
- \texttt{(%)
+ \maybelinebreak\texttt{(%)
}\PName{#1}\texttt{%(
)}}
-\DeclareRobustCommand*{\PParameter}[1]{\texttt{\{#1\}}}
-\DeclareRobustCommand*{\POParameter}[1]{\texttt{[#1]}}
+\DeclareRobustCommand*{\PParameter}[1]{\maybelinebreak\texttt{\{#1\}}}
+\DeclareRobustCommand*{\POParameter}[1]{\maybelinebreak\texttt{[#1]}}
+\newcommand\label@sanitize{%
+ \renewcommand*{\"}[1]{##1e}%
+ \renewcommand*{\IeC}[1]{\expandafter\@gobble\string##1}%
+ \renewcommand*{\textup}[1]{##1}%
+ \renewcommand*{\PName}[1]{/##1/}%
+}
+\newcommand*{\label@desc@prefix}{desc:}
+\newcommand*{\label@suffix}{}
+\newcommand*{\labelsuffix}[1][]{% Werden Dinge mehrfach dokumentiert benötigen
+ % sie ein zusätzliches Unterscheidungsmerkmal
+ % beim gesetzten Label.
+ \IfArgIsEmpty{#1}{\let\label@suffix\@empty}{\edef\label@suffix{.#1}}%
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -703,44 +1154,82 @@
%
% \section{Identification}
%
+% \begin{macro}{\LabelBase}
% \begin{macro}{\labelbase}
% \begin{macrocode}
\newcommand*{\labelbase}[1]{%
+ \ifstr{\label@base@sec}{unknown}{}{%
+ \labelofbase[sec]{\label@base@sec.next}%
+ \gdef\label@base@sec{}%
+ }%
\renewcommand*{\label@base}{#1}%
\label{cha:#1}%
}
% \end{macrocode}
% \begin{macro}{\label@base}
+% \begin{macro}{\label@base.sec}
% \begin{macrocode}
\newcommand*{\label@base}{unknown}
+\newcommand*{\label@base@sec}{}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% \begin{macro}{\labelofbase}
% Sets a label depending on \cs{label@base}. First optional argument is the
% label prefix, second is the the label postfix.
% \begin{macrocode}
-\newcommand*{\labelofbase}[2][lab:]{%
+\newcommand*{\labelofbase}[2][lab]{%
\label{#1:\label@base.#2}%
}
% \end{macrocode}
+% \begin{macro}{\prefix@ref}
+% Internal command to set a \cs{ref}, \cs{pageref}, or \cs{autoref} to an
+% label with prefix. Use it, e.g., like
+% |\label@base@ref{\autoref}{sec}{maincls.cmd.foo}|.
+% \begin{macrocode}
+\newcommand*{\prefix@ref}[3]{%
+ #1{#2:#3}%
+}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\seclabel}
% Sets a label of type section.
% \begin{macrocode}
\newcommand*{\seclabel}[1]{%
+ \ifx\label@base@sec\@empty\else
+ \labelofbase[sec]{\label@base@sec.next}%
+ \fi
+ \xdef\label@base@sec{#1}%
\labelofbase[sec]{#1}%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\exlabel}
+% \begin{macro}{\xmpllabel}
+% \begin{macro}{\Refxmpl}
+% \begin{macro}{\PageRefxmpl}
% Sets a label of type example.
% \begin{macrocode}
-\newcommand*{\exlabel}[1]{%
- \labelofbase[example]{#1}%
+\newcommand*{\xmpllabel}[1]{%
+ \labelofbase[xmpl]{#1}%
+}
+\newcommand*{\Refxmpl}{%
+ \kernel@ifstar {\prefix@ref{\autoref*}{xmpl}}%
+ {\prefix@ref{\autoref}{xmpl}}%
+}
+\newcommand*{\PageRefxmpl}{%
+ \kernel@ifstar {\prefix@ref{\autopageref*}{xmpl}}%
+ {\prefix@ref{\autopageref}{xmpl}}%
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% User command to get the current label base.
+% \begin{macrocode}
+\newcommand*{\LabelBase}{\@nameuse{label@base}}
+% \end{macrocode}
+% \end{macro}
%
% \section{Special Environments}
%
@@ -749,81 +1238,117 @@
% length, variables etc.\footnote{TODO: Redefining most declaration commands
% to also write labels.}
% \begin{macrocode}
+\colorlet{Declaration}{PaleTurquoise}
+\newsavebox\Declaration@Box
+\newcommand*{\Declaration@Width}{\linewidth}
+\newcommand*{\Declaration@LeftIndent}{-2\fboxsep}
+\newcommand*{\Declaration@UseBox}[1]{%
+ \colorbox{Declaration}{\usebox\Declaration@Box}%
+}
\newenvironment{Declaration}{%
-% \end{macrocode}
-% \begin{macro}{\new@element}
-% Help macro to define new Declaration elements.
-% \begin{macrocode}
- \newcommand*{\new@element}[1]{%
- \expandafter\newcommand\expandafter*\csname X##1\endcsname{}%
- \expandafter\let\csname X##1\expandafter\endcsname
- \csname ##1\endcsname
- \expandafter\newcommand\expandafter*\csname new##1\endcsname[1]{%
-% \begingroup
-% \let\ensuremath\@firstofone
-% \let\textit\@firstofone
-% \lowercase{\def\@tempa{##1}}%
-% \pdfstringdef\@tempb{\label@base.\@tempa.####1}%
-% \xdef\@currentHref{\@tempb}%
-% \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
-% \label{desc:\label@base.\@tempa.####1}%
-% \endgroup
- \csname X##1\endcsname{####1}\ignorespaces
- }%
- \expandafter\let\csname ##1\expandafter\endcsname\csname new##1\endcsname
- }%
- \newcommand*{\new@xelement}[2]{%
- \expandafter\newcommand\expandafter*\csname X##1\endcsname{}%
- \expandafter\let\csname X##1\expandafter\endcsname
- \csname ##1\endcsname
- \expandafter\newcommand\expandafter*\csname new##1\endcsname[2]{%
-% \begingroup
-% \let\ensuremath\@firstofone
-% \let\textit\@firstofone
-% \lowercase{\def\@tempa{##1}}%
-% \pdfstringdef\@tempb{\label@base.\@tempa.####1.####2}%
-% \xdef\@currentHref{\@tempb}%
-% \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
-% \label{desc:\label@base.\@tempa.####1.####2}%
-% \endgroup
- \csname X##1\endcsname{####1}{##2{####2}}\ignorespaces
- }%
- \expandafter\let\csname ##1\expandafter\endcsname\csname new##1\endcsname
+ % Als erstes wird eine neue Index-Gruppe begonnen. Dagegen darf die
+ % vorherige Index-Gruppe hier nicht automatisch geschlossen werden, weil
+ % beispielsweise ein Abschnitt oder ein Kapitel ebenfalls eine Index-Gruppe
+ % sein könnte (aber nicht muss).
+ \BeginIndexGroup
+ % Die Absatzformatierung anpassen. Eigentlich hier noch nicht notwendig,
+ % schadet aber auch nichts.
+ \parindent\z@
+ \parfillskip\@flushglue
+ \parskip\z@
+ % \Macro, \Environment, etc. so umdefinieren, dass sie passend für die
+ % Umgebung formatiert werden und auch gleich Label und Index-Einträge
+ % erzeugt werden.
+ \scr@Desc@let\Macro
+ \scr@Desc@let\Option
+ \scr@Desc@let\KOption
+ \scr@Desc@let\OptionValue
+ \scr@Desc@let\OptionVName
+ \scr@Desc@let\Variable
+ \scr@Desc@let\Environment
+ \let\endEnvironment\endDescEnvironment
+ \scr@Desc@let\Counter
+ \scr@Desc@let\Length
+ \scr@Desc@let\PageStyle
+ \scr@Desc@let\PLength
+ \scr@Desc@let\FontElement
+ \scr@Desc@let\FloatStyle
+ % Todo: Replace the following by the correct definitions:
+ \let\XMacro\textMacro
+ \let\XEnvironment\textEnvironment
+ \let\XOption\textOption
+ \let\XOptionValue\textOptionValue
+ \newenvironment{Body}{% Umgebung für den (vertikalen) Inhalt einer Umgebung
+ \\
+ \setlength{\leftskip}{1em}%
+ \minipage{\dimexpr\linewidth-\leftskip}%
+ \raggedright
+ \newcommand*{\BodyDots}{%
+ \par
+ \hskip-\leftskip
+ \raisebox{0pt}[1.1\ht\strutbox][.5\dp\strutbox]{$\vdots$}%
+ \par
+ }%
+ }{%
+ \par
+ \endminipage
+ \\
}%
-% \end{macrocode}
-% \begin{macrocode}
- \new@element{Option}%
- \new@element{Macro}%
- \new@element{Environment}%
- \new@element{Counter}%
- \new@element{FloatStyle}%
- \new@element{PLength}%
- \new@element{Variable}%
- \new@xelement{OptionValue}{\PValue}%
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
- \ifvmode\else\par\fi\small\addvspace{2\baselineskip}%
- \vspace{-\baselineskip}%
- \vspace{\z@ plus \baselineskip}%
- \noindent
- \start@Declaration
- \tabular{|l|}\hline\ignorespaces
+ % Todo: Behandlung für Optionen, Längen, Zähler, Font-Elemente, Seitenstile,
+ % etc.
+ % Maybe: Vielleicht wäre es besser, die \X…-Definitionen von hier direkt zur
+ % Definition der entsprechenden Elemente zu verlagern und sie \D… zu
+ % nennen. Das wird dann eventuell übersichtlicher als alles hier zu
+ % machen. Hier gäbe es dann nur noch für jedes Element genau ein
+ % \let\…\D….
+ % Jetzt wird der ganze Inhalt der Umgebung linksbündig in eine Box gepackt
+ \begin{lrbox}{\Declaration@Box}%
+ \minipage{\Declaration@Width}%
+ \raggedright
+ \parskip\baselineskip
+ \small
+ \addtolength{\parskip}{-\baselineskip}%
+ \catcode`\^^M=9 % ignore line ends
}{%
- \\\hline\endtabular\nobreak\after@Declaration\nobreak\par\nobreak
- \vspace{1.5\baselineskip}\nobreak\vspace{-\baselineskip}\nobreak%
- \vspace{0pt minus .5\baselineskip}\nobreak%
+ \par
+ \endminipage
+ \end{lrbox}
+ \vskip 1\baselineskip \@plus .75\baselineskip \@minus .25\baselineskip
+ % Hier darf ein Seitenumbruch ohne vertikalen Ausgleich erfolgen, wenn nicht
+ % mindestens für die Deklaration und zwei Zeilen Platz ist.
+ \vskip \dimexpr\ht\Declaration@Box+\dp\Declaration@Box+2\baselineskip\relax
+ \penalty-\@medpenalty
+ \vskip -\dimexpr\ht\Declaration@Box+\dp\Declaration@Box+2\baselineskip\relax
+ \begingroup% Dann wird die erzeugte Box farbig hinterlegt leicht im linken
+ % Rand ausgegeben.
+ \parfillskip\@flushglue
+ \parindent\z@
+ \leavevmode
+ \hspace*{\Declaration@LeftIndent}%
+ \Declaration@UseBox{\Declaration@Box}%
+ \par\nobreak\vskip\fboxsep
+ \endgroup\nobreak
+ % Der nachfolgende Text soll wie bei einer Überschrift behandelt werden.
\aftergroup\@afterindentfalse\aftergroup\@afterheading
}
-\newcommand*{\start@Declaration}{\hspace{-1em}}
-\newcommand*{\after@Declaration}{}
% \end{macrocode}
+% \begin{macro}{\scr@Desc@let}
+% Redefine the internal command of a robust command.
+% \begin{macrocode}
+\newcommand*{\scr@Desc@let}[1]{%
+ \expandafter\def
+ \csname \expandafter\@gobble\string #1 \expandafter\endcsname\expandafter{%
+ \csname Desc\expandafter\@gobble\string #1\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
% \end{environment}
%
% \begin{environment}{Example}
% This environment is used for all examples at the \KOMAScript{} guide.
% \begin{macrocode}
\newenvironment{Example}{%
+ \lstset{belowskip=0pt plus 1pt minus .5pt}%
\labeling{{\usekomafont{disposition}\GuideExample:\ }}
\item[{\usekomafont{disposition}\GuideExample:\ }]%
}{%
@@ -995,7 +1520,7 @@
% \begin{macrocode}
\providecommand*{\ChangedAt}[3][]{%
\ifstr{#1}{}{%
- \marginnote{\footnotesize\fbox{\strut#2}}%
+ \marginnote{\tiny\fbox{\strut#2}}%
}{%
\def\reserved@a##1/##2\@nil{%
\count@\year
@@ -1005,9 +1530,9 @@
\advance\count@-##2\relax
}\reserved@a#1\@nil
\ifnum\count@<13
- \marginnote{\footnotesize Beta-Feature}%
+ \marginnote{\tiny Beta-Feature}%
\else
- \marginnote{\footnotesize\fbox{\strut #2}}%
+ \marginnote{\tiny\fbox{\strut #2}}%
\fi
}%
\begingroup
@@ -1152,7 +1677,15 @@
\entry{\Variable{##1}\IndexVariable[indexmain]{##1}}%
}%
\newcommand*{\feentry}[1]{%
- \entry{\FontElement{##1}\IndexFontElement[indexmain]{##1}}%
+ \entry{%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.fontelement.##1}{%
+ \ClassWarning{scrguide}{%
+ Reference `\label@desc@prefix\LabelBase.fontelement.##1' undefined}%
+ \FontElement{##1}%
+ }{%
+ \DescRef{\LabelBase.fontelement.##1}%
+ }%
+ \IndexFontElement[indexmain]{##1}}%
}%
\newcommand*{\oentry}[1]{%
\entry{\Option{##1}\IndexOption[indexmain]{##1}}%
@@ -1302,14 +1835,13 @@
%
% Setup listings:
% \begin{macrocode}
-\lstdefinestyle{basics}{%
+\lstset{%
basicstyle=\ttfamily,%
columns=fullflexible,keepspaces,%
aboveskip=.4\baselineskip,%
- belowskip=0pt%
+ belowskip=\dp\strutbox plus 1pt minus .5pt%
}%
\lstdefinestyle{code}{%
- style=basics,%
language=[LaTeX]TeX,%
moretexcs={%
@auxout, @currext, @dottedtocline, @empty, @float, @ifpackagelater,
@@ -1328,7 +1860,7 @@
textsuperscript}%
}%
\lstdefinestyle{output}{%
- style=basics,breaklines,prebreak=\mbox{$\hookleftarrow$}%
+ breaklines,prebreak=\mbox{$\hookleftarrow$}%
}%
\lstdefinestyle{KOMA}{%
style=code,%
@@ -1419,12 +1951,15 @@
TOCEntryStyleInitCode,TOCEntryStyleStartInitCode,TOCLineLeaderFill,
UnPreventPackageFromLoading,unitfactor,
unsettoc,usekomafont,useplength,usekomavar,uppertitleback%
+ }%
}%
-} \lstset{style=basics} \lstnewenvironment{lstoutput}[1][]{%
+\lstnewenvironment{lstoutput}[1][]{%
\lstset{style=output,basicstyle=\ttfamily\small,#1}%
-}{} \lstnewenvironment{lstcode}[1][]{%
+}{}%
+\lstnewenvironment{lstcode}[1][]{%
\lstset{style=KOMA,basicstyle=\ttfamily\small,#1}%
-}{} \newcommand*{\lstinputcode}[1][]{%
+}{}%
+\newcommand*{\lstinputcode}[1][]{%
\lstinputlisting[style=KOMA,basicstyle=\ttfamily\small,#1]%
}
% \end{macrocode}
@@ -1629,6 +2164,7 @@ KOMAScript \endcsname
% \end{macro}
%
% \begin{macro}{\printmultiindex}
+% \changes{v1.11a}{2016/11/02}{index label generation delayed}^^A
% Print one part of the multi part index.
% \begin{macrocode}
\newcommand*{\printmultiindex}[3][]{%
@@ -1654,7 +2190,7 @@ KOMAScript \endcsname
\ifx\relax#1\relax\let\index@preamble=\relax
\else\def\index@preamble{#1}%
\fi
- \label{idx:#3}%
+ \def\index@setlabel{\label{idx:#3}}%
\@input@{\jobname-#3.ind}%
\endgroup
}
@@ -1671,7 +2207,7 @@ KOMAScript \endcsname
\setlength{\parskip}{\z@ \@plus .3\p@}%
\setlength{\parfillskip}{\z@ \@plus 1fil}%
\let\item\@idxitem
- \small
+ \small\csname index@setlabel\endcsname
}{%
\end{multicols}%
}
@@ -1844,77 +2380,158 @@ KOMAScript \endcsname
\newif\ifnolabel
\def\nolabelfalse{\global\let\ifnolabel\iffalse}%
\def\nolabeltrue{\global\let\ifnolabel\iftrue}%
-\newlength\PreserveSkip
\newcommand*{\BeginIndex}[3][indexmain]{%
- \ifvmode\PreserveSkip=\lastskip\else\PreserveSkip=\z@\fi
\expandafter\ifx\csname Index#2\endcsname\relax
\GenericError{(scrguide)\@spaces\@spaces\@spaces\@spaces}{%
Document scrguide Error: \string\BeginIndex\space with unknown
index%
}{Check the \string\BeginIndex-command or add a new index type
``#2''.}{%
- See scrguide2.tex for more information.}%
+ See scrguide.cls for more information.}%
\else
\csname Index#2\endcsname[(%)
#1]{#3}%
+ \push@IndexStack{{\do{#1}{#2}{#3}}}%
\fi
- \ifnolabel\nolabelfalse\else
- \ifx\relax#2\relax\else
- \begingroup
- \def\SplitIndexValue##1~=##2~=##3\@nil{%
- ##1\expandafter\ifx\expandafter\relax##2\relax\else.##2\fi
- }%
- \let\PName\@gobble
- \let\PValue\@firstofone
- \let\ensuremath\@firstofone
- \let\textit\@firstofone
- \def~{\string~}%
- \lowercase{\def\@tempa{#2}}%
- \edef\@tempa{\label@base.\@tempa.\SplitIndexValue#3~=~=\@nil}%
- \pdfstringdef\@tempb{\@tempa}%
- \expandafter\ifx\csname \@tempb\endcsname\relax
- \expandafter\xdef\csname \@tempb\endcsname{\the\inputlineno}%
- \xdef\@currentHref{\@tempb}%
- \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
- \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
- \label{desc:\@tempa}%
- \else
- \ClassWarning{scrguide}{%
- Label \@tempa\space already defined at \csname
- \@tempb\endcsname,\MessageBreak
- ignored}%
- \fi
- \endgroup
- \fi
- \fi
- \ifvmode\ifdim \PreserveSkip=\z@\else
- \vskip -\PreserveSkip\vskip\PreserveSkip
- \fi\fi
- \ignorespaces
+ % \ifnolabel\nolabelfalse\else
+ % \ifx\relax#2\relax\else
+ % \begingroup
+ % \def\SplitIndexValue##1~=##2~=##3\@nil{%
+ % ##1\expandafter\ifx\expandafter\relax##2\relax\else.##2\fi
+ % }%
+ % \let\PName\@gobble
+ % \let\PValue\@firstofone
+ % \let\ensuremath\@firstofone
+ % \let\textit\@firstofone
+ % \def~{\string~}%
+ % \lowercase{\def\@tempa{#2}}%
+ % \edef\@tempa{\label@base.\@tempa.\SplitIndexValue#3~=~=\@nil}%
+ % \pdfstringdef\@tempb{\@tempa}%
+ % \expandafter\ifx\csname \@tempb\endcsname\relax
+ % \expandafter\xdef\csname \@tempb\endcsname{\the\inputlineno}%
+ % \xdef\@currentHref{\@tempb}%
+ % \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
+ % \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ % \label{desc:\@tempa}%
+ % \else
+ % \ClassWarning{scrguide}{%
+ % Label \@tempa\space already defined at \csname
+ % \@tempb\endcsname,\MessageBreak
+ % ignored}%
+ % \fi
+ % \endgroup
+ % \fi
+ % \fi
+ \penalty\@M\ignorespaces
}
-\newcommand*{\EndIndex}[3][indexmain]{%
- \@tempdima\lastskip
- \ifdim \lastskip>\z@
- \vskip -\lastskip
+\newlength\PreserveSkip
+\newcount\PreservePenalty
+\newcommand*{\CloseIndex}[3][indexmain]{%
+ \PreservePenalty\lastpenalty
+ \ifvmode\PreserveSkip\lastskip\else\unskip\PreserveSkip\z@\fi
+ \ifdim \PreserveSkip>\z@
+ \vskip -\PreserveSkip
\fi
+ \penalty\@M
\expandafter\ifx\csname Index#2\endcsname\relax
\GenericError{(scrguide)\@spaces\@spaces\@spaces\@spaces}{%
Document scrguide Error: \string\EndIndex\space with unknown
index%
}{Check the \string\BeginIndex-command or add a new index type
``#2''.}{%
- See scrguide2.tex for more information.}%
+ See scrguide.cls for more information.}%
\else
\csname Index#2\endcsname[%(
)#1]{#3}%
\fi
- \ifdim\@tempdima >\z@
- \vskip\@tempdima
+ \ifdim\PreserveSkip >\z@
+ \vskip\PreserveSkip
\fi
+ \penalty\PreservePenalty
+}
+\newcommand*{\EndIndex}[3][indexmain]{%
+ \begingroup
+ \@tempswatrue
+ \def\do##1##2##3{%
+ \ifstr{#1}{##1}{%
+ \ifstr{#2}{##2}{%
+ \ifstr{\detokenize{#3}}{\detokenize{##3}}{}{\@tempswafalse}%
+ }{\@tempswafalse}%
+ }{\@tempswafalse}%
+ \if@tempswa
+ \else
+ \ClassError{scrguide}{Index stack error}{%
+ Should pop \string\do{#1}{#2}{\detokenize{#3}}\MessageBreak
+ but have \string\do{##1}{##2}{\detokenize{##3}}%
+ }%
+ \push@IndexStack{{\do{##1}{##2}{##3}}}%
+ \fi
+ }%
+ \def\StopIndexGroup{%
+ \ClassError{scrguide}{Index stack error}{%
+ Should pop \string\do{#1}{#2}{\detokenize{#3}}\MessageBreak
+ but have \string\StopIndexGroup
+ }%
+ \push@IndexStack{\StopIndexGroup}%
+ }%
+ \expandafter\pop@IndexStack\@IndexStack\@nil
+ \endgroup
+ \CloseIndex[#1]{#2}{#3}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
+\let\@IndexStack\@empty
+\newcommand*{\push@IndexStack}[1]{% Einen Eintrag auf den Index Stapel werfen.
+ \xdef\@IndexStack{\unexpanded{#1}\unexpanded\expandafter{\@IndexStack}}%
+}
+\newcommand*{\BeginIndexGroup}{% Am Anfang einer Gruppe auf den Stack die
+ % Index-Gruppen-Trennmarke packen.
+ \push@IndexStack{\StopIndexGroup}%
+}
+\newcommand*{\EndIndexGroup}{% Den Stapel bis zur nächsten Stop-Marke
+ % verarbeiten.
+ \ifx\@IndexStack\@empty
+ \ClassError{scrguide}{cannot end index group}{%
+ You've told me to end the current index group,\MessageBreak
+ but there is no more index group open%
+ }%
+ \else
+ \begingroup
+ \let\StopIndexGroup\@tempswafalse
+ \@tempswatrue%(
+ \def\do##1##2##3{%
+ \CloseIndex[##1]{##2}{##3}%
+ }%
+ \@whilesw \if@tempswa \fi {%
+ \expandafter\pop@IndexStack\@IndexStack\@nil
+ }%
+ \endgroup
+ \fi
+}
+\def\pop@IndexStack#1#2\@nil{% Ein Argument von Stapel holen und verarbeiten.
+ \gdef\@IndexStack{#2}#1%
+}
+\newcommand*\CleanUpIndexStack{%
+ \ifx\@IndexStack\@empty\else
+ \ClassError{scrguide}{Index stack error}{%
+ The index stack should be empty\MessageBreak
+ but it still contains: \MessageBreak
+ \expandafter\detokenize\expandafter{\@IndexStack}%
+ }%
+ \begingroup
+ \let\StopIndexGroup\relax
+ \def\do##1##2##3{%
+ \CloseIndex[##1]{##2}{##3}%
+ }%
+ \@IndexStack
+ \global\let\@IndexStack\@empty
+ \endgroup
+ \fi
+}
+\AtEndDocument{\CleanUpIndexStack}
+\l@preto@macro\chapter{\CleanUpIndexStack}
+\l@preto@macro\part{\CleanUpIndexStack}
%
% Now we have to define different kinds of index entries. We have entries that
% will be added to only one index. We have entries that will be added to one