Debian Codegraph @

texmf-dist/source/latex/koma-script/doc/scrguide.cls

raw
1 % ======================================================================
2 % scrguide.cls
3 % Copyright (c) Markus Kohm, 2005-2025
4 %
5 % This file is part of the LaTeX2e KOMA-Script bundle.
6 %
7 % This work may be distributed and/or modified under the conditions of
8 % the LaTeX Project Public License, version 1.3c of the license.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3c or later is part of all distributions of LaTeX
12 % version 2005/12/01 or later and of this work.
13 %
14 % This work has the LPPL maintenance status "author-maintained".
15 %
16 % The Current Maintainer and author of this work is Markus Kohm.
17 %
18 % This work consists of all files listed in MANIFEST.md.
19 % ----------------------------------------------------------------------
20 % scrguide.cls
21 % Copyright (c) Markus Kohm, 2005-2025
22 %
23 % Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
24 % Version 1.3c, verteilt und/oder veraendert werden.
25 % Die neuste Version dieser Lizenz ist
26 % http://www.latex-project.org/lppl.txt
27 % und Version 1.3c ist Teil aller Verteilungen von LaTeX
28 % Version 2005/12/01 oder spaeter und dieses Werks.
29 %
30 % Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
31 % (allein durch den Autor verwaltet).
32 %
33 % Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
34 %
35 % Dieses Werk besteht aus den in MANIFEST.md aufgefuehrten Dateien.
36 % ======================================================================
37 %
38 % \section{Identification}
39 %
40 % \begin{macrocode}
41 \ProvidesClass{scrguide}[2025/07/28 v1.29 internal KOMA-Script guide class]
42 % \end{macrocode}
43 %
44 %
45 % \section{Options on my own}
46 %
47 % This class also has options.
48 %
49 % The class knows two language options (and some aliases)
50 % \begin{option}{english}
51 % \begin{macrocode}
52 \DeclareOption{english}{\def\languagename{english}}
53 \DeclareOption{UKenglish}{%
54 \ClassWarning{scrguide}{Language `english' will be used instead of
55 `\CurrentOption'}%
56 \def\languagename{english}%
57 }
58 \DeclareOption{USenglish}{%
59 \ClassWarning{scrguide}{Language `english' will be used instead of
60 `\CurrentOption'}%
61 \def\languagename{english}%
62 }
63 \DeclareOption{british}{%
64 \ClassWarning{scrguide}{Language `english' will be used instead of
65 `\CurrentOption'}%
66 \def\languagename{english}%
67 }
68 \DeclareOption{american}{%
69 \ClassWarning{scrguide}{Language `english' will be used instead of
70 `\CurrentOption'}%
71 \def\languagename{english}%
72 }
73 \DeclareOption{ngerman}{\def\languagename{ngerman}}
74 \DeclareOption{german}{%
75 \ClassWarning{scrguide}{Language `ngerman will be used instead of
76 `\CurrentOption'}%
77 \def\languagename{ngerman}%
78 }
79 % \end{macrocode}
80 % \end{option}
81 %
82 % \begin{option}{pagereftolabel}
83 % |\autopageref| should reference the label not the page.
84 % \begin{option}{pagereftopage}
85 % |\autopageref| should reference the page not the label.
86 % \begin{macro}{\if@pagereftolabel}
87 % \begin{macrocode}
88 \newif\if@pagereftolabel\@pagereftolabeltrue
89 \DeclareOption{pagereftolabel}{\@pagereftolabeltrue}
90 \DeclareOption{pagereftopage}{\@pagereftolabelfalse}
91 % \end{macrocode}
92 % \end{macro}
93 % \end{option}
94 % \end{option}
95 %
96 % \begin{option}{moreindexnotes}
97 % Show more notes at the index.
98 % \begin{option}{lessindexnotes}
99 % Show less notes at the index.
100 % \begin{macro}{\if@moreindexnotes}
101 % \begin{macrocode}
102 \newif\if@moreindexnotes\@moreindexnotesfalse
103 \DeclareOption{moreindexnotes}{\@moreindexnotestrue}
104 \DeclareOption{lessindexnotes}{\@moreindexnotesfalse}
105 % \end{macrocode}
106 % \end{macro}
107 % \end{option}
108 % \end{option}
109 %
110 % Note: You have to pass options to class \textsf{scrguide}, because only
111 % these options will be processed by |\LoadClassWithOptions| below.
112 % \begin{macrocode}
113 \ExecuteOptions{pagereftolabel,lessindexnotes}
114 \PassOptionsToClass{%
115 bibliography=totoc,
116 index=totoc,
117 captions=tableabove,
118 headings=small,
119 headings=optiontoheadandtoc,
120 version=last,
121 }{scrguide}
122 \ProcessOptions\relax
123 % \end{macrocode}
124 %
125 %
126 % \section{Load the Base Class and Packages}
127 %
128 % \begin{macro}{\KOMAProvidesFile}
129 % \begin{macro}{\@KOMAProvidesFile}
130 % \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
131 % Extended version of |\ProvidesFile|, that uses the date from the
132 % repository.
133 % \begin{macrocode}
134 \newcommand*{\KOMAProvidesFile}{}
135 \def\KOMAProvidesFile#1{%
136 \@ifnextchar [%]
137 {\@KOMAProvidesFile{#1}}{\ProvidesFile{#1}\relax}%
138 }
139 \newcommand*{\@KOMAProvidesFile}{}
140 \def\@KOMAProvidesFile#1[$#2: #3-#4-#5 #6$#7]{%
141 \Ifstr{#2}{Date}{%
142 \ProvidesFile{#1}[#3/#4/#5 \detokenize{#6 #7}]\relax
143 }{%
144 \ClassError{scrguide}{missmatch repository date string}{%
145 It seams, that you haven't used $%
146 Date: YYYY-MM-DD $ for the date of \string\KOMAProvidesFile.}%
147 \ProvidesFile{#1}[$#2: #3/#4/#5 \detokenize{#6}$\detokenize{#7}]\relax
148 }%
149 }
150 % \end{macrocode}
151 % \end{macro}
152 % \end{macro}
153 % \begin{macrocode}
154 \LoadClassWithOptions{scrbook}
155 \RequirePackage[TS1,T1]{fontenc}
156 \newcommand*{\strngerman}{ngerman}
157 \newcommand*{\strenglish}{english}
158 \edef\reserved@a{\languagename}%
159 \@onelevel@sanitize\reserved@a
160 \@onelevel@sanitize\strngerman
161 \@onelevel@sanitize\strenglish
162 \edef\languages{\ifx\reserved@a\strngerman main=\fi ngerman,%
163 \ifx\reserved@a\strenglish main=\fi english}
164 \edef\uselanguage{\languagename}
165 \expandafter\RequirePackage\expandafter[\languages]{babel}%
166 \AtBeginDocument{%
167 \edef\reserved@a{\languagename}%
168 \@onelevel@sanitize\reserved@a
169 \typeout{TRACE: Current language is `\reserved@a`.}%
170 \ifx\reserved@a\strngerman
171 \newcommand*{\shortlang}{de}%
172 \else
173 \newcommand*{\shortlang}{en}%
174 \fi
175 }
176 \newcommand*{\linclude}[1]{\include{#1-\shortlang}}
177 % \end{macrocode}
178 % In future we should use biblatex instead of babelbib, but currently some
179 % things are still missing:
180 % \begin{itemize}
181 % \item line breaks after the author (but not full \texttt{openbib} style like
182 % \texttt{block=nbpar}),
183 % \item removing language tag \texttt{ngerman} from output.
184 % \end{itemize}
185 % So currently we still use babelbib.
186 % \begin{macrocode}
187 \newif\ifusebabelbib\usebabelbibtrue % Should be deactivated soon
188 \ifusebabelbib
189 \RequirePackage[fixlanguage]{babelbib}
190 \newcommand*{\printbibliography}[1][]{\bibliography{scrguide}}
191 \else
192 \RequirePackage[backend=bibtex,style=alphabetic,block=ragged]{biblatex}
193 \DeclareSourcemap{
194 \maps[datatype=bibtex]{
195 \map{
196 \step[fieldsource=url, final=true]
197 \step[fieldset=verba, origfieldval, final=true]
198 \step[fieldsource=verba, match=\regexp{CTAN:\/\/}, replace={https://www.ctan.org/}]
199 }
200 }
201 }
202 \DeclareFieldFormat{url}{%
203 \href{\thefield{verba}}{\nolinkurl{#1}}%
204 }
205 \fi
206 \RequirePackage{afterpage}
207 \RequirePackage{makeidx}
208 \RequirePackage{scrdate}
209 \RequirePackage{scrtime}
210 \RequirePackage{picture}
211 \RequirePackage{graphicx}
212 \RequirePackage{booktabs}
213 \RequirePackage{longtable}
214 \RequirePackage{amsmath}
215 \RequirePackage{listings}
216 \RequirePackage{multicol}
217 \RequirePackage{marginnote}
218 \RequirePackage{tabularx}
219 \RequirePackage{mparhack}%
220 % \end{macrocode}
221 %
222 % \section{Dependence from \KOMAScript{} Version}
223 %
224 % \begin{macro}{currentversionlt}
225 \newcommand*{\currentversionlt}[1]{%
226 \expandafter\ifx\csname scr@v@#1\endcsname\relax \maxdimen
227 \else\csname scr@v@#1\endcsname\fi >\scr@compatibility\relax
228 }
229 % \end{macrocode}
230 % \end{macro}
231 %
232 % \section{Free or Non-Free Version}
233 %
234 % \begin{macrocode}
235 \newif\ifshortversion\shortversionfalse
236 \InputIfFileExists{scrnonfree.tex}{}{%
237 \RequirePackage[svgnames]{xcolor}%
238 \RequirePackage{tikz}%
239 \usetikzlibrary{decorations}%
240 \usetikzlibrary{arrows}%
241 \usetikzlibrary{calc}%
242 \RequirePackage[\uselanguage]{hyperref}%
243 \RequirePackage[open,openlevel=0]{bookmark}% improved pdf bookmarks
244 \typeout{^^J
245 ----------------------------------------------------------------------^^J
246 FREE VERSION OF THE KOMA-SCRIPT GUIDE.^^J
247 NOTE THAT THIS VERSION MAY BE FULL OF UGLY PARAGRAPH AND PAGE BREAKS.^^J
248 THIS IS BECAUSE THIS VERSION OF THE KOMA-SCRIPT GUIDE IS UNDER^^J
249 CONSTRUCTION FOREVER.^^J
250 ----------------------------------------------------------------------^^J
251 ^^J%
252 }%
253 \newcommand*{\iffree}{\@firstoftwo}%
254 \newcommand*{\important}[2][]{}%
255 \newcommand*{\textnote}[2][]{}%
256 \shortversiontrue
257 \newcommand*{\LoadNonFree}[2]{\par\GuideLoadNonFree\par}%
258 \AtBeginDocument{\InputIfFileExists{linkalias.tex}{}{}}%
259 \usepackage{lmodern}%
260 \@twosidefalse\@openrightfalse\@mparswitchfalse
261 \RequirePackage{geometry}%
262 \geometry{papersize={180mm,210mm},%
263 includehead,includemp,reversemp,marginparwidth=4em,%
264 vmargin={1.5mm,3mm},hmargin=1.75mm}%
265 \RequirePackage{scrlayer-scrpage}%
266 \clearpairofpagestyles
267 \ihead{%
268 \smash{%
269 \hspace*{.5em}\rule[-\dp\strutbox]{0pt}{\headheight}\headmark
270 }%
271 }%
272 \ohead*{\smash{\pagemark\hspace{2mm}}}%
273 \colorlet{headbackground}{DarkBlue}%
274 \colorlet{headline}{white}%
275 \setkomafont{pageheadfoot}{\small\sffamily\bfseries\color{headline}}%
276 \setkomafont{pagenumber}{}%
277 \DeclareNewLayer[head,background,
278 hoffset=0pt,
279 width=\paperwidth,
280 addheight=\dimexpr \topmargin+1in+\dp\strutbox\relax,
281 addvoffset=2\dp\strutbox,
282 contents={%
283 \color{headbackground}\rule{\layerwidth}{\layerheight}}]
284 {headbackground}%
285 \AddLayersAtBeginOfPageStyle{scrheadings}{headbackground}%
286 \renewcommand*{\chaptermark}[1]{%
287 \@mkdouble{\Ifnumbered{chapter}{\chaptermarkformat}{}##1}%
288 }%
289 \renewcommand*{\chaptermarkformat}{%
290 \makebox[\dimexpr \oddsidemargin+1in-.5em][r]{%
291 \chapapp~\thechapter:~%
292 }%
293 }%
294 \renewcommand*{\chapterformat}{}%
295 \renewcommand*{\chapterpagestyle}{scrheadings}%
296 \setlength{\@tempdimc}{\oddsidemargin}%
297 \addtolength{\@tempdimc}{1in}%
298 \KOMAoptions{headwidth=paper:-\@tempdimc}%
299 % Entweder:
300 \hypersetup{colorlinks,citecolor=Green,linkcolor=Crimson,urlcolor=Blue}%
301 % oder:
302 % \hypersetup{pdfborderstyle={/S/U/W 1}}%
303 \let\orig@maketitle\maketitle
304 \def\maketitle{%
305 \begingroup
306 \@twosidetrue
307 \let\cleardoublepage\clearpage
308 \addtolength{\oddsidemargin}{\evensidemargin}%
309 \setlength{\evensidemargin}{.5\oddsidemargin}%
310 \setlength{\oddsidemargin}{\evensidemargin}%
311 \orig@maketitle\relax
312 \endgroup
313 }%
314 \renewcommand*{\chapterheadstartvskip}{}%
315 \raggedbottom
316 \sloppy
317 \lstset{breaklines,prebreak=\mbox{$\hookleftarrow$}}%
318 }%
319 % \end{macrocode}
320 %
321 % Now loading the last package (better do it late than never):
322 % \begin{macrocode}
323 \RequirePackage{textcomp}
324 % \end{macrocode}
325 %
326 % \section{Load common paragraphs}
327 %
328 % \begin{macrocode}
329 \newcommand*{\ThisCommonFile}{}%
330 \newcommand*{\ThisCommonLabelBase}{}
331 \newcommand*{\IfThisCommonLabelBase}[1]{%
332 \expandafter\Ifstr\expandafter{\ThisCommonLabelBase}{#1}%
333 \@firstoftwo\@secondoftwo
334 }
335 \newcommand*{\IfThisCommonLabelBaseOneOf}[1]{%
336 \begingroup
337 \@tempswafalse
338 \@for \reserved@a:=#1\do{%
339 \expandafter\IfThisCommonLabelBase\expandafter{\reserved@a}%
340 {\@tempswatrue}{}%
341 }%
342 \if@tempswa
343 \aftergroup\@firstoftwo
344 \else
345 \aftergroup\@secondoftwo
346 \fi
347 \endgroup
348 }
349 \newcommand*{\IfThisCommonLabelBaseNotOneOf}[1]{%
350 \begingroup
351 \@tempswafalse
352 \@for \reserved@a:=#1\do{%
353 \expandafter\IfThisCommonLabelBase\expandafter{\reserved@a}%
354 {\@tempswatrue}{}%
355 }%
356 \if@tempswa
357 \aftergroup\@secondoftwo
358 \else
359 \aftergroup\@firstoftwo
360 \fi
361 \endgroup
362 }
363 \newcommand*{\ThisCommonFirstLabelBase}{%
364 \@nameuse{CommonFile@\ThisCommonFile @LabelBase}%
365 }
366 \newif\ifthiscommonfirst
367 \newcommand*{\IfThisCommonFirstRun}{%
368 \ifthiscommonfirst \expandafter\@firstoftwo
369 \else \expandafter\@secondoftwo \fi
370 }
371 \newcommand*{\LoadCommonFile}[1]{%
372 \Ifstr{\ThisCommonFile}{}{%
373 \def\ThisCommonFile{#1}%
374 \let\ThisCommonLabelBase\label@base
375 \@ifundefined{CommonFile@\ThisCommonFile @LabelBase}{%
376 \expandafter\let\csname CommonFile@\ThisCommonFile @LabelBase\endcsname
377 \ThisCommonLabelBase
378 \thiscommonfirsttrue
379 }{\thiscommonfirstfalse}%
380 \input{common-\ThisCommonFile-\shortlang.tex}%
381 \thiscommonfirstfalse
382 \let\ThisCommonLabelBase\@empty
383 \let\ThisCommonFile\@empty
384 }{%
385 \ClassError{scrguide}{recursive \string\LoadCommon}{%
386 You can not use \string\LoadCommon\space inside another
387 common file.%
388 }%
389 }%
390 }
391 \newcommand*{\InternalCommonFileUsageError}{%
392 \GenericError{%
393 (common-\ThisCommonFile-\shortlang.tex)\@spaces
394 }{%
395 Common File common-\ThisCommonFile-\shortlang.tex Error: Unprepared usage%
396 }{%
397 You have to prepare the file for the label base \ThisCommonLabelBase.%
398 }{}%
399 }
400 % \end{macrocode}
401 %
402 % \section{Language Dependencies}
403 %
404 % We load the language dependency file at |\begin{document}| and add some
405 % of the extensions to the language.
406 % \begin{macrocode}
407 \AtBeginDocument{%
408 \InputIfFileExists{terms-\shortlang.tex}{%
409 \ClassInfo{scrguide}{Loading language dependencies for \languagename}%
410 }{%
411 \ClassError{scrguide}{\languagename\space not supported}{%
412 You've tried to generate a guide for language `\languagename' but
413 language\MessageBreak
414 dependency file `terms-\shortlang.tex' was not found.\MessageBreak
415 This may result in a lot of errors and warnings, if you'll continue}%
416 }%
417 \expandafter\addto\csname extras\uselanguage\endcsname
418 \GuideLanguageExtensions\GuideLanguageExtensions
419 }
420 % \end{macrocode}
421 %
422 %
423 % \section{Breaking of Paragraphs and Pages}
424 %
425 % There are several parameters to configure the breaking. I've tried to find
426 % good values. First of all the placement of floats and text.
427 % \begin{macrocode}
428 \renewcommand*{\floatpagefraction}{.75}% was .6
429 \renewcommand*{\textfraction}{.2}% original
430 \renewcommand*{\topfraction}{.75}% was .7
431 \renewcommand*{\bottomfraction}{.33}% was .3
432 \setcounter{topnumber}{1}% was 2
433 \setcounter{bottomnumber}{1}% original
434 \setcounter{totalnumber}{3}% original
435 % \end{macrocode}
436 %
437 %
438 % \section{Find the Date of the Newest Documentation File}
439 %
440 % \begin{macro}{\newestfiledate}
441 % The latex date of the newest used file.
442 % \begin{macrocode}
443 \newcommand*{\newestfiledate}{0001-01-01}
444 % \end{macrocode}
445 % \end{macro}
446 %
447 % \begin{macro}{\@notonlypreamble}
448 % Remove commands from to be \@onlypreamble commands.
449 % \begin{macrocode}
450 \newcommand*{\@notonlypreamble}[1]{%
451 \begingroup
452 \let\new@preamblecmds\@empty%
453 \def\do##1{\ifx ##1#1\else
454 \expandafter\def\expandafter\new@preamblecmds\expandafter{%
455 \new@preamblecmds\do##1}\fi}%
456 \@preamblecmds
457 \global\let\@preamblecmds\new@preamblecmds
458 \endgroup
459 }
460 % \end{macrocode}
461 % \end{macro}
462 %
463 % \begin{macro}{\@ifl@t@r}
464 % Not longer a |\@onlypreamble| command.
465 % \begin{macrocode}
466 \@notonlypreamble\@ifl@t@r
467 % \end{macrocode}
468 % \end{macro}
469 %
470 % \begin{macro}{\@parse@version}
471 % Not longer a |\@onlypreamble| command.
472 % \begin{macrocode}
473 \@notonlypreamble\@parse@version
474 % \end{macrocode}
475 % \end{macro}
476 %
477 % \begin{macro}{\@latex@version}
478 % Like |\@parse@version| but returns a \LaTeX{} date.
479 % \begin{macrocode}
480 \newcommand*{\@latex@version}{}
481 \def\@latex@version#1/#2/#3#4#5\@nil{#1/#2/#3#4}
482 % \end{macrocode}
483 % \end{macro}
484 %
485 % \begin{macro}{\@iso@version}
486 % Like |\@parse@version| but returns an iso date.
487 % \begin{macrocode}
488 \newcommand*{\@iso@version}{}
489 \def\@iso@version#1/#2/#3#4#5\@nil{#1-#2-#3#4}
490 % \end{macrocode}
491 % \end{macro}
492 %
493 % \begin{macro}{\IsoDate}
494 % Converts \LaTeX{} date #1 into an iso date.
495 % \begin{macrocode}
496 \newcommand*{\IsoDate}[1]{\expandafter\@iso@version#1//00\@nil}
497 % \end{macrocode}
498 % \end{macro}
499 %
500 % \begin{macro}{\@CheckDate}
501 % Check if the provided date of file #1.tex is newer than
502 % \@newestfiledate. If so, write the new date to the aux file.
503 % \begin{macrocode}
504 \newcommand*{\@CheckDate}[1]{%
505 \begingroup
506 \expandafter\ifx\csname ver@#1.tex\endcsname\relax\else
507 \typeout{\csname ver@#1.tex\endcsname}%
508 \expandafter\@ifl@t@r\csname ver@#1.tex\endcsname\newestfiledate{%
509 \xdef\newestfiledate{%
510 \expandafter\expandafter\expandafter\@latex@version
511 \csname ver@#1.tex\endcsname//00\@nil%
512 }%
513 \write\@auxout{\noexpand\gdef\noexpand\newestfiledate{%
514 \newestfiledate}\@percentchar\space #1.tex}%
515 }{}%
516 \fi
517 \endgroup
518 }
519 % \end{macrocode}
520 % \end{macro}
521 %
522 % Check the date of the jobfile:
523 % \begin{macrocode}
524 \@CheckDate\jobname
525 % \end{macrocode}
526 %
527 % \begin{macro}{\@providesfile}
528 % \begin{macro}{\SCR@providesfile}
529 % Redefine |\ProvidesFile| to also check the date.
530 % \begin{macrocode}
531 \newcommand*{\SCR@providesfile}{}
532 \AtBeginDocument{%
533 \let\SCR@providesfile\@providesfile
534 \def\@providesfile#1[#2]{%
535 \SCR@providesfile#1[#2]%
536 \expandafter\@CheckDate\expandafter{\expandafter\@BaseFileName#1.\@nil}%
537 }%
538 }
539 % \end{macrocode}
540 % \begin{macro}{\@BaseFileName}
541 % Split of extension of the file name.
542 % \begin{macrocode}
543 \newcommand*{\@BaseFileName}{}
544 \def\@BaseFileName#1.#2\@nil{#1}
545 % \end{macrocode}
546 % \end{macro}
547 % \end{macro}
548 % \end{macro}
549 %
550 % Predefine current date:
551 % \begin{macrocode}
552 \AtBeginDocument{\date{\IsoDate\newestfiledate}}
553 % \end{macrocode}
554 %
555 %
556 % \section{Collect All Translators}
557 %
558 % At the translated guides, the translators should also be shown somewhere at
559 % the title.
560 %
561 % \begin{macro}{\translator}
562 % \changes{v0.9d}{2007/09/18}{new}
563 % This macro is used, so save one or more translators into the aux file.
564 % \begin{macrocode}
565 \newcommand*{\translator}[1]{%
566 \protected@write\@auxout{\def\and{,}}{%
567 \protect\@addtranslators{#1}%
568 }%
569 }
570 % \end{macrocode}
571 % \begin{macro}{\@translator}
572 % \begin{macro}{\@addtranslator}
573 % And we need macros so store the translators
574 % \begin{macrocode}
575 \newcommand*{\@translator}{}
576 % \end{macrocode}
577 % and to read the translators from the aux file.
578 % \begin{macrocode}
579 \newcommand*{\@addtranslators}[1]{%
580 \ifx\@translator\@empty\else\g@addto@macro\@translator{,}\fi
581 \g@addto@macro\@translator{#1}%
582 }
583 % \end{macrocode}
584 % \end{macro}
585 % \end{macro}
586 % \end{macro}
587 %
588 %
589 % \begin{macro}{\settranslator}
590 % \changes{v0.9d}{2007/09/18}{new}
591 % Last but not least, we need a macro to set the list of translators.
592 % \begin{macrocode}
593 \newcommand{\settranslator}[2]{%
594 \ifx\@translator\@empty\else
595 #1%
596 \begingroup
597 % \end{macrocode}
598 % Run through all translators, but store each once only.
599 % \begin{macrocode}
600 \let\@tempb\@empty
601 \@tempcnta=\z@
602 \expandafter\@for \expandafter\@tempa\expandafter:\expandafter=%
603 \@translator\do {%
604 \ifx\@tempa\@empty\else
605 %<trace> \typeout{Test: `,\@tempa,' at `,\@tempb,'}%
606 \@expandtwoargs\in@{,\@tempa,}{,\@tempb,}%
607 \ifin@\else
608 \edef\@tempb{\@tempb\@tempa,}%
609 \advance\@tempcnta by 1\relax
610 \fi
611 \fi
612 }%
613 % \end{macrocode}
614 % Set each of the stored translators.
615 % \begin{macrocode}
616 \@tempcntb=\z@
617 \expandafter\@for \expandafter\@tempa\expandafter:\expandafter=%
618 \@tempb\do {%
619 \ifx\@tempa\@empty\else
620 \advance\@tempcntb by 1\relax
621 \typeout{Translator \the\@tempcntb: \@tempa}%
622 \ifnum\@tempcntb >\@ne\relax
623 \ifnum\@tempcntb=\@tempcnta\relax
624 \ifnum\@tempcntb=\tw@\relax
625 \GuideAnd
626 \else
627 \GuideListAnd
628 \fi
629 \else
630 ,
631 \fi
632 \fi
633 \@tempa
634 \fi
635 }%
636 \endgroup
637 #2%
638 \fi
639 }
640 % \end{macrocode}
641 % \end{macro}
642 %
643 % \section{Emphasization and Fonts}
644 %
645 % The \KOMAScript{} guide uses a lot of emphasizations. Most of them are
646 % declared robustly to avoid problems at index, change log etc.
647 %
648 % We need some colors for emphasizing in images:
649 % \begin{macrocode}
650 \colorlet{ImageRed}{Crimson}%
651 \colorlet{ImageBlue}{Blue}%
652 \colorlet{ImageGreen}{Green}%
653 \colorlet{ImageYellow}{Yellow}%
654 % \end{macrocode}
655 %
656 % \begin{macro}{\textsfrm}
657 % Something like |\emph| using |\textsf| and |\textrm| instead of |\textit|
658 % and |\textup|.
659 % \begin{macrocode}
660 \newcommand*{\textsfrm}[1]{%
661 \begingroup
662 \edef\@tempa{\sfdefault}%
663 \ifx\@tempa\f@family\textrm{#1}\else\textsf{#1}\fi
664 \endgroup
665 }
666 % \end{macrocode}
667 % \end{macro}
668 %
669 % \begin{macro}{\File}
670 % \changes{v1.25}{2021/02/11}{usage of \cs{texorpdfstring}}
671 % \begin{macro}{\Class}
672 % \changes{v1.25}{2021/02/11}{usage of \cs{texorpdfstring}}
673 % \begin{macro}{\Package}
674 % \changes{v1.25}{2021/02/11}{usage of \cs{texorpdfstring}}
675 % Some markup macros for files with special meanings.
676 \DeclareRobustCommand*{\File}[1]{\texorpdfstring{\mbox{\texttt{#1}}}{#1}}
677 \DeclareRobustCommand*{\Class}[1]{\texorpdfstring{\mbox{\textsfrm{#1}}}{#1}}
678 \DeclareRobustCommand*{\Package}[1]{\texorpdfstring{\mbox{\textsfrm{#1}}}{#1}}
679 % \end{macro}
680 % \end{macro}
681 % \end{macro}
682 %
683 % \begin{macro}{\DeclareSpecialMarkup}
684 % Command to declare special markup commands, that behave different in- and
685 % outside |Description| environment. Parameters are:
686 % \begin{declaration}
687 % \item[\arg{command}:] The the markup command, that should be defined.
688 % \item[\arg{outside definition}:] Definition of the markup command
689 % outside |Description| environment.
690 % \item[\arg{inside definition}:] Definition of the markup command inside
691 % |Description| environment.
692 % \item{\oarg{inside end definition}:] Definition of the \cs{end} command,
693 % if inside |Description| an markup environment instead of an markup
694 % command would be used.
695 % \end{declaration}
696 % At the end color \meta{command name} will be black and \cs{\meta{command
697 % name}}, \cs{text\meta{command name}, \cs{Desc\meta{command name}}, and
698 % optionally \cs{endDesc\meta{command name} will be defined, with
699 % \cs{\meta{command name}} is \meta{command}.
700 % \begin{macrocode}
701 \newcommand\DeclareSpecialMarkup[3]{%
702 \newcommand*#1{}%
703 \expandafter\colorlet\expandafter{\expandafter\@gobble\string#1}{black}%
704 \expandafter\newcommand\expandafter*%
705 \csname text\expandafter\@gobble\string #1\endcsname[1]{#2}%
706 \expandafter\DeclareRobustCommand\expandafter*\expandafter#1\expandafter{%
707 \csname text\expandafter\@gobble\string #1\endcsname}%
708 \expandafter\newcommand\expandafter*%
709 \csname Desc\expandafter\@gobble\string #1\endcsname[1]{#3}%
710 \kernel@ifnextchar [%
711 {\expandafter\@optdef
712 \csname endDesc\expandafter\@gobble\string #1\endcsname}%
713 {}%]
714 }
715 % \end{macrocode}
716 % \begin{macro}{\@optdef}
717 % Helper to define a macro via optional instead of mandatory argument
718 \newcommand*{\@optdef}{}
719 \long\def\@optdef#1[#2]{\def#1{#2}}
720 % \end{macrocode}
721 % \end{macro}
722 % \end{macro}
723 %
724 % \begin{macro}{\Macro}
725 % \changes{v1.25}{2021/02/11}{usage of \cs{texorpdfstring}}
726 % \begin{macro}{\Option}
727 % \begin{macro}{\KOption}
728 % \begin{macro}{\OptionValue}
729 % \begin{macro}{\Environment}
730 % \begin{macro}{\Counter}
731 % \begin{macro}{\Length}
732 % \changes{v1.25}{2021/02/11}{usage of \cs{texorpdfstring}}
733 % \begin{macro}{\PLength}
734 % \changes{v1.17}{2019/10/24}{\cs{setplength} verschoben}%^^A
735 % \begin{macro}{\FloatStyle}
736 % \begin{macro}{\PageStyle}
737 % \begin{macro}{\Variable}
738 % \begin{macro}{\FontElement}
739 % \begin{macro}{\DoHook}
740 % \changes{v1.14}{2019/02/20}{neu}%^^A
741 % \begin{macro}{\PName}
742 % \begin{macro}{\PValue}
743 % \begin{macro}{\Parameter}
744 % \begin{macro}{\OParameter}
745 % \begin{macro}{\AParameter}
746 % \begin{macro}{\PParameter}
747 % \begin{macro}{\POParameter}
748 % \begin{description}
749 % \item[\cs{Macro}] \LaTeX{} or \TeX{} macro
750 % \item[\cs{Option}] class or package option
751 % \item[\cs{KOption}] |\KOMAoptions| option
752 % \item[\cs{Environment}] \LaTeX{} environment
753 % \item[\cs{Counter}] \LaTeX{} counter
754 % \item[\cs{Length}] \LaTeX{} length
755 % \item[\cs{PLength}] \KOMAScript{} pseudo length
756 % \item[\cs{Variable}] \KOMAScript{} variable
757 % \item[\cs{FontElement}] \KOMAScript{} element that has its own font
758 % selection
759 % \item[\cs{PName}] name of a parameter of a macro or environment
760 % \item[\cs{PValue}] value of a parameter of a macro or environment
761 % \item[\cs{Parameter}] the mandatory parameter of a macro or environment
762 % \item[\cs{OParameter}] the optional parameter of a macro or environment
763 % \item[\cs{AParameter}] the alternativ parameter of a macro or environment
764 % \item[\cs{PParameter}] the part-of-command parameter of a macro or
765 % environment
766 % \end{description}
767 % \begin{macrocode}
768 \newcommand*{\LabelMacro}[2][\label@suffix]{%
769 \begingroup
770 \protected@edef\@currentlabel{\Macro{#2}}%
771 \label@sanitize
772 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
773 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
774 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
775 \label{\label@desc@prefix\[email protected].#2#1}%
776 \endgroup
777 }
778 \DeclareRobustCommand*{\DescRef}{%
779 \kernel@ifstar {\@DescRef*}{\@DescRef\@empty}%
780 }
781 \newcommand*{\@DescRef}[2]{\expandafter\ref#1{\label@desc@prefix#2}}
782 \DeclareRobustCommand*{\DescPageRef}{%
783 \kernel@ifstar {\@DescPageRef*}{\@DescPageRef\space}%
784 }
785 \newcommand*{\@DescPageRef}[2]{\expandafter\autopageref#1{\label@desc@prefix#2}}
786 \DeclareSpecialMarkup{\Macro}{%
787 \texorpdfstring{\mbox{\texttt{\char`\\#1}}}{\textbackslash#1}%
788 }{%
789 \par
790 \settowidth{\leftskip}{\textMacro{#1}}% indent from left
791 \hskip-\leftskip
792 \BeginIndex{Cmd}{#1}% index entry
793 \LabelMacro{#1}%
794 \textMacro{#1}%
795 }
796 \newcommand*{\LabelOption}[2][\label@suffix]{%
797 \begingroup
798 \protected@edef\@currentlabel{\Option{#2}}%
799 \label@sanitize
800 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
801 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
802 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
803 \expandafter\gdef
804 \csname \label@desc@prefix\[email protected].#2#1\endcsname{}%
805 \label{\label@desc@prefix\[email protected].#2#1}%
806 \endgroup
807 }
808 \DeclareSpecialMarkup{\Option}{\mbox{\texttt{#1}}}{%
809 \par
810 \leftskip\z@
811 \BeginIndex{Option}{#1}% index entry
812 \LabelOption{#1}%
813 \textOption{#1}%
814 }
815 \DeclareSpecialMarkup{\KOption}{%
816 \mbox{\textOption{#1=}}\linebreak[0]%
817 }{%
818 \ClassWarning{scrguide}{You should replace
819 \string\KOption{#1}\string\PName{...}\MessageBreak
820 by \string\OptionVName{#1}{...}}%
821 \par
822 \leftskip\z@
823 \BeginIndex{Option}{#1}% index entry
824 \begingroup
825 \@nameuse{phantomsection}%
826 \label@sanitize
827 \expandafter\gdef
828 \csname \label@desc@prefix\[email protected].#1\label@suffix\endcsname{}%
829 \label{\label@desc@prefix\[email protected].#1\label@suffix}%
830 \endgroup
831 \textOption{#1=}%
832 }
833 \newcommand*{\maybelinebreak}{%
834 \ifvmode\else
835 \ifnum\lastpenalty<\z@\else
836 \ifnum\lastpenalty<\@medpenalty
837 \hskip\z@skip
838 \fi
839 \fi
840 \fi
841 }
842 \DeclareRobustCommand*{\textKValue}[1]{\maybelinebreak\mbox{\texttt{#1}}}
843 \newcommand*{\KValue}{}
844 \let\KValue\textKValue
845 \newcommand*{\textOptionValue}[2]{%
846 \textKOption{#1}\textKValue{#2}%
847 }
848 \DeclareRobustCommand*{\OptionValue}{\textOptionValue}%
849 \newcommand*{\LabelOptionValue}[3][\label@suffix]{%
850 \begingroup
851 \protected@edef\@currentlabellong{\OptionValue{#2}{#3}}%
852 \protected@edef\@currentlabelshort{\Option{#2}}%
853 \label@sanitize
854 \scr@ifundefinedorrelax{%
855 \label@desc@prefix\[email protected].#2\label@suffix
856 }{%
857 \expandafter\gdef
858 \csname \label@desc@prefix\[email protected].#2\label@suffix\endcsname{}%
859 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
860 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
861 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
862 \let\@currentlabel\@currentlabelshort
863 \label{\label@desc@prefix\[email protected].#2#1}%
864 }{}%
865 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2.#3#1}%
866 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
867 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
868 \let\@currentlabel\@currentlabellong
869 \label{\label@desc@prefix\[email protected].#2.#3#1}%
870 \endgroup
871 }
872 % \end{macrocode}
873 % \begin{macro}{\OptionValueRef}
874 % \cs{OptionValue} by reference. Use it like
875 % |\OptionValueRef[suffix]{maincls}{version}{3.20}|.
876 % \begin{macrocode}
877 \newcommand*{\OptionValueRef}{%
878 \kernel@ifstar {\@RefOptionValue0}{\@RefOptionValue1}%
879 }
880 \newcommand*{\@RefOptionValue}[1]{%
881 \kernel@ifnextchar [%]
882 {\@@RefOptionValue#1}{\@@RefOptionValue#1[]}%
883 }
884 \newcommand*{\@@RefOptionValue}{}
885 \def\@@RefOptionValue#1[#2]#3#4#5{%
886 \scr@ifundefinedorrelax{r@\label@desc@prefix#3.option.#4.#5#2}{%
887 \ifcase #1
888 \expandafter\scr@no@hyperref
889 \else
890 \expandafter\hyperref
891 \fi
892 [\label@desc@prefix#3.option.#4#2]%
893 {\OptionValue{\ref*{\label@desc@prefix#3.option.#4#2}}{#5}}%
894 }{%
895 \expandafter\ref\ifcase #1 *\fi{\label@desc@prefix#3.option.#4.#5#2}%
896 }%
897 }
898 \newcommand*{\scr@no@hyperref}[2][]{#2}
899 % \end{macrocode}
900 % \end{macro}
901 % \begin{macrocode}
902 \newcommand*{\DescOptionValue}[2]{%
903 \par
904 \leftskip\z@
905 \BeginIndex{Option}{#1}%
906 \BeginIndex{Option}{#1~=\KValue{#2}}%
907 \LabelOptionValue{#1}{#2}%
908 \textOptionValue{#1}{#2}%
909 }
910 \newcommand*{\textOptionVName}[2]{%
911 \textKOption{#1}\PName{#2}%
912 }
913 \DeclareRobustCommand*{\OptionVName}{\textOptionVName}%
914 \newcommand*{\LabelOptionVName}[3][\label@suffix]{%
915 \begingroup
916 \protected@edef\@currentlabellong{\OptionVName{#2}{#3}}%
917 \protected@edef\@currentlabelshort{\Option{#2}}%
918 \label@sanitize
919 \scr@ifundefinedorrelax{%
920 \label@desc@prefix\[email protected].#2\label@suffix
921 }{%
922 \expandafter\gdef
923 \csname \label@desc@prefix\[email protected].#2\label@suffix\endcsname{}%
924 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
925 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
926 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
927 \let\@currentlabel\@currentlabelshort
928 \label{\label@desc@prefix\[email protected].#2#1}%
929 }{}%
930 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2=#3#1}%
931 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
932 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
933 \let\@currentlabel\@currentlabellong
934 \label{\label@desc@prefix\[email protected].#2=#3#1}%
935 \endgroup
936 }
937 % \end{macrocode}
938 % \begin{macro}{\OptionVNameRef}
939 % \cs{OptionVName} by reference. Use it like
940 % |\OptionVNameRef[suffix]{maincls}{version}{value}|.
941 % \begin{macrocode}
942 \newcommand*{\OptionVNameRef}{%
943 \kernel@ifstar {\@RefOptionVName0}{\@RefOptionVName1}%
944 }
945 \newcommand*{\@RefOptionVName}[1]{%
946 \kernel@ifnextchar [%]
947 {\@@RefOptionVName#1}{\@@RefOptionVName#1[]}%
948 }
949 \newcommand*{\@@RefOptionVName}{}
950 \def\@@RefOptionVName#1[#2]#3#4#5{%
951 \scr@ifundefinedorrelax{r@\label@desc@prefix#3.option.#4=#5#2}{%
952 \ifcase #1
953 \expandafter\scr@no@hyperref
954 \else
955 \expandafter\hyperref
956 \fi
957 [\label@desc@prefix#3.option.#4#2]%
958 {\OptionVName{\ref*{\label@desc@prefix#3.option.#4#2}}{#5}}%
959 }{%
960 \expandafter\ref\ifcase #1 *\fi{\label@desc@prefix#3.option.#4=#5#2}%
961 }%
962 }
963 % \end{macrocode}
964 % \end{macro}
965 % \begin{macrocode}
966 \newcommand*{\DescOptionVName}[2]{%
967 \par
968 \leftskip\z@
969 % \BeginIndex{Option}{#1}%
970 \BeginIndex{Option}{#1~=\PName{#2}}%
971 \LabelOptionVName{#1}{#2}%
972 \textOptionVName{#1}{#2}%
973 }
974 \newcommand*{\LabelFloatStyle}[2][\label@suffix]{%
975 \begingroup
976 \protected@edef\@currentlabel{\FloatStyle{#2}}%
977 \label@sanitize
978 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
979 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
980 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
981 \label{\label@desc@prefix\[email protected].#2#1}%
982 \endgroup
983 }
984 \DeclareSpecialMarkup{\FloatStyle}{\mbox{\texttt{#1}}}{%
985 \par
986 \leftskip\z@
987 \BeginIndex{Floatstyle}{#1}%
988 \LabelFloatStyle{#1}%
989 \textFloatStyle{#1}%
990 }
991 \newcommand*{\LabelPageStyle}[2][\label@suffix]{%
992 \begingroup
993 \protected@edef\@currentlabel{\PageStyle{#2}}%
994 \label@sanitize
995 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
996 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
997 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
998 \label{\label@desc@prefix\[email protected].#2#1}%
999 \endgroup
1000 }
1001 \DeclareSpecialMarkup{\PageStyle}{\mbox{\texttt{#1}}}{%
1002 \par
1003 \leftskip\z@
1004 \BeginIndex{Pagestyle}{#1}%
1005 \LabelPageStyle{#1}%
1006 \scr@ifundefinedorrelax{r@\label@desc@prefix maincls.cmd.pagestyle}{%
1007 \textMacro{pagestyle}%
1008 }{%
1009 \begingroup
1010 \let\Macro\textMacro
1011 \DescRef{maincls.cmd.pagestyle}%
1012 \endgroup
1013 }\PParameter{#1}%
1014 }
1015 \newcommand*{\LabelEnvironment}[2][\label@suffix]{%
1016 \begingroup
1017 \protected@edef\@currentlabel{\Environment{#2}}%
1018 \label@sanitize
1019 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1020 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1021 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1022 \label{\label@desc@prefix\[email protected].#2#1}%
1023 \endgroup
1024 }
1025 \DeclareSpecialMarkup{\Environment}{\mbox{\texttt{#1}}}{%
1026 \par
1027 \settowidth{\leftskip}{\textMacro{begin}\PParameter{#1}}% siehe Macro
1028 \hskip-\leftskip
1029 \BeginIndex{Env}{#1}%
1030 \LabelEnvironment{#1}%
1031 \textMacro{begin}\PParameter{#1}%
1032 \def\d@EnvironmentName{#1}% Umgebungsnamen merken für das Ende
1033 }[{%
1034 \ifvmode\hskip-\leftskip\else \unskip\,\dots\fi% \begin{…}…\end{…}
1035 \textMacro{end}\expandafter\PParameter\expandafter{\d@EnvironmentName}\par
1036 }]%
1037 \newcommand*{\LabelCounter}[2][\label@suffix]{%
1038 \begingroup
1039 \protected@edef\@currentlabel{\Counter{#2}}%
1040 \label@sanitize
1041 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1042 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1043 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1044 \label{\label@desc@prefix\[email protected].#2#1}%
1045 \endgroup
1046 }
1047 \DeclareSpecialMarkup{\Counter}{\mbox{\texttt{#1}}}{%
1048 \par
1049 \leftskip\z@
1050 \BeginIndex{Counter}{#1}%
1051 \LabelCounter{#1}%
1052 \textCounter{#1}%
1053 }
1054 \newcommand*{\LabelLength}[2][\label@suffix]{%
1055 \begingroup
1056 \protected@edef\@currentlabel{\Length{#2}}%
1057 \label@sanitize
1058 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1059 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1060 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1061 \label{\label@desc@prefix\[email protected].#2#1}%
1062 \endgroup
1063 }
1064 \DeclareSpecialMarkup{\Length}{%
1065 \texorpdfstring{\mbox{\texttt{\char`\\#1}}}{\textbackslash#1}%
1066 }{%
1067 \par
1068 \leftskip\z@
1069 \BeginIndex{Length}{#1}% index entry
1070 \LabelLength{#1}%
1071 \textLength{#1}%
1072 }
1073 \newcommand*{\LabelPLength}[2][\label@suffix]{%
1074 \begingroup
1075 \protected@edef\@currentlabel{\PLength{#2}}%
1076 \label@sanitize
1077 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1078 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1079 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1080 \label{\label@desc@prefix\[email protected].#2#1}%
1081 \endgroup
1082 }
1083 \DeclareSpecialMarkup{\PLength}{\mbox{\texttt{#1}}}{%
1084 \par
1085 \leftskip\z@
1086 \BeginIndex{PLength}{#1}%
1087 \LabelPLength{#1}%
1088 \scr@ifundefinedorrelax{%
1089 r@\label@desc@prefix scrlttr2.cmd.setplength}{%
1090 \textMacro{setplength}%
1091 }{%
1092 \begingroup
1093 \let\Macro\textMacro
1094 \DescRef{scrlttr2.cmd.setplength}%
1095 \endgroup
1096 }%
1097 \PParameter{#1}\Parameter{\lengthname}%
1098 }
1099 \newcommand*{\LabelVariable}[2][\label@suffix]{%
1100 \begingroup
1101 \protected@edef\@currentlabel{\Variable{#2}}%
1102 \label@sanitize
1103 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1104 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1105 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1106 \label{\label@desc@prefix\[email protected].#2#1}%
1107 \endgroup
1108 }
1109 \DeclareSpecialMarkup{\Variable}{\mbox{\texttt{#1}}}{%
1110 \par
1111 \leftskip\z@
1112 \BeginIndex{Variable}{#1}%
1113 \LabelVariable{#1}%
1114 \scr@ifundefinedorrelax{r@\label@desc@prefix scrlttr2.cmd.setkomavar}{%
1115 \textMacro{setkomavar}%
1116 }{%
1117 \begingroup
1118 \let\Macro\textMacro
1119 \DescRef{scrlttr2.cmd.setkomavar}%
1120 \endgroup
1121 }%
1122 \PParameter{#1}\OParameter{\descriptionname}%
1123 \Parameter{\contentname}%
1124 }
1125 \newcommand*{\LabelFontElement}[2][\label@suffix]{%
1126 \begingroup
1127 \protected@edef\@currentlabel{\FontElement{#2}}%
1128 \label@sanitize
1129 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1130 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1131 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1132 \label{\label@desc@prefix\[email protected].#2#1}%
1133 \endgroup
1134 }
1135 \DeclareSpecialMarkup{\FontElement}{\mbox{\texttt{#1}}}{%
1136 \par
1137 \leftskip\z@
1138 \BeginIndex{FontElement}{#1}%
1139 \LabelFontElement{#1}%
1140 \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.cmd.setkomafont}{%
1141 \scr@ifundefinedorrelax{r@\label@desc@prefix maincls.cmd.setkomafont}{%
1142 \textMacro{setkomafont}%
1143 }{%
1144 \begingroup
1145 \let\Macro\textMacro
1146 \DescRef{maincls.cmd.setkomafont}%
1147 \endgroup
1148 }%
1149 }{%
1150 \begingroup
1151 \let\Macro\textMacro
1152 \DescRef{\LabelBase.cmd.setkomafont}%
1153 \endgroup
1154 }%
1155 \PParameter{#1}\OParameter{\fontsettingname}%
1156 }
1157 \newcommand*{\LabelDoHook}[2][\label@suffix]{%
1158 \begingroup
1159 \renewcommand*{\PName}[1]{=##1=}%
1160 \ForDoHook{#2}{\Label@DoHook{#1}}%
1161 \endgroup
1162 }
1163 \newcommand*{\Label@DoHook}[3]{%
1164 \IfArgIsEmpty{#3}{\@firstofone}{%
1165 \scr@ifundefinedorrelax{dhr@\label@desc@prefix\[email protected].#2#1}{%
1166 \@firstofone
1167 }{%
1168 \@gobble
1169 }%
1170 }{%
1171 \protected@edef\@currentlabel{\DoHook{#2}}%
1172 \label@sanitize
1173 \Hy@MakeCurrentHref{\label@desc@prefix\[email protected].#2#1}%
1174 \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
1175 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
1176 \label{\label@desc@prefix\[email protected].#2#1}%
1177 \expandafter\gdef
1178 \csname dhr@\label@desc@prefix\[email protected].#2#1\endcsname{#3}%
1179 }%
1180 }
1181 \DeclareSpecialMarkup{\DoHook}{\mbox{\texttt{#1}}}{%
1182 \par
1183 \leftskip\z@
1184 \BeginIndex{DoHook}{#1}%
1185 \LabelDoHook{#1}%
1186 \scr@ifundefinedorrelax{[email protected]}{%
1187 \textMacro{ExecuteDoHook}%
1188 }{%
1189 \begingroup
1190 \let\Macro\textMacro
1191 \DescRef{scrbase.cmd.ExecuteDoHook}%
1192 \endgroup
1193 }%
1194 \PParameter{#1}%
1195 }
1196 \DeclareRobustCommand*{\PName}[1]{\texttt{\textit{#1}}}
1197 \DeclareRobustCommand*{\PValue}[1]{\texttt{#1}}
1198 \DeclareRobustCommand*{\Parameter}[1]{%
1199 \maybelinebreak\texttt{\{}\PName{#1}\texttt{\}}}
1200 \DeclareRobustCommand*{\OParameter}[1]{%
1201 \maybelinebreak\texttt{[%]
1202 }\PName{#1}\texttt{%[
1203 ]}}
1204 \DeclareRobustCommand*{\AParameter}[1]{%
1205 \maybelinebreak\texttt{(%)
1206 }\PName{#1}\texttt{%(
1207 )}}
1208 \DeclareRobustCommand*{\PParameter}[1]{\maybelinebreak\texttt{\{#1\}}}
1209 \DeclareRobustCommand*{\POParameter}[1]{\maybelinebreak\texttt{[#1]}}
1210 \newcommand\label@sanitize{%
1211 \renewcommand*{\"}[1]{##1e}%
1212 \renewcommand*{\IeC}[1]{\expandafter\@gobble\string##1}%
1213 \renewcommand*{\textup}[1]{##1}%
1214 \renewcommand*{\PName}[1]{/##1/}%
1215 }
1216 \newcommand*{\label@desc@prefix}{desc:}
1217 \newcommand*{\label@suffix}{}
1218 \newcommand*{\labelsuffix}[1][]{% Werden Dinge mehrfach dokumentiert benötigen
1219 % sie ein zusätzliches Unterscheidungsmerkmal
1220 % beim gesetzten Label.
1221 \IfArgIsEmpty{#1}{\let\label@suffix\@empty}{\edef\label@suffix{.#1}}%
1222 }
1223 % \end{macrocode}
1224 % \end{macro}
1225 % \end{macro}
1226 % \end{macro}
1227 % \end{macro}
1228 % \end{macro}
1229 % \end{macro}
1230 % \end{macro}
1231 % \end{macro}
1232 % \end{macro}
1233 % \end{macro}
1234 % \end{macro}
1235 % \end{macro}
1236 % \end{macro}
1237 % \end{macro}
1238 % \end{macro}
1239 % \end{macro}
1240 % \end{macro}
1241 % \end{macro}
1242 % \end{macro}
1243 %
1244 % \begin{macro}{\EMail}
1245 % An email adress.
1246 % \begin{macrocode}
1247 \DeclareRobustCommand*{\EMail}[1]{\textless #1\textgreater}
1248 % \end{macrocode}
1249 % \end{macro}
1250 % \begin{macro}{\TextEMail}
1251 % EMail address at the text.
1252 % \begin{macrocode}
1253 \DeclareRobustCommand*{\TextEMail}[1]{{\small\EMail{#1}}}
1254 % \end{macrocode}
1255 % \end{macro}
1256 %
1257 % Setup fonts for table and figure captions:
1258 % \begin{macrocode}
1259 \setkomafont{caption}{\normalcolor\small}
1260 % \end{macrocode}
1261 %
1262 %
1263 % \section{Footnotes}
1264 %
1265 % \begin{macro}{\thempfootnote}
1266 % \begin{macrocode}
1267 \renewcommand*{\thempfootnote}{\textit{\@arabic{\c@mpfootnote}}}
1268 % \end{macrocode}
1269 % \end{macro}
1270 %
1271 % \section{Math}
1272 %
1273 % I will not use real math. But there will be some »pseudo math code«. So I
1274 % need some macros for this.
1275 %
1276 % \begin{macro}{\Var}
1277 % Variables (in real math simply |$a$| will be |\Var{a}| in my math:
1278 % \begin{macrocode}
1279 \newcommand*{\Var}[1]{\ensuremath{\textit{#1}}}
1280 % \end{macrocode}
1281 % \end{macro}
1282 %
1283 % \begin{macro}{\Unit}
1284 % The unit of a length.
1285 % \begin{macrocode}
1286 \newcommand*{\Unit}[1]{\,\ifmmode \textrm{#1}\else #1\fi}
1287 % \end{macrocode}
1288 % \end{macro}
1289 %
1290 % Wie allow page breaks at display math.
1291 % \begin{macrocode}
1292 \allowdisplaybreaks[1]
1293 % \end{macrocode}
1294 %
1295 %
1296 % \section{Acronyms}
1297 %
1298 % \begin{macro}{\Script}
1299 % \begin{macro}{\ScriptII}
1300 % \begin{macrocode}
1301 \DeclareRobustCommand{\Script}{\Package{Script}}
1302 \DeclareRobustCommand{\ScriptII}{\Package{Script-2}}
1303 % \end{macrocode}
1304 % \end{macro}
1305 % \end{macro}
1306 %
1307 % \begin{macro}{\eTeX}
1308 % \changes{v1.25}{2021/02/16}{workaround for (temporary) changes in
1309 % \textsf{hyperref}}
1310 % This may already be defined.
1311 % \begin{macrocode}
1312 \providecommand*{\eTeX}{\ensuremath{\varepsilon}-\TeX}
1313 \AtBeginDocument{%
1314 \@ifundefined{textepsilon}{%
1315 \@ifundefined{pdfstringdef}{}{%
1316 \pdfstringdef{\textepsilon}{\ifHy@unicode\83\265\else e\fi}%
1317 }%%
1318 }{}%
1319 }
1320 \providecommand*{\NTS}{%
1321 \leavevmode\hbox{$\cal N\kern-0.35em\lower0.5ex\hbox{$\cal T$}%
1322 \kern-0.2emS$}}
1323 % \end{macrocode}
1324 % \end{macro}
1325 %
1326 %
1327 % \section{Identification}
1328 %
1329 % \begin{macro}{\LabelBase}
1330 % \begin{macro}{\labelbase}
1331 % \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
1332 % \begin{macrocode}
1333 \newcommand*{\labelbase}[1]{%
1334 \Ifstr{\label@base@sec}{unknown}{}{%
1335 \labelofbase[sec]{\label@[email protected]}%
1336 \gdef\label@base@sec{}%
1337 }%
1338 \renewcommand*{\label@base}{#1}%
1339 \label{cha:#1}%
1340 }
1341 % \end{macrocode}
1342 % \begin{macro}{\label@base}
1343 % \begin{macro}{\[email protected]}
1344 % \begin{macrocode}
1345 \newcommand*{\label@base}{unknown}
1346 \newcommand*{\label@base@sec}{}
1347 % \end{macrocode}
1348 % \end{macro}
1349 % \end{macro}
1350 % \end{macro}
1351 % \begin{macro}{\labelofbase}
1352 % Sets a label depending on \cs{label@base}. First optional argument is the
1353 % label prefix, second is the the label postfix.
1354 % \begin{macrocode}
1355 \newcommand*{\labelofbase}[2][lab]{%
1356 \label{#1:\label@base.#2}%
1357 }
1358 % \end{macrocode}
1359 % \begin{macro}{\prefix@ref}
1360 % Internal command to set a \cs{ref}, \cs{pageref}, or \cs{autoref} to an
1361 % label with prefix. Use it, e.g., like
1362 % |\label@base@ref{\autoref}{sec}{maincls.cmd.foo}|.
1363 % \begin{macrocode}
1364 \newcommand*{\prefix@ref}[3]{%
1365 #1{#2:#3}%
1366 }
1367 % \end{macrocode}
1368 % \end{macro}
1369 % \begin{macro}{\seclabel}
1370 % Sets a label of type section.
1371 % \begin{macrocode}
1372 \newcommand*{\seclabel}[1]{%
1373 \ifx\label@base@sec\@empty\else
1374 \labelofbase[sec]{\label@[email protected]}%
1375 \fi
1376 \xdef\label@base@sec{#1}%
1377 \labelofbase[sec]{#1}%
1378 }
1379 % \end{macrocode}
1380 % \end{macro}
1381 % \begin{macro}{\xmpllabel}
1382 % \begin{macro}{\Refxmpl}
1383 % \begin{macro}{\PageRefxmpl}
1384 % Sets a label of type example.
1385 % \begin{macrocode}
1386 \newcommand*{\xmpllabel}[1]{%
1387 \labelofbase[xmpl]{#1}%
1388 }
1389 \newcommand*{\Refxmpl}{%
1390 \kernel@ifstar {\prefix@ref{\autoref*}{xmpl}}%
1391 {\prefix@ref{\autoref}{xmpl}}%
1392 }
1393 \newcommand*{\PageRefxmpl}{%
1394 \kernel@ifstar {\prefix@ref{\autopageref*}{xmpl}}%
1395 {\prefix@ref{\autopageref}{xmpl}}%
1396 }
1397 % \end{macrocode}
1398 % \end{macro}
1399 % \end{macro}
1400 % \end{macro}
1401 % User command to get the current label base.
1402 % \begin{macrocode}
1403 \newcommand*{\LabelBase}{\@nameuse{label@base}}
1404 % \end{macrocode}
1405 % \end{macro}
1406 %
1407 % \section{Special Environments}
1408 %
1409 % \begin{environment}{Declaration}
1410 % Declaration of macros, environments, options, lengths, counters, pseudo
1411 % length, variables etc.\footnote{TODO: Redefining most declaration commands
1412 % to also write labels.}
1413 % \begin{macrocode}
1414 \colorlet{Declaration}{PaleTurquoise}
1415 \newsavebox\Declaration@Box
1416 \newcommand*{\Declaration@Width}{\linewidth}
1417 \newcommand*{\Declaration@LeftIndent}{-2\fboxsep}
1418 \newcommand*{\Declaration@UseBox}[1]{%
1419 \colorbox{Declaration}{\usebox\Declaration@Box}%
1420 }
1421 \newenvironment{Declaration}[1][2]{%
1422 \if@revertexampleskip
1423 \typeout{TRACE: Fix vskip in \the\inputlineno}%
1424 \vskip -\topskip
1425 \fi
1426 \def\Declare@Lines{#1\baselineskip}%
1427 % Als erstes wird eine neue Index-Gruppe begonnen. Dagegen darf die
1428 % vorherige Index-Gruppe hier nicht automatisch geschlossen werden, weil
1429 % beispielsweise ein Abschnitt oder ein Kapitel ebenfalls eine Index-Gruppe
1430 % sein könnte (aber nicht muss).
1431 \BeginIndexGroup
1432 % Die Absatzformatierung anpassen. Eigentlich hier noch nicht notwendig,
1433 % schadet aber auch nichts.
1434 \parindent\z@
1435 \parfillskip\@flushglue
1436 \parskip\z@
1437 % \Macro, \Environment, etc. so umdefinieren, dass sie passend für die
1438 % Umgebung formatiert werden und auch gleich Label und Index-Einträge
1439 % erzeugt werden.
1440 \scr@Desc@let\Macro
1441 \scr@Desc@let\Option
1442 \scr@Desc@let\KOption
1443 \scr@Desc@let\OptionValue
1444 \scr@Desc@let\OptionVName
1445 \scr@Desc@let\Variable
1446 \scr@Desc@let\Environment
1447 \let\endEnvironment\endDescEnvironment
1448 \scr@Desc@let\Counter
1449 \scr@Desc@let\Length
1450 \scr@Desc@let\PageStyle
1451 \scr@Desc@let\PLength
1452 \scr@Desc@let\FontElement
1453 \scr@Desc@let\FloatStyle
1454 \scr@Desc@let\DoHook
1455 % Todo: Replace the following by the correct definitions:
1456 \let\XMacro\textMacro
1457 \let\XEnvironment\textEnvironment
1458 \let\XOption\textOption
1459 \let\XOptionValue\textOptionValue
1460 \newenvironment{Body}{% Umgebung für den (vertikalen) Inhalt einer Umgebung
1461 \\
1462 \setlength{\leftskip}{1em}%
1463 \minipage{\dimexpr\linewidth-\leftskip}%
1464 \raggedright
1465 \newcommand*{\BodyDots}{%
1466 \par
1467 \hskip-\leftskip
1468 \raisebox{0pt}[1.1\ht\strutbox][.5\dp\strutbox]{$\vdots$}%
1469 \par
1470 }%
1471 }{%
1472 \par
1473 \endminipage
1474 \\
1475 }%
1476 % Todo: Behandlung für Optionen, Längen, Zähler, Font-Elemente, Seitenstile,
1477 % etc.
1478 % Maybe: Vielleicht wäre es besser, die \X…-Definitionen von hier direkt zur
1479 % Definition der entsprechenden Elemente zu verlagern und sie \D… zu
1480 % nennen. Das wird dann eventuell übersichtlicher als alles hier zu
1481 % machen. Hier gäbe es dann nur noch für jedes Element genau ein
1482 % \let\…\D….
1483 % Jetzt wird der ganze Inhalt der Umgebung linksbündig in eine Box gepackt
1484 \begin{lrbox}{\Declaration@Box}%
1485 \minipage{\Declaration@Width}%
1486 \raggedright
1487 \parskip\baselineskip
1488 \small
1489 \addtolength{\parskip}{-\baselineskip}%
1490 \catcode`\^^M=9 % ignore line ends
1491 }{%
1492 \par
1493 \endminipage
1494 \end{lrbox}
1495 \vskip 1\baselineskip \@plus .75\baselineskip \@minus .25\baselineskip
1496 % Hier darf ein Seitenumbruch ohne vertikalen Ausgleich erfolgen, wenn nicht
1497 % mindestens für die Deklaration und einige Zeilen Platz ist.
1498 \vskip \dimexpr\ht\Declaration@Box+\dp\Declaration@Box+\Declare@Lines\relax
1499 \penalty-\@medpenalty
1500 \vskip -\dimexpr\ht\Declaration@Box+\dp\Declaration@Box+\Declare@Lines\relax
1501 \begingroup% Dann wird die erzeugte Box farbig hinterlegt leicht im linken
1502 % Rand ausgegeben.
1503 \parfillskip\@flushglue
1504 \parindent\z@
1505 \leavevmode
1506 \hspace*{\Declaration@LeftIndent}%
1507 \Declaration@UseBox{\Declaration@Box}%
1508 \par\nobreak\vskip\fboxsep
1509 \endgroup\nobreak
1510 \aftergroup\@revertexampleskipfalse
1511 % Der nachfolgende Text soll wie bei einer Überschrift behandelt werden.
1512 \aftergroup\@afterindentfalse\aftergroup\@afterheading
1513 }
1514 % \end{macrocode}
1515 % \begin{macro}{\scr@Desc@let}
1516 % Redefine the internal command of a robust command.
1517 % \begin{macrocode}
1518 \newcommand*{\scr@Desc@let}[1]{%
1519 \expandafter\def
1520 \csname \expandafter\@gobble\string #1 \expandafter\endcsname\expandafter{%
1521 \csname Desc\expandafter\@gobble\string #1\endcsname}%
1522 }
1523 % \end{macrocode}
1524 % \end{macro}
1525 % \end{environment}
1526 %
1527 % \begin{environment}{Example}
1528 % \changes{v1.15a}{2019/10/17}{Space removed}%
1529 % This environment is used for all examples at the \KOMAScript{} guide.
1530 % \begin{macrocode}
1531 \newenvironment{Example}{%
1532 \lstset{belowskip=0pt plus 1pt minus .5pt}%
1533 \labeling{{\usekomafont{disposition}\GuideExample:}}
1534 \item[{\usekomafont{disposition}\GuideExample:}]%
1535 }{%
1536 \endlabeling
1537 }
1538 % \end{macrocode}
1539 % \end{environment}
1540 % \begin{macro}{\ExampleEndFix}
1541 % \changes{v1.18}{2019/10/25}{New}%^^A
1542 % If an example is at the end of a description and before a new description
1543 % the vertical spacing is suboptimal. Usually this is handled automatically,
1544 % but there is also a user command to force the fix.
1545 % \begin{macrocode}
1546 \newcommand*{\ExampleEndFix}{%
1547 \@revertexampleskiptrue
1548 }
1549 % \end{macrocode}
1550 % \end{macro}
1551 %
1552 % \begin{environment}{ShowOutput}
1553 % This environment is used for the output of examples. It shows the middle
1554 % part of a page\footnote{TODO: optional arguments for printing a top or
1555 % bottom part of a page}. It uses |\scalebox| so you should never use a
1556 % DVI preview or a raw DVI printing.
1557 % \begin{macrocode}
1558 \newsavebox\ShowOutputBox
1559 \newenvironment{ShowOutput}[1][0pt]{\par
1560 \begin{lrbox}{\ShowOutputBox}%
1561 \minipage{.9\linewidth}%
1562 \vspace*{\baselineskip}\vspace{-#1}%
1563 }{%
1564 \endminipage
1565 \end{lrbox}%
1566 \setlength{\unitlength}{1pt}%
1567 \setlength{\@tempdima}{\ht\ShowOutputBox}%
1568 \addtolength{\@tempdima}{\dp\ShowOutputBox}%
1569 \setlength{\@tempdima}{.75\@tempdima}%
1570 \edef\MidY{\strip@pt\@tempdima}%
1571 \addtolength{\@tempdima}{5pt}%
1572 \edef\HighY{\strip@pt\@tempdima}%
1573 \addtolength{\@tempdima}{-10pt}%
1574 \edef\LowY{\strip@pt\@tempdima}%
1575 \addtolength{\@tempdima}{5pt}%
1576 \setlength{\@tempdima}{.9\linewidth}\edef\QuadIV{\strip@pt\@tempdima}%
1577 \setlength{\@tempdima}{.675\linewidth}\edef\QuadIII{\strip@pt\@tempdima}%
1578 \setlength{\@tempdima}{.45\linewidth}\edef\QuadII{\strip@pt\@tempdima}%
1579 \setlength{\@tempdima}{.225\linewidth}\edef\QuadI{\strip@pt\@tempdima}%
1580 \centering
1581 \begin{picture}(\QuadIV,\MidY)
1582 \qbezier(0,\MidY)(\QuadI,\HighY)(\QuadII,\MidY)%
1583 \qbezier(\QuadII,\MidY)(\QuadIII,\LowY)(\QuadIV,\MidY)
1584 \put(0,0){\makebox(\QuadIV,\MidY)[c]{%
1585 \scalebox{.75}{\usebox{\ShowOutputBox}}%
1586 }%
1587 }%
1588 \put(0,-5){\line(0,1){\HighY}}%
1589 \put(\QuadIV,-5){\line(0,1){\HighY}}%
1590 \qbezier(0,-5)(\QuadI,0)(\QuadII,-5)%
1591 \qbezier(\QuadII,-5)(\QuadIII,-10)(\QuadIV,-5)
1592 \end{picture}\par
1593 \vspace{1ex plus 1ex minus .5ex}%
1594 }
1595 % \end{macrocode}
1596 % \end{environment}
1597 %
1598 % \begin{environment}{Explain}
1599 % Some parts of the documentation are importing for understanding
1600 % \KOMAScript{} but not important for using \KOMAScript.
1601 % \begin{macrocode}
1602 \newenvironment{Explain}{%
1603 \par\sffamily\ignorespaces
1604 }{%
1605 \par
1606 }
1607 % \end{macrocode}
1608 % \end{environment}
1609 %
1610 %
1611 % \subsection{Used by Jens-Uwe only}
1612 %
1613 % There are some example visualizations used only by Jens-Uwe.\footnote{TODO:
1614 % All these should be merged with \texttt{ShowOutputBox}.}
1615 %
1616 % \begin{environment}{XmpTopPage}
1617 % Output of the top of a page.
1618 % \begin{macrocode}
1619 \newenvironment{XmpTopPage}
1620 {%
1621 \begin{center}
1622 \iffree{\setlength{\unitlength}{1mm}}{\setlength{\unitlength}{.833mm}}%
1623 \begin{picture}(100,39)
1624 \thinlines
1625 \qbezier(0,5)(25,7)(50,5)\qbezier(50,5)(75,3)(100,5)
1626 \put(0,5){\line(0,1){34}}
1627 \thicklines
1628 \put(100,5){\line(0,1){34}}\put(0,39){\line(1,0){100}}
1629 \footnotesize
1630 }{%
1631 \end{picture}
1632 \end{center}\vspace{-1.5\baselineskip}%
1633 }
1634 % \end{macrocode}
1635 % \end{environment}
1636 %
1637 % \begin{environment}{XmpBotPage}
1638 % Output of the bottom of a page.
1639 % \begin{macrocode}
1640 \newenvironment{XmpBotPage}
1641 {\begin{center}
1642 \iffree{\setlength{\unitlength}{1mm}}{\setlength{\unitlength}{.833mm}}%
1643 \begin{picture}(100,40)%
1644 \thinlines
1645 \qbezier(0,38)(25,40)(50,38)\qbezier(50,38)(75,36)(100,38)
1646 \put(0,5){\line(0,1){33}}
1647 \thicklines
1648 \put(100,5){\line(0,1){33}}\put(0,5){\line(1,0){100}}
1649 \footnotesize
1650 }{%
1651 \end{picture}\end{center}\vspace{-1.5\baselineskip}%
1652 }
1653 % \end{macrocode}
1654 % \end{environment}
1655 %
1656 % \begin{macro}{\XmpSetText}
1657 % Output some text at \texttt{XmpTopPage} or \texttt{XmpBotPage}.
1658 % \begin{macrocode}
1659 \newcommand{\XmpSetText}[2][\XmpText]{%
1660 \put(#2){\makebox(0,0)[tl]{\parbox{70\unitlength}{\parfillskip=0pt
1661 #1}}}}
1662 % \end{macrocode}
1663 % \end{macro}
1664 %
1665 % \begin{macro}{\XmpMarginNote}
1666 % Output a margin note at \texttt{XmpTopPage} or \texttt{XmpBotPage}.
1667 % \begin{macrocode}
1668 \newcommand{\XmpMarginNote}[1]{%
1669 \put(#1){\makebox(0,5)[tl]{\scriptsize\XmpMarginTextA}}
1670 \put(#1){\makebox(0,5)[bl]{\scriptsize\XmpMarginTextB}}}
1671 % \end{macrocode}
1672 % \end{macro}
1673 %
1674 % \begin{macro}{\XmpRule}
1675 % Output a horizonal rule at a \texttt{XmpTopPage} or \texttt{XmpBotPage}.
1676 % \begin{macrocode}
1677 \newcommand{\XmpRule}[2]{\put(#1){\line(1,0){#2}}}
1678 % \end{macrocode}
1679 % \end{macro}
1680 %
1681 % \begin{macro}{\XmpHeading}
1682 % Output a head line at a \texttt{XmpTopPage} or \texttt{XmpBotPage}.
1683 % \begin{macrocode}
1684 \newcommand{\XmpHeading}[3][\KOMAScript\hfill 3]{%
1685 \put(#2){\makebox(#3,0)[l]{#1}}}
1686 % \end{macrocode}
1687 % \end{macro}
1688 %
1689 %
1690 % \section{Margin Notes}
1691 %
1692 % \begin{macro}{\OnlyAt}
1693 % Some things are not available at every \KOMAScript{} class. To show the
1694 % differences we'll put a margin note. If more than one class or package
1695 % should be noted, |\and| will be used to separate them.
1696 % \begin{macrocode}
1697 \newcommand*{\OnlyAt}[1]{%
1698 \marginline{\def\and{,\\}\footnotesize #1\par}%
1699 }
1700 % \end{macrocode}
1701 % \end{macro}
1702 %
1703 %
1704 % \section{Change Log}
1705 %
1706 % Not all features are part of every old \KOMAScript{} release. New features
1707 % will be marked and these marks are referenced at a kind of index.
1708 %
1709 % \begin{macro}{\ChangedAt}
1710 % \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
1711 % Set the margin note and write an entry to the change log.\footnote{TODO:
1712 % Don't use the glossary, use a file by my own.}
1713 % \begin{macrocode}
1714 \providecommand*{\ChangedAt}[3][]{%
1715 \Ifstr{#1}{}{%
1716 \marginnote{\tiny\fbox{\strut#2}}%
1717 }{%
1718 \def\reserved@a##1/##2\@nil{%
1719 \count@\year
1720 \advance\count@-##1\relax
1721 \multiply\count@ by 12\relax
1722 \advance\count@\month
1723 \advance\count@-##2\relax
1724 }\reserved@a#1\@nil
1725 \ifnum\count@<13
1726 \marginnote{\tiny Beta-Feature}%
1727 \else
1728 \marginnote{\tiny\fbox{\strut #2}}%
1729 \fi
1730 }%
1731 \begingroup
1732 \let\@tempa\@empty
1733 \Ifstr{#2}{v2.9i}{\def\@tempa{v2.90i=}}{}%
1734 \Ifstr{#2}{v2.9t}{\def\@tempa{v2.90t=}}{}%
1735 \let\and\ignorespaces
1736 \def\Package##1{%
1737 \glossary{##1=\string\Package{##1}>\@tempa#2|indexrm}%
1738 \glossary{\@tempa#2>##1=\string\Package{##1}|indexrm}%
1739 \ignorespaces
1740 }%
1741 \def\Class##1{%
1742 \glossary{##1=\string\Class{##1}>\@tempa#2|indexrm}%
1743 \glossary{\@tempa#2>##1=\string\Class{##1}|indexrm}%
1744 \ignorespaces
1745 }%
1746 \ignorespaces #3%
1747 \endgroup
1748 }
1749 % \end{macrocode}
1750 % \end{macro}
1751 %
1752 % While I currently use the glossary, we have to make it:
1753 % \begin{macrocode}
1754 \makeglossary
1755 % \end{macrocode}
1756 %
1757 % \begin{macro}{\printchangelog}
1758 % We don't want to generate the change log only. We also have to print it.
1759 % \begin{macrocode}
1760 \newcommand*{\printchangelog}{\@input@{\jobname.gls}}
1761 % \end{macrocode}
1762 % \end{macro}
1763 % \begin{environment}{thechangelog}
1764 % And this will be used at the \texttt{gls} file. The change log index will
1765 % always generate an entry to the table of contents.
1766 % \begin{macrocode}
1767 \newenvironment{thechangelog}{%
1768 \setchapterpreamble{\GuideChangeLogPreamble\par\bigskip}%
1769 \addchap{\changelogname}%
1770 \markboth{\changelogname}{\changelogname}%
1771 \setlength{\parindent}{0pt}%
1772 \setlength{\parskip}{0pt plus .3pt}%
1773 \setlength{\parfillskip}{0pt plus 1fil}%
1774 \def\and{,\ }%
1775 \let\item\@idxitem
1776 }{%
1777 \clearpage
1778 }
1779 % \end{macrocode}
1780 % The macros |\GuideChangeLogPreamble| and |\changelogname| have to be
1781 % defined at the language file.
1782 % \end{environment}
1783 %
1784 %
1785 % \section{Special Tabulars and Tables}
1786 %
1787 % I need some special tabulars and tables. These are used for describing
1788 % single topics.
1789 %
1790 % \begin{environment}{desctabular}
1791 % \changes{v1.13d}{2019/02/01}{\cs{addlinespace} removed from end code}^^A
1792 % This kind of tabluar has primary one column but uses two columns in
1793 % declaration. It's something like a \texttt{description} environment with
1794 % line break after the item. I've used a \texttt{tabular} at the definition
1795 % because of full compatibitlity with \texttt{desctable}.
1796 % \begin{length}{\descwidth}
1797 % I need a length of local usage. I could have used |\@tempdima| or
1798 % another local length from kernel. But I've decided not to try to find a
1799 % unused length at \texttt{tabular} environment.
1800 % \begin{length}{\descdefaultindent}
1801 % And I need a length of global usage.
1802 % \begin{macrocode}
1803 \newlength{\descwidth}
1804 \newlength{\descdefaultindent}\setlength{\descdefaultindent}{2em}
1805 % \end{macrocode}
1806 % \end{length}
1807 % \end{length}
1808 % The definition of \texttt{desctabular} is very simple, because the main
1809 % work will be done by a \emph{worker} macro that will be defined later.
1810 % \begin{macrocode}
1811 \newenvironment{desctabular}[1][c]{%
1812 \start@desctab{\descdefaultindent}%
1813 \tabular[#1]{lp{\descwidth}}
1814 \toprule
1815 }{%
1816 \bottomrule
1817 \endtabular
1818 }
1819 % \end{macrocode}
1820 % \end{environment}
1821 %
1822 % \begin{environment}{desctable}
1823 % \textbf{Deprecated! Use \texttt{desclist} instead of!}
1824 % This is almost the same like \texttt{desctabular} but it uses a longtable
1825 % to allow page breaks.
1826 % \begin{macrocode}
1827 \newenvironment{desctable}[1][\descdefaultindent]{%
1828 \ClassError{scrguide}{deprecated environment}{%
1829 please replace desctable by desclist}%
1830 \onelinecaptionsfalse
1831 \start@desctab{#1}%
1832 \newcommand{\Endfirsthead}{\toprule\endfirsthead}%
1833 \newcommand{\Endhead}{\midrule\endhead}%
1834 \newcommand*{\standardfoot}{%
1835 \addlinespace[-.5\normalbaselineskip]\midrule
1836 \multicolumn{2}{r@{}}{\dots}\\
1837 \endfoot
1838 \addlinespace[-.5\normalbaselineskip]\bottomrule
1839 \endlastfoot
1840 }%
1841 \longtable{lp{\descwidth}}%
1842 }{%
1843 \endlongtable
1844 }
1845 % \end{macrocode}
1846 % \end{environment}
1847 %
1848 % \begin{macro}{\start@desctab}
1849 % \changes{v1.7c}{2013/10/13}{\cs{leavevmode}\cs{ignorespaces} added to
1850 % \cs{nentry}}%^^A
1851 % \changes{v1.16}{2019/10/23}{links for plengths added}%^^A
1852 % \changes{v1.17}{2019/10/23}{links for variables added}%^^A
1853 % This is the \emph{worker} macro of \texttt{desctable} and
1854 % \texttt{desctabular}. It does the complete calculations and definition of
1855 % the entry (something like |\item|) commands.
1856 % \begin{macrocode}
1857 \newcommand*{\start@desctab}[1]{%
1858 \setlength{\descwidth}{\linewidth}%
1859 \addtolength{\descwidth}{-4\tabcolsep}%
1860 \addtolength{\descwidth}{-#1}%
1861 \setlength{\labelwidth}{\linewidth}%
1862 \addtolength{\labelwidth}{-2\tabcolsep}%
1863 \newcommand{\nentry}[2]{%
1864 \multicolumn{2}{p{\labelwidth}}{\raggedright##1}\tabularnewline*%
1865 \hspace*{#1} & \leavevmode\ignorespaces ##2\tabularnewline%
1866 }%
1867 \newcommand{\entry}[2]{\nentry{##1}{##2}[.5\baselineskip]}%
1868 \newcommand*{\pentry}[1]{%
1869 \entry{%
1870 \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.plength.##1}{%
1871 \ClassWarning{scrguide}{%
1872 Reference `\label@desc@prefix\LabelBase.plength.##1' undefined}%
1873 \PLength{##1}%
1874 }{%
1875 \DescRef{\LabelBase.plength.##1}%
1876 }%
1877 \IndexPLength[indexmain]{##1}}}%
1878 \newcommand*{\pventry}[1]{\entry{\PValue{##1}}}%
1879 \newcommand*{\mentry}[1]{\entry{\Macro{##1}}}%
1880 \newcommand*{\ventry}[1]{%
1881 \entry{%
1882 \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.variable.##1}{%
1883 \ClassWarning{scrguide}{%
1884 Reference `\label@desc@prefix\LabelBase.variable.##1 undefined}%
1885 \Variable{##1}%
1886 }{%
1887 \DescRef{\LabelBase.variable.##1}%
1888 }%
1889 \IndexVariable[indexmain]{##1}%
1890 }%
1891 }%
1892 \newcommand*{\feentry}[1]{%
1893 \entry{%
1894 \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.fontelement.##1}{%
1895 \ClassWarning{scrguide}{%
1896 Reference `\label@desc@prefix\LabelBase.fontelement.##1' undefined}%
1897 \FontElement{##1}%
1898 }{%
1899 \DescRef{\LabelBase.fontelement.##1}%
1900 }%
1901 \IndexFontElement[indexmain]{##1}}%
1902 }%
1903 \newcommand*{\oentry}[1]{%
1904 \entry{\Option{##1}\IndexOption[indexmain]{##1}}%
1905 }%
1906 }
1907 % \end{macro}
1908 %
1909 % \begin{environment}{desclist}
1910 % This is similar to \texttt{desctable} but it has been build by single
1911 % tabulars instead of longtable.
1912 % \begin{macro}{\desccaptionb@xfirst}
1913 % \begin{macro}{\desccaptionb@xother}
1914 % \begin{macro}{\descfootb@x}
1915 % \begin{macro}{\descentryb@x}
1916 % \begin{macro}{\desccaptiob@xnext}
1917 % \begin{macrocode}
1918 \newsavebox\desccaptionb@xfirst
1919 \newsavebox\desccaptionb@xother
1920 \newsavebox\descfootb@x
1921 \newsavebox\descentryb@x
1922 \newif\ifdescpage@dd
1923 \newcommand*{\desccaptionb@xnext}{}
1924 \newcommand*{\abovecaptionskipcorrection}{}
1925 \newenvironment{desclist}[1][\descdefaultindent]{%
1926 \par
1927 \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\selectfont%
1928 \vskip\intextsep
1929 \start@desctab{#1}%
1930 \csname @desclistinithook\endcsname
1931 \def\@captype{table}%
1932 \newcommand{\desccaption}{\@dblarg{\@desccaption}}%
1933 \newcommand{\@desccaption}[3][]{%
1934 \setbox\desccaptionb@xfirst\vbox{%
1935 \tabular{p{\labelwidth}}%
1936 \multicolumn{1}{@{}p{\dimexpr\labelwidth+2\tabcolsep}@{}}{%
1937 \captionaboveof{table}[{##1}]{##2\unskip\strut}%
1938 }\tabularnewline[%
1939 \dimexpr \abovecaptionskip-\normalbaselineskip\relax
1940 % \dimexpr \abovecaptionskip-\abovecaptionskipcorrection\relax
1941 ]
1942 \toprule\tabularnewline
1943 \endtabular
1944 \vskip -\baselineskip
1945 }%
1946 \let\abovecaptionskipcorrection\@empty
1947 \setbox\desccaptionb@xother\vbox{%
1948 \tabular{p{\labelwidth}}
1949 \multicolumn{1}{@{}p{\dimexpr\labelwidth+2\tabcolsep}@{}}{%
1950 \@@makecaption\@firstofone{\fnum@table}{\ignorespaces ##3}%
1951 }\tabularnewline[-\normalbaselineskip]
1952 \addlinespace[\abovecaptionskip]
1953 \toprule\tabularnewline
1954 \endtabular
1955 \vskip -\baselineskip
1956 }%
1957 \let\desccaptionb@xnext\desccaptionb@xfirst
1958 }%
1959 \setbox\descfootb@x\vbox{%
1960 \tabular{p{\labelwidth}}%
1961 \addlinespace[-.5\normalbaselineskip]\midrule
1962 \addlinespace[-\dp\strutbox]
1963 \raggedleft\dots\hspace*{-\tabcolsep}\tabularnewline
1964 \endtabular
1965 }%
1966 \newcommand*{\entryskip}[1][]{%
1967 \ifx\relax##1\relax\else\vskip##1\relax\fi
1968 }%
1969 \renewcommand{\nentry}[2]{%
1970 \typeout{TRACE: Generate entry}%
1971 \setbox\descentryb@x\vbox{%
1972 \ifx\desccaptionb@xnext\desccaptionb@xfirst\copy\desccaptionb@xnext\fi
1973 \makebox[\linewidth][l]{\begin{tabular}{lp{\descwidth}}%
1974 \multicolumn{2}{p{\labelwidth}}{\raggedright##1}\tabularnewline
1975 \hspace*{#1} & ##2\tabularnewline
1976 \end{tabular}}%
1977 }%
1978 \typeout{TRACE: entry done}%
1979 \begingroup
1980 \dimen@ \ht\descentryb@x
1981 \advance \dimen@ \dp\descentryb@x
1982 \ifdim \ht\descfootb@x>\ht\strutbox
1983 \advance \dimen@ \ht\descfootb@x
1984 \else
1985 \advance \dimen@ \ht\strutbox
1986 \fi
1987 \ifdim \dp\descfootb@x>\dp\strutbox
1988 \advance \dimen@ \dp\descfootb@x
1989 \else
1990 \advance \dimen@ \dp\strutbox
1991 \fi
1992 \advance \dimen@ \baselineskip
1993 \dimen@ii \pagegoal \advance \dimen@ii -\pagetotal
1994 \typeout{TRACE: \the\dimen@>\the\dimen@ii\space (footbox
1995 ht=\the\ht\descfootb@x, dp=\the\dp\descfootb@x; strutbox
1996 ht=\the\ht\strutbox, dp=\the\dp\strutbox)?}%
1997 \ifdim \dimen@>\dimen@ii
1998 \typeout{TRACE: Break table \thetable}%
1999 \ifx\desccaptionb@xnext\@empty
2000 \csname @desclistentryhook\endcsname
2001 {\copy\descfootb@x}%
2002 \fi
2003 \newpage
2004 \ifx\desccaptionb@xnext\@empty
2005 \typeout{TRACE: switch page}%
2006 \ifdescpage@dd
2007 \aftergroup\descpage@ddfalse
2008 \expandafter\descpage@ddfalse
2009 \else
2010 \aftergroup\descpage@ddtrue
2011 \expandafter\descpage@ddtrue
2012 \fi
2013 \csname @desclistentryhook\endcsname
2014 {\copy\desccaptionb@xother}%
2015 \fi
2016 \fi
2017 \endgroup
2018 \ifx\desccaptionb@xnext\desccaptionb@xfirst
2019 \Ifthispageodd{\descpage@ddtrue}{\descpage@ddfalse}%
2020 \fi
2021 \csname @desclistentryhook\endcsname
2022 {\copy\descentryb@x}%
2023 \let\desccaptionb@xnext\@empty
2024 \entryskip
2025 }%
2026 }{%
2027 \vskip -.5\baselineskip
2028 \setbox\descfootb@x\vbox{%
2029 \tabular{p{\labelwidth}}
2030 \bottomrule\tabularnewline
2031 \endtabular
2032 }%
2033 \csname @desclistentryhook\endcsname
2034 {\copy\descfootb@x}%
2035 \par\nobreak
2036 \vskip -\baselineskip \vskip \intextsep
2037 }
2038 % \end{macrocode}
2039 % \end{macro}
2040 % \end{macro}
2041 % \end{macro}
2042 % \end{macro}
2043 % \end{macro}
2044 % \end{environment}
2045 %
2046 %
2047 % \section{Listings}
2048 %
2049 % Setup listings:
2050 % \begin{macrocode}
2051 \lstset{%
2052 basicstyle=\ttfamily,%
2053 columns=fullflexible,keepspaces,%
2054 aboveskip=.4\baselineskip,%
2055 belowskip=\dp\strutbox plus 1pt minus .5pt,%
2056 literate=%
2057 {Ö}{{\"O}}1
2058 {Ä}{{\"A}}1
2059 {Ü}{{\"U}}1
2060 {ß}{{\ss}}1
2061 {ü}{{\"u}}1
2062 {ä}{{\"a}}1
2063 {ö}{{\"o}}1
2064 {»}{{\guillemetright}}1
2065 {«}{{\guillemetleft}}1
2066 }%
2067 \lstdefinestyle{code}{%
2068 language=[LaTeX]TeX,%
2069 moretexcs={%
2070 @auxout,@currext,@dottedtocline,@empty,@float,
2071 @gobble,@gobbletwo,
2072 @hangfrom,@ifpackagelater,
2073 @ifundefined,@mkboth,
2074 @rightmark,@secondoftwo,
2075 @tempskipa,@tempdima,@tempswafalse,@tempswatrue,
2076 @undefined,
2077 AtBeginDocument,AtEndDocument, appendix, ClassWarningNoLine,CurrentOption,
2078 color,colorbox,
2079 DeclareOption,DeclareRobustCommand,dimexpr,end@float,ExecuteOptions,
2080 gluexpr,
2081 if@filesw,if@tempswa,if@twoside,includegraphics,
2082 labelformat,
2083 MessageBreak,
2084 numexpr,
2085 onehalfspacing,
2086 PackageError,PackageInfo,PackageWarning,PassOptionsToPackage,
2087 ProcessOptions,protected@edef,protected@write,
2088 ProvidesFile,ProvidesPackage,
2089 providecommand,
2090 RequirePackage,RequirePackageWithOptions,setkey,setlength,
2091 SelectInputMappings,setkeys,
2092 textsuperscript}%
2093 }%
2094 \lstdefinestyle{output}{%
2095 breaklines,prebreak=\mbox{$\hookleftarrow$}%
2096 }%
2097 \lstdefinestyle{KOMA}{%
2098 style=code,%
2099 moretexcs={%
2100 @addtoplength,@setplength,@newplength, activateareas,
2101 addchap,addrentry,Address,addcontentslinetoeachtocfile,
2102 addxcontentslinetoeachtocfile,addsec,
2103 addtoeachtocfile,
2104 addtokomafont,addtolengthplength,addtoplength,addtoreffields,addtotoclist,
2105 addxcontentsline,
2106 adrchar,adrentry,
2107 AddLayersAtBeginOfPageStyle,AddLayersToPageStyle,
2108 AddtoDoHook,AddtoOneTimeDoHook,
2109 AfterBibliographyPreamble,AfterCalculatingTypearea,
2110 AfterFile,AfterPackage,AfterStartingTOC,AfterTOCHead,
2111 appendixmore,appendixname,areaset,autodot,automark,AtAddToTocList,
2112 AtBeginLetter,At@startsection,
2113 Before@sect,Before@ssect,
2114 BeforeFamilyProcessOptions,
2115 BeforeClosingMainAux,BeforePackage,BeforeStartingTOC,
2116 bib@beginhook,bib@endhook,
2117 blinddocument,blindtext,Blinddocument,Blindtext,
2118 cc,captionabove,captionaboveof,captionbelow,captionbelowof,captionformat,
2119 captionof,cefoot,cfoot,chapapp, chapappifchapterprefix,
2120 chapterheadstartvskip,chapterheadmidvskip,chapterheadendvskip,
2121 chapter,chapterlinesformat,chapterlineswithprefixformat,
2122 chapterformat,chaptermarkformat,chapternumdepth,chaptertocdepth,
2123 chapterpagestyle,chead,
2124 Clause,
2125 cleardoubleevenemptypage,cleardoubleoddpage,
2126 clearscrheadfoot,closing,cofoot,Comment,
2127 CloneTOCEntryStyle,
2128 DeclareNewJuraEnvironment,
2129 DeclareLayer,DeclareNewLayer,DeclareNewPageStyleByLayers,
2130 DeclarePageStyleByLayers,
2131 DeclareTOCStyleEntry,DeclareTOCEntryStyle,
2132 DeclareNewNoteColumn,DeclareNewPageStyleAlias,
2133 DeclareNewTOC,DeclareSectionCommand,DeclareNewSectionCommand,
2134 RedeclareSectionCommand,ProvideSectionCommand,
2135 dedication,defcaptionname,deffootnote,deffootnotemark,
2136 DefineFamily,DefineFamilyKey,DefineFamilyMember,
2137 DefineTOCEntryOption,DefineTOCEntryBooleanOption,
2138 DefineTOCEntryCommandOption,DefintTOCEntryIfOption,
2139 DefineTOCEntryLengthOption,DefineTOCEntryNumberOption,
2140 DestroyLayer,defpagestyle,deftripstyle,
2141 dictum,dictumauthorformat,dictumrule,dictumwidth,doforeachtocfile,
2142 ellipsispar,
2143 encl,ExecuteDoHook,extratitle,FamilyBoolKey,FamilyExecuteOptions,
2144 FamilyKeyState,FamilyKeyStateUnknown,FamilyKeyStateProcessed,
2145 FamilyKeyStateUnknownValue,FamilyKeyStateNeedValue,
2146 FamilyNumericalKey,%
2147 FamilyOption,FamilyOptions,FamilyProcessOptions,FamilySetBool,
2148 FamilyStringKey,FamilyUnknownKeyValue,
2149 figureformat,figurename,firstfoot,firsthead,FirstName,footfont,footref,
2150 ForDoHook,ForEachLayerOfPageStyle,
2151 FreeI,FreeII,FreeIII,FreeIV,
2152 GenericMarkFormat,
2153 headfont,headmark,
2154 Ifattoclist,Ifkomavar,Ifkomavarempty,Ifstr,Ifstrstart,Ifthispageodd,
2155 Ifundefinedorrelax,IfUsePrefixLine,
2156 ifundefinedorrelax,
2157 ifattoclist,ifoot,ihead,ifkomavarempty,ifstr,ifthispageodd,
2158 IfActiveMkBoth,InputAddressFile,
2159 KOMAoption,KOMAoptions,KOMAScript, l@addto@macro,
2160 LastName,layerwidth,layerheight,lefoot,lefttopmark,leftbotmark,
2161 leftfirstmark,lehead,LetterOptionNeedsPapersize,
2162 LenToUnit,
2163 lipsum,listoffigures,
2164 listoftables,listoftoc,LoadLetterOption,lofoot,lohead,lowertitleback,
2165 MakeMarkcase,makenote,maketitle,manualmark,marginline,markleft,markdouble,
2166 minisec,
2167 multfootsep,multiplefootnoteseparator,
2168 Name,nameday,newbibstyle,newcaptionname,newkomavar,nexthead,
2169 ofoot,ohead,opening,othersectionlevelsformat,
2170 p@section,pagemark,paragraphformat,subparagraphformat,
2171 paragraphnumdepth,paragraphtocdepth,
2172 subparagraphnumdepth,subparagraphtocdepth,
2173 parellipsis,parformat,parname,parshortname,
2174 part,partformat,partlineswithprefixformat,
2175 partname,partnumdepth,partpagestyle,partnumdepth,
2176 partheadstartvskip,partheadmidvskip,partheadendvskip,
2177 pnumfont,
2178 PreventPackageFromLoading,providecaptionname,publishers,ps,
2179 putLL,putLR,putUL,putUR,putC,
2180 raggedcaption,raggedchapter,raggedfootnote,raggedsection,raggedpart,
2181 raggedsignature,
2182 recalctypearea,
2183 refL,refS,refN,refoot,
2184 refParagraph,refParagraphN,refPar,refParL,refParS,refParN,
2185 refSentence,refSentenceL,refSentenceS,refSentenceN,rehead,
2186 RelaxFamilyKey,
2187 removereffields,renewcaptionname,
2188 RedeclarePageStyleAlias,RedeclareTOCStyleEntry,
2189 ReplaceInput,ReplacePackage,ResetPreventPackageFromLoading,
2190 rightbotmark,righttopmark,rightfirstmark,
2191 rohead,
2192 sectionformat,subsectionformat,subsubsectionformat,
2193 sectionnumdepth,sectiontocdepth,
2194 subsectionnumdepth,subsectiontocdepth,
2195 subsubsectionnumdepth,subsubsectiontocdepth,
2196 sectionmarkformat,sectioncatchphraseformat,sectionlinesformat,
2197 Sentence,sentencename,sentenceshortname,
2198 setbibpreamble,setcapindent,setcapwidth,setcaptionalignment,
2199 setchapterpreamble,setfootbotline,setfootsepline,setfootwidth,
2200 setheadsepline,setheadtopline,setheadwidth,setindexpreamble,setkomafont,
2201 setkomavar,setlengthtoplength,setparsizes,setpartpreamble,
2202 setplength,setuptoc,
2203 showfields,showenvelope,showISOenvelope,showUScommercial,showUScheck,
2204 SplitDoHook,
2205 storeareas,StorePreventPackageFromLoading,
2206 subject,SubClause,subsectionmarkformat,subtitle,syncwithnotecolumn,
2207 tableformat,tablename,tableofcontents,textsubscript,thechapter,thefigure,
2208 thefootnotemark,thepar,thepart,thesection,thesentence,thesubsection,
2209 thesubsubsection,theparagraph,thesubparagraph,
2210 thetable,thistime,
2211 titlehead,tocbasic@extend@babel,TOCclone,todaysname,typearea,%
2212 TOCEntryStyleInitCode,TOCEntryStyleStartInitCode,TOCLineLeaderFill,
2213 UnPreventPackageFromLoading,unitfactor,
2214 unsettoc,usekomafont,useplength,usekomavar,uppertitleback%
2215 }%
2216 }%
2217 \lstnewenvironment{lstoutput}[1][]{%
2218 \lstset{style=output,basicstyle=\ttfamily\codesize,#1}%
2219 }{}%
2220 \lstnewenvironment{lstcode}[1][]{%
2221 \lstset{style=KOMA,basicstyle=\ttfamily\codesize,#1}%
2222 }{}%
2223 \newcommand*{\lstinputcode}[1][]{%
2224 \lstinputlisting[style=KOMA,basicstyle=\ttfamily\codesize,#1]%
2225 }
2226 \newcommand*{\codesize}{\small}
2227 % \end{macrocode}
2228 %
2229 %
2230 % \section{hyperref Addons}
2231 %
2232 % \begin{macro}{\KOMAScript}
2233 % \begin{macro}{\Guide@KOMAScript}
2234 % We need some additions to \textsf{hyperref}.
2235 % \begin{macrocode}
2236 \newcommand*{\Guide@KOMAScript}{}
2237 \expandafter\let\csname Guide@KOMAScript\expandafter\endcsname\csname
2238 KOMAScript \endcsname
2239 \DeclareRobustCommand*{\KOMAScript}{%
2240 \texorpdfstring{\Guide@KOMAScript}{KOMA-Script}%
2241 }
2242 % \end{macrocode}
2243 % \end{macro}
2244 % \end{macro}
2245 %
2246 % \begin{macro}{\url@}
2247 % \changes{v1.9b}{2015/09/30}{\cs{GuideCTANserver} not needed and removed}%^^A
2248 % \changes{v1.22a}{2019/11/18}{https instead of http}%^^A
2249 % Redefine to make \texttt{CTAN://} be an alias for
2250 % \texttt{https://mirror.ctan.org/}.
2251 % \begin{macrocode}
2252 \def\url@#1{\expandafter\url@@#1\@nil}
2253 \def\url@@#1://#2\@nil{%
2254 \def\@tempa{#1}\def\@tempb{CTAN}\ifx\@tempa\@tempb
2255 \hyper@linkurl{\Hurl{#1://#2}}{https://mirror.ctan.org/#2}%
2256 \else
2257 \hyper@linkurl{\Hurl{#1://#2}}{#1://#2}%
2258 \fi
2259 }
2260 % \end{macrocode}
2261 % \end{macro}
2262 %
2263 % We have to setup \textsf{hyperref}:
2264 % \begin{macrocode}
2265 \AtBeginDocument{%
2266 \iffree{%
2267 \hypersetup{%
2268 plainpages=false,
2269 pdftitle={\GuideTitle},
2270 pdfauthor={Markus Kohm},
2271 pdfsubject={\GuideSubject},
2272 pdfkeywords={\KOMAScript, scrbook, scrreprt, scrartcl,
2273 typearea, scrlfile, scrlayer, scrlayer-scrpage, scrlayer-notecolumn,
2274 scrletter, scrlttr2, scraddr, scrtime, scrdate, scrwfile},
2275 pdfcreator={\KOMAScript, hyperref}
2276 }%
2277 }{}%
2278 }
2279 % \end{macrocode}
2280 %
2281 % \begin{macro}{\autopageref}
2282 % This is something like |\autoref| but with page reference. A simple
2283 % definition would use |\hyperref| and |\pageref*|. But I want to allow to
2284 % decide if the reference is the page or the label. So this definition is
2285 % more like |\autoref|.
2286 % \begin{macrocode}
2287 \DeclareRobustCommand{\autopageref}[1]{%
2288 \expandafter\auto@setpageref\csname r@#1\endcsname
2289 \@secondoffive
2290 {#1}%
2291 }
2292 % \end{macrocode}
2293 % \begin{macro}{\auto@setpageref}
2294 % This is the \emph{worker} macro. It checks for the label and trys to set
2295 % either a reference to the page or a reference to the label.
2296 % \begin{macrocode}
2297 \newcommand*{\auto@setpageref}[3]{%
2298 \@safe@activestrue
2299 \ifx#1\relax
2300 \protect\G@refundefinedtrue
2301 \nfss@text{\reset@font\bfseries ??}%
2302 \@latex@warning{%
2303 Reference `#3' on page \thepage \space undefined%
2304 }%
2305 \else
2306 \def\@currentHtag{\pageautorefname~}%
2307 \if@pagereftolabel
2308 \hyper@@link
2309 {\expandafter\@fifthoffive#1}%
2310 {\expandafter\@fourthoffive#1\@empty\@empty}%
2311 {\@currentHtag\expandafter#2#1\@empty\@empty\null}%
2312 \else
2313 \hyper@@link
2314 {\expandafter\@fifthoffive#1}%
2315 {page.\expandafter\@secondoffive#1\@empty\@empty}%
2316 {\@currentHtag\expandafter#2#1\@empty\@empty\null}%
2317 \fi
2318 \fi
2319 \@safe@activesfalse
2320 }
2321 % \end{macrocode}
2322 % \end{macro}
2323 % \end{macro}
2324 %
2325 %
2326 % \section{Entries to \contentsname, \figurelistname, etc.}
2327 %
2328 % We have large page numbers, so better setup the needed width. And we like
2329 % other dot seperation.
2330 % \begin{macrocode}
2331 \RedeclareSectionCommand[%
2332 tocdynnumwidth,%
2333 tocbreakafternumber=true,%
2334 tocentrynumberformat=\partnumberwithprefix,%
2335 tocpagenumberformat=\@firstofone
2336 ]{part}%
2337 \newcommand*{\partnumberwithprefix}[1]{\let\autodot:\partname~#1}%
2338 \RedeclareSectionCommand[%
2339 tocnumwidth=21pt,%
2340 tocpagenumberformat=\@firstofone,%
2341 tocraggedentrytext=true%
2342 ]{chapter}%
2343 \RedeclareSectionCommand[tocindent=21pt,tocnumwidth=34pt]{section}%
2344 \RedeclareSectionCommand[tocindent=55pt,tocnumwidth=36pt]{subsection}%
2345 \DeclareTOCStyleEntries[dynnumwidth]{default}{figure,table}%
2346 \renewcommand*{\@pnumwidth}{1.8em}% 1.67
2347 \renewcommand*\@tocrmarg {2.70em}% 2.55em
2348 \renewcommand*\@dotsep{2.5}%
2349 % \end{macrocode}
2350 %
2351 % \section{Part}
2352 %
2353 % We want another vertical spacing at part headings.
2354 % \begin{macrocode}
2355 \renewcommand*{\partheadstartvskip}{\vspace*{.1\textheight}}
2356 \renewcommand*{\partheadmidvskip}{\par\nobreak\vspace{.5\baselineskip}}
2357 \renewcommand*{\partpagestyle}{empty}
2358 % \end{macrocode}
2359 %
2360 %
2361 % \section{Logos}
2362 %
2363 % I don't want to use package \textsf{hologo} for only one logo:
2364 % \changes{v1.28}{2022/07/17}{\cs{LuaTeX} and \cs{LuaLaTeX} added}
2365 % \begin{macrocode}
2366 \DeclareRobustCommand{\XeTeX}{%
2367 X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.10em\TeX
2368 }%
2369 \DeclareRobustCommand{\XeLaTeX}{%
2370 X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.10em\LaTeX
2371 }%
2372 \DeclareRobustCommand{\LuaTeX}{%
2373 Lua\TeX
2374 }
2375 \DeclareRobustCommand{\LuaLaTeX}{%
2376 Lua\LaTeX
2377 }
2378 % \end{macrocode}
2379 %
2380 % \section{Appendix}
2381 %
2382 % \begin{macro}{\appendix}
2383 % Use only first if used more than once. With this, every appendix file may
2384 % start with |\appendix|.
2385 % \begin{macrocode}
2386 \g@addto@macro\appendix{\global\let\appendix\relax}
2387 % \end{macrocode}
2388 % \end{macro}
2389 %
2390 % \section{Bibliography}
2391 %
2392 % \begin{macro}{\BibTeX}
2393 % I use the same hack like the \LaTeX{} team uses at \texttt{ltlogos.dtx}
2394 % for |\LaTeX|:
2395 % \begin{macrocode}
2396 \DeclareRobustCommand{\BibTeX}{B\kern-.05em%
2397 \hbox{$\m@th$%
2398 \csname S@\f@size\endcsname \fontsize\sf@size\z@
2399 \math@fontsfalse\selectfont
2400 I\kern-.025emB}%
2401 \kern-.08em%
2402 \-\TeX%
2403 }
2404 % \end{macrocode}
2405 % \end{macro}
2406 %
2407 % Use of a preamble and sime other usefull changes.
2408 % \begin{macrocode}
2409 \ifusebabelbib
2410 \AtBeginDocument{%
2411 \setbibpreamble{\GuideBibPreamble\bigskip}%
2412 \bibliographystyle{babalpha-fl}%
2413 \nocite{homepage}% added because of l3build
2414 \renewcommand*{\@openbib@code}{%
2415 \setlength{\parsep}{0pt}%
2416 \renewcommand*{\btxauthorcolon}[1]{:\par\nobreak}%
2417 \renewcommand*{\btxurlfont}{\par\nobreak\url}%
2418 \raggedright
2419 }%
2420 }
2421 % \end{macrocode}
2422 %
2423 % The generated argument of thebibliography is to short:
2424 % \begin{macrocode}
2425 \newcommand*{\OrigTheBibliography}{}
2426 \let\OrigTheBibliography\thebibliography
2427 \renewcommand*{\thebibliography}[1]{%
2428 \selectbiblanguage{\languagename}%
2429 \OrigTheBibliography{XXXX99}%
2430 }
2431 \else
2432 \AtBeginDocument{%
2433 \defbibnote{bibpreamble}{\GuideBibPreamble}%
2434 }%
2435 \addbibresource{guide.bib}
2436 \fi
2437 % \end{macrocode}
2438 %
2439 %
2440 % \section{Index}
2441 %
2442 % This is realy tricky. The index depends on an external perl script, which
2443 % splits the one index into several indexes. But first of all, we need to make
2444 % the raw index.
2445 % \begin{macrocode}
2446 \makeindex
2447 % \end{macrocode}
2448 %
2449 % Use of a preamble:
2450 % \begin{macrocode}
2451 \AtBeginDocument{\setindexpreamble{\GuideIndexPreamble\bigskip}}
2452 % \end{macrocode}
2453 %
2454 % \begin{macro}{\ifusemultiindex}
2455 % Now let's decide wether to use one index or to use a multi part index.
2456 % \begin{macrocode}
2457 \newif\ifusemultiindex
2458 \IfFileExists{\jobname-gen.ind}{\usemultiindextrue}{\usemultiindexfalse}
2459 \ifusemultiindex
2460 % \end{macrocode}
2461 % \end{macro}
2462 %
2463 % \begin{macro}{\printmultiindex}
2464 % \changes{v1.11a}{2016/11/02}{index label generation delayed}^^A
2465 % Print one part of the multi part index.
2466 % \begin{macrocode}
2467 \newcommand*{\printmultiindex}[3][]{%
2468 \begingroup
2469 \def\indexname{#2}%
2470 % \end{macrocode}
2471 % \begin{macro}{\CrossIndex}
2472 % Produce a reference from one index to another. The macro |\UseIndex| tells
2473 % the external splitt processor the index to be used for that entry. The
2474 % first argument is the entry to the index. The second is the shortcut of
2475 % the source index and the third is the shortcut of the index with the main
2476 % entry for the entry from first argument. This macro should be used at the
2477 % preamble of one part of the multi part index only. Because of this, it's
2478 % defined here only.
2479 % \begin{macrocode}
2480 \newcommand*{\CrossIndex}[3]{%
2481 \Index{##1=\UseIndex{##2}\protect##1>##3=\UseIndex{##2}\SeeSign
2482 \protect##3}%
2483 }%
2484 % \end{macrocode}
2485 % \end{macro}
2486 % \begin{macrocode}
2487 \ifx\relax#1\relax\let\index@preamble=\relax
2488 \else\def\index@preamble{#1}%
2489 \fi
2490 \def\index@setlabel{\label{idx:#3}}%
2491 \@input@{\jobname-#3.ind}%
2492 \endgroup
2493 }
2494 % \end{macrocode}
2495 % \begin{environment}{theindex}
2496 % I don't want every part of the index starting a new page. So I'll use the
2497 % \textsf{multicol} package to generate the two columns instead of
2498 % |\twocolumn|.
2499 % \begin{macrocode}
2500 \renewenvironment{theindex}{%
2501 \setchapterpreamble{\index@preamble}
2502 \begin{multicols}{2}[\idx@heading\vspace{-1\baselineskip}][.2\textheight]%
2503 \parindent\z@
2504 \setlength{\parskip}{\z@ \@plus .3\p@}%
2505 \setlength{\parfillskip}{\z@ \@plus 1fil}%
2506 \let\item\@idxitem
2507 \small\csname index@setlabel\endcsname
2508 }{%
2509 \end{multicols}%
2510 }
2511 % \end{macrocode}
2512 % \end{environment}
2513 % \end{macro}
2514 %
2515 % \begin{macro}{\printindex}
2516 % Print the full index.
2517 % \begin{macrocode}
2518 \renewcommand*{\printindex}{%
2519 \setchapterpreamble{\index@preamble}%
2520 \addchap{\indexname}%
2521 \let\index@preamble=\relax
2522 \renewcommand*\idx@heading{%
2523 \addsec{\indexname}%
2524 \ifx\index@preamble\relax
2525 \else\index@preamble\let\index@preamble=\relax\fi
2526 }%
2527 \printmultiindex{\GuidegenIndex}{gen}%
2528 \printmultiindex[%
2529 \CrossIndex{\GuideMacro}{gen}{\GuidecmdIndexShort}%
2530 \CrossIndex{\GuideEnvironment}{gen}{\GuidecmdIndexShort}%
2531 \CrossIndex{\GuideCounter}{gen}{\GuidecmdIndexShort}%
2532 \CrossIndex{\GuideLength}{gen}{\GuidecmdIndexShort}%
2533 ]{\GuidecmdIndex}{cmd}%
2534 \printmultiindex[%
2535 \CrossIndex{\GuideLength}{gen}{\GuidelenIndexShort}%
2536 \CrossIndex{\GuidePLength}{gen}{\GuidelenIndexShort}%
2537 \CrossIndex{\GuideCounter}{gen}{\GuidelenIndexShort}%
2538 ]{\GuidelenIndex}{len}%
2539 \printmultiindex[%
2540 \CrossIndex{\GuideFontElement}{gen}{\GuideelmIndexShort}%
2541 ]{\GuideelmIndex}{elm}%
2542 \printmultiindex[%
2543 \CrossIndex{\GuideFile}{gen}{\GuidefilIndexShort}%
2544 \CrossIndex{\GuidePackage}{gen}{\GuidefilIndexShort}%
2545 \CrossIndex{\GuideClass}{gen}{\GuidefilIndexShort}%
2546 ]{\GuidefilIndex}{fil}%
2547 \printmultiindex[%
2548 \CrossIndex{\GuideOption}{gen}{\GuideoptIndexShort}%
2549 ]{\GuideoptIndex}{opt}%
2550 \printmultiindex[%
2551 \CrossIndex{\GuideHook}{gen}{\GuidehokIndexShort}%
2552 ]{\GuidehokIndex}{hok}
2553 }
2554 \fi
2555 % \end{macrocode}
2556 % \end{macro}
2557 %
2558 % \begin{macro}{\indexsection}
2559 % Heading of the next section (e.g. the next character) at an index.
2560 % \begin{macrocode}
2561 \newcommand*{\indexsection}[1]{%
2562 \ifx\empty#1\empty\else
2563 \hspace{0pt plus 2fil}{{\usekomafont{disposition} #1}}\hspace{0pt plus
2564 1fil}\nopagebreak
2565 \fi
2566 }
2567 % \end{macrocode}
2568 % \end{macro}
2569 %
2570 % \begin{macro}{\indexdelim}
2571 % \begin{macro}{\indexdelimi}
2572 % \begin{macro}{\indexdelimii}
2573 % The delimiter after the index topic but before the page number. There are
2574 % three index levels, so there are three delimiters too.
2575 % \begin{macrocode}
2576 \newcommand*{\indexdelim}{\ \hspace{0pt plus 1fil}\penalty0\null\nobreak
2577 \dotfill~}
2578 \newcommand*{\indexdelimi}{~\dotfill\penalty0\ }
2579 \newcommand*{\indexdelimii}{~\dotfill\penalty0\ }
2580 % \end{macrocode}
2581 % \end{macro}
2582 % \end{macro}
2583 %
2584 % \begin{macro}{\UseIndex}
2585 % This macro does nothing but shows the external index split processor the
2586 % destination index.
2587 % \begin{macrocode}
2588 \DeclareRobustCommand*{\UseIndex}[1]{\ignorespaces}
2589 % \end{macrocode}
2590 % \end{macro}
2591 %
2592 % \begin{macro}{\SeeSign}
2593 % The symbol used to sign a reference at an index.
2594 % \begin{macrocode}
2595 \DeclareRobustCommand*{\SeeSign}{\ensuremath{\protect\rightarrow}~}
2596 % \end{macrocode}
2597 % \end{macro}
2598 %
2599 % \begin{macro}{\AddSeeIndex}
2600 % Add »\emph{see another index}« entry to an index. First argument is an
2601 % index entry to the index with shortcut of second argument. The third
2602 % argument is the name of another index given also by the shortcut at the
2603 % fourth argument.
2604 % \begin{macrocode}
2605 \newcommand*{\AddSeeIndex}[4]{%
2606 \ifusemultiindex
2607 \Index[seeindex{#4}]{#1=\UseIndex{#2}#1>#3=\UseIndex{#2}\SeeSign#3}%
2608 \fi
2609 }
2610 % \end{macrocode}
2611 % \begin{macro}{\seeindex}
2612 % Page number style of references to another index. This eats the page
2613 % number of the index entry and set's a page number reference to the label
2614 % of the other index. Don't use this on your own. This is need by
2615 % |\AddSeeIndex|.
2616 % \begin{macrocode}
2617 \newcommand*{\seeindex}[2]{\pageref{idx:#1}}
2618 % \end{macrocode}
2619 % \end{macro}
2620 % \end{macro}
2621 %
2622 % \begin{macro}{\IndexSeeAt}
2623 % A more general version of |\AddSeeIndex|. First (optional) argument is a
2624 % entry note (e.g. |\GuidePagestyle|). This is only used if option
2625 % \texttt{moreindexnotes} was set. Second argument is the entry. Third is
2626 % the shortcut of the source index, the index the entry should be set.
2627 % Fourth is the shortcut of the destination index, the index the entry
2628 % should reference. Fifth is the name of that index. Sixth is the output
2629 % command (e.g. |\Macro|) for the entry.
2630 % \begin{macrocode}
2631 \newcommand*{\IndexSeeAt}[6][\relax]{%
2632 \ifusemultiindex
2633 \if@moreindexnotes
2634 \edef\@tempa{idx@f@\string#1.\string#2.#3.#4}%
2635 \else
2636 \edef\@tempa{idx@f@\string#2.#3.#4}%
2637 \fi
2638 \expandafter\ifx\csname \@tempa\endcsname\relax
2639 \expandafter\gdef\csname \@tempa\endcsname{}%
2640 \begingroup
2641 \@tempswatrue
2642 \if@moreindexnotes
2643 \ifx\relax#1\relax\else\@tempswafalse
2644 \Index[seeindex{#4}]{%
2645 #2 (#1)=\UseIndex{#3}#6{#2} (\protect#1)>%
2646 #5=\UseIndex{#3}\SeeSign\protect#5}%
2647 \fi
2648 \fi
2649 \if@tempswa
2650 \Index[seeindex{#4}]{%
2651 #2=\UseIndex{#3}#6{#2}>#5=\UseIndex{#3}\SeeSign\protect#5}%
2652 \fi
2653 \endgroup
2654 \fi
2655 \fi
2656 }
2657 % \end{macrocode}
2658 % \end{macro}
2659 %
2660 % \begin{macro}{\Index}
2661 % Primary index command. First (optional) argument is the page number style
2662 % of the entry. Second argument is the entry. The page number style should
2663 % be either \texttt{indexother} or \texttt{indexmain}. Default is
2664 % \texttt{indexother}.
2665 % \begin{macrocode}
2666 \newcommand*{\Index}[2][indexother]{\index{#2|#1}}
2667 % \end{macrocode}
2668 % \end{macro}
2669 %
2670 % \begin{macro}{\BeginIndex}
2671 % \begin{macro}{\EndIndex}
2672 % \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
2673 % Its also usefull to define index range entries. These have three
2674 % arguments. First (optiona) argument is the page number style. Default of
2675 % this parameter is \texttt{indexmain}. See |\Index| for more information
2676 % about this parameter. The second parameter is the kind of index
2677 % entry. This is not the same like the name or shortcut of an index! See
2678 % |\Define|\dots|Index| for more information about the kind of an index
2679 % entry. The third argument is the index entry.
2680 % \begin{macrocode}
2681 \newif\ifnolabel
2682 \def\nolabelfalse{\global\let\ifnolabel\iffalse}%
2683 \def\nolabeltrue{\global\let\ifnolabel\iftrue}%
2684 \newcommand*{\BeginIndex}[3][indexmain]{%
2685 \expandafter\ifx\csname Index#2\endcsname\relax
2686 \GenericError{(scrguide)\@spaces\@spaces\@spaces\@spaces}{%
2687 Document scrguide Error: \string\BeginIndex\space with unknown
2688 index%
2689 }{Check the \string\BeginIndex-command or add a new index type
2690 ``#2''.}{%
2691 See scrguide.cls for more information.}%
2692 \else
2693 \csname Index#2\endcsname[(%)
2694 #1]{#3}%
2695 \push@IndexStack{{\do{#1}{#2}{#3}}}%
2696 \fi
2697 % \ifnolabel\nolabelfalse\else
2698 % \ifx\relax#2\relax\else
2699 % \begingroup
2700 % \def\SplitIndexValue##1~=##2~=##3\@nil{%
2701 % ##1\expandafter\ifx\expandafter\relax##2\relax\else.##2\fi
2702 % }%
2703 % \let\PName\@gobble
2704 % \let\PValue\@firstofone
2705 % \let\ensuremath\@firstofone
2706 % \let\textit\@firstofone
2707 % \def~{\string~}%
2708 % \lowercase{\def\@tempa{#2}}%
2709 % \edef\@tempa{\label@base.\@tempa.\SplitIndexValue#3~=~=\@nil}%
2710 % \pdfstringdef\@tempb{\@tempa}%
2711 % \expandafter\ifx\csname \@tempb\endcsname\relax
2712 % \expandafter\xdef\csname \@tempb\endcsname{\the\inputlineno}%
2713 % \xdef\@currentHref{\@tempb}%
2714 % \ClassInfo{scrguide}{Anchor: `\@currentHref'}%
2715 % \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
2716 % \label{desc:\@tempa}%
2717 % \else
2718 % \ClassWarning{scrguide}{%
2719 % Label \@tempa\space already defined at \csname
2720 % \@tempb\endcsname,\MessageBreak
2721 % ignored}%
2722 % \fi
2723 % \endgroup
2724 % \fi
2725 % \fi
2726 \penalty\@M\ignorespaces
2727 }
2728 \newlength\PreserveSkip
2729 \newcount\PreservePenalty
2730 \newcommand*{\CloseIndex}[3][indexmain]{%
2731 \PreservePenalty\lastpenalty
2732 \ifvmode\PreserveSkip\lastskip\else\unskip\PreserveSkip\z@\fi
2733 \ifdim \PreserveSkip>\z@
2734 \vskip -\PreserveSkip
2735 \fi
2736 \penalty\@M
2737 \expandafter\ifx\csname Index#2\endcsname\relax
2738 \GenericError{(scrguide)\@spaces\@spaces\@spaces\@spaces}{%
2739 Document scrguide Error: \string\EndIndex\space with unknown
2740 index%
2741 }{Check the \string\BeginIndex-command or add a new index type
2742 ``#2''.}{%
2743 See scrguide.cls for more information.}%
2744 \else
2745 \csname Index#2\endcsname[%(
2746 )#1]{#3}%
2747 \fi
2748 \ifdim\PreserveSkip >\z@
2749 \vskip\PreserveSkip
2750 \fi
2751 \penalty\PreservePenalty
2752 }
2753 \newcommand*{\EndIndex}[3][indexmain]{%
2754 \begingroup
2755 \@tempswatrue
2756 \def\do##1##2##3{%
2757 \Ifstr{#1}{##1}{%
2758 \Ifstr{#2}{##2}{%
2759 \Ifstr{\detokenize{#3}}{\detokenize{##3}}{}{\@tempswafalse}%
2760 }{\@tempswafalse}%
2761 }{\@tempswafalse}%
2762 \if@tempswa
2763 \else
2764 \ClassError{scrguide}{Index stack error}{%
2765 Should pop \string\do{#1}{#2}{\detokenize{#3}}\MessageBreak
2766 but have \string\do{##1}{##2}{\detokenize{##3}}%
2767 }%
2768 \push@IndexStack{{\do{##1}{##2}{##3}}}%
2769 \fi
2770 }%
2771 \def\StopIndexGroup{%
2772 \ClassError{scrguide}{Index stack error}{%
2773 Should pop \string\do{#1}{#2}{\detokenize{#3}}\MessageBreak
2774 but have \string\StopIndexGroup
2775 }%
2776 \push@IndexStack{\StopIndexGroup}%
2777 }%
2778 \expandafter\pop@IndexStack\@IndexStack\@nil
2779 \endgroup
2780 \CloseIndex[#1]{#2}{#3}%
2781 }
2782 % \end{macrocode}
2783 % \end{macro}
2784 % \end{macro}
2785 \let\@IndexStack\@empty
2786 \newcommand*{\push@IndexStack}[1]{% Einen Eintrag auf den Index Stapel werfen.
2787 \xdef\@IndexStack{\unexpanded{#1}\unexpanded\expandafter{\@IndexStack}}%
2788 }
2789 \newcommand*{\BeginIndexGroup}{% Am Anfang einer Gruppe auf den Stack die
2790 % Index-Gruppen-Trennmarke packen.
2791 \push@IndexStack{\StopIndexGroup}%
2792 }
2793 \newif\if@revertexampleskip
2794 \newcommand*{\EndIndexGroup}{% Den Stapel bis zur nächsten Stop-Marke
2795 % verarbeiten.
2796 \ifvmode
2797 \ifdim \lastskip=\topsep
2798 \typeout{TRACE: topsep --> true}%
2799 \@revertexampleskiptrue
2800 \else
2801 \ifdim \lastskip=\partopsep
2802 \typeout{TRACE: partopsep --> true}%
2803 \@revertexampleskiptrue
2804 \else
2805 \@revertexampleskipfalse
2806 \fi
2807 \fi
2808 \fi
2809 \ifx\@IndexStack\@empty
2810 \ClassError{scrguide}{cannot end index group}{%
2811 You've told me to end the current index group,\MessageBreak
2812 but there is no more index group open%
2813 }%
2814 \else
2815 \begingroup
2816 \let\StopIndexGroup\@tempswafalse
2817 \@tempswatrue%(
2818 \def\do##1##2##3{%
2819 \CloseIndex[##1]{##2}{##3}%
2820 }%
2821 \@whilesw \if@tempswa \fi {%
2822 \expandafter\pop@IndexStack\@IndexStack\@nil
2823 }%
2824 \endgroup
2825 \fi
2826 }
2827 \def\pop@IndexStack#1#2\@nil{% Ein Argument von Stapel holen und verarbeiten.
2828 \gdef\@IndexStack{#2}#1%
2829 }
2830 \newcommand*\CleanUpIndexStack{%
2831 \ifx\@IndexStack\@empty\else
2832 \ClassError{scrguide}{Index stack error}{%
2833 The index stack should be empty\MessageBreak
2834 but it still contains: \MessageBreak
2835 \expandafter\detokenize\expandafter{\@IndexStack}%
2836 }%
2837 \begingroup
2838 \let\StopIndexGroup\relax
2839 \def\do##1##2##3{%
2840 \CloseIndex[##1]{##2}{##3}%
2841 }%
2842 \@IndexStack
2843 \global\let\@IndexStack\@empty
2844 \endgroup
2845 \fi
2846 }
2847 \AtEndDocument{\CleanUpIndexStack}
2848 \l@preto@macro\chapter{\CleanUpIndexStack}
2849 \l@preto@macro\part{\CleanUpIndexStack}
2850 %
2851 % Now we have to define different kinds of index entries. We have entries that
2852 % will be added to only one index. We have entries that will be added to one
2853 % index with reference to that index at another index. And there are even
2854 % entries that will be added to one index with reference to that index from
2855 % another index and from the main index.
2856 % \begin{macro}{\DefineSingleIndex}
2857 % \changes{v1.22}{2019/11/14}{support \cs{PName} in second argument}%^^A
2858 % This defines a single index entry, e.g. of commands. A macro will be
2859 % defined that addes the entry only to one index. First (optional)
2860 % agrument is a not, which shows the kind of entry (e.g. |\GuideMacro|). The
2861 % second is the macro postfix (e.g. \texttt{Cmd} would define |\IndexCmd|).
2862 % The third is the shortcut of the index to bee used
2863 % (e.g. \texttt{cmd}). The fourth argument is the command to be used to
2864 % output (format) the index entries (e.g. |\Macro|).
2865 % \begin{macrocode}
2866 \newcommand*{\DefineSingleIndex}[4][\relax]{%
2867 \ifx\relax#1\relax
2868 \expandafter\newcommand\expandafter*%
2869 \csname Index#2\endcsname[2][indexother]{%
2870 \begingroup
2871 \let\PName\@firstofone
2872 \protected@edef\reserved@a{%
2873 \unexpanded{\endgroup\Index[##1]}%
2874 {##2\unexpanded{=\UseIndex{#3}#4{##2}}}%
2875 }%
2876 \reserved@a
2877 }%
2878 \else
2879 \expandafter\newcommand\expandafter*%
2880 \csname Index#2\endcsname[2][indexother]{%
2881 \begingroup
2882 \let\PName\@firstofone
2883 \protected@edef\reserved@a{%
2884 \unexpanded{\endgroup\Index[##1]}%
2885 {##2 \unexpanded{(#1)=\UseIndex{#3}#4{##2} (\protect #1)}}%
2886 }%
2887 \reserved@a
2888 }%
2889 \fi
2890 }
2891 % \end{macrocode}
2892 % \end{macro}
2893 % \begin{macro}{\DefineDoubleIndex}
2894 % This defines a double index entry, e.g. of page styles. A macro will be
2895 % defined that adds the entry to an index and also adds a reference entry to
2896 % the main index. See |\DefineSingleIndex| for informations about the
2897 % parameters. If a note was given (first optional argument) it will be used
2898 % to make a top level entry to the main index with the corresponding
2899 % subentry.
2900 % \begin{macrocode}
2901 \newcommand*{\DefineDoubleIndex}[4][\relax]{%
2902 % #1 = optional entry note (\GuidePagestyle)
2903 % #2 = index macro postfix (Pagestyle)
2904 % #3 = see-from-index to be used (cmd)
2905 % #4 = output command (\Macro)
2906 \ifx\relax#1\relax
2907 \expandafter\newcommand\expandafter*%
2908 \csname Index#2\endcsname[2][indexother]{%
2909 \Index[##1]{##2=\UseIndex{gen}#4{##2}}%
2910 \IndexSeeAt{##2}{#3}{gen}{\GuidegenIndex}{#4}%
2911 }%
2912 \else
2913 \expandafter\newcommand\expandafter*%
2914 \csname Index#2\endcsname[2][indexother]{%
2915 \Index[##1]{##2 (#1)=\UseIndex{gen}#4{##2} (\protect #1)}%
2916 \Index[##1]{\csname Guide#2IndexCategoryExpanded\endcsname=\UseIndex{gen}\expandafter\protect\csname Guide#2IndexCategory\endcsname>##2=\UseIndex{gen}#4{##2}}%
2917 \IndexSeeAt[#1]{##2}{#3}{gen}{\GuidegenIndex}{#4}%
2918 }%
2919 \fi
2920 }
2921 % \end{macrocode}
2922 % \end{macro}
2923 % \begin{macro}{\DefineTripleIndex}
2924 % This defines a triple index entry, e.g. of lengths. A macro will be
2925 % defined that adds the entry to an index and also adds a reference entry to
2926 % another index and the main index. The first (optional) argument is a note
2927 % (e.g. (|\GuideLength|) that will be used to generate a top level index
2928 % entry to the main index. The second argument is the macro postfix
2929 % (e.g. \texttt{Length} to define |\IndexLength|). The third argument is the
2930 % shortcut of the primary index (e.g. \texttt{len}). The fourth argument is
2931 % the short name of that index (e.g. |\GuidelenIndexShort|). The fifth
2932 % argument is the shortcut of the index to put the reference into
2933 % (e.g. \texttt{cmd}). The sixth argument is the output command of the index
2934 % entry (e.g. |\Length|).
2935 % \begin{macrocode}
2936 \newcommand*{\DefineTripleIndex}[6][\relax]{%
2937 % #1 = optional entry note (\GuideLength)
2938 % #2 = index macro postfix (Length)
2939 % #3 = index to be used (len)
2940 % #4 = index name (\GuidelenIndexShort)
2941 % #5 = also-from-index to be used (cmd)
2942 % #6 = output command (\Macro)
2943 \ifx\relax#1\relax
2944 \expandafter\newcommand\expandafter*%
2945 \csname Index#2\endcsname[2][indexother]{%
2946 \IndexSeeAt{##2}{gen}{#3}{#4}{#6}%
2947 \IndexSeeAt{##2}{#5}{#3}{#4}{#6}%
2948 \Index[##1]{##2=\UseIndex{#3}#6{##2}}%
2949 \IndexSeeAt{##2}{#3}{gen}{\GuidegenIndex}{#4}%
2950 }%
2951 \else
2952 \expandafter\newcommand\expandafter*%
2953 \csname Index#2\endcsname[2][indexother]{%
2954 % \IndexSeeAt[#1]{##2}{gen}{#3}{#4}{#6}%
2955 % \Index[##1]{#1=\UseIndex{gen}\protect#1>##2=\UseIndex{gen}#6{##2}}%
2956 \IndexSeeAt[#1]{##2}{#5}{#3}{#4}{#6}%
2957 \Index[##1]{##2 (#1)=\UseIndex{#3}#6{##2} (\protect #1)}%
2958 }%
2959 \fi
2960 }
2961 % \end{macrocode}
2962 % \end{macro}
2963 %
2964 % After this, let's define all used kinds of index entries:
2965 % \begin{macrocode}
2966 \DefineSingleIndex{Cmd}{cmd}{\Macro}
2967 \DefineDoubleIndex[\GuidePagestyle]{Pagestyle}{cmd}{\PValue}
2968 \DefineDoubleIndex[\GuideFloatstyle]{Floatstyle}{cmd}{\PValue}
2969 \DefineTripleIndex[\GuideCounter]{Counter}
2970 {len}{\GuidelenIndexShort}{cmd}{\Counter}
2971 \DefineTripleIndex[\GuideLength]{Length}
2972 {len}{\GuidelenIndexShort}{cmd}{\Length}
2973 \ifusemultiindex
2974 \DefineSingleIndex[\GuideEnvironment]{Env}{cmd}{\Environment}
2975 \DefineSingleIndex{Option}{opt}{\Option}
2976 \DefineSingleIndex[\GuidePackage]{Package}{fil}{\Package}
2977 \DefineSingleIndex[\GuideClass]{Class}{fil}{\Class}
2978 \DefineSingleIndex{File}{fil}{\File}
2979 \DefineSingleIndex[\GuideVariable]{Variable}{cmd}{\Variable}
2980 \DefineSingleIndex{FontElement}{elm}{\FontElement}
2981 \DefineSingleIndex{PLength}{len}{\PLength}
2982 \DefineSingleIndex{DoHook}{hok}{\DoHook}
2983 \else
2984 \DefineDoubleIndex[\GuideEnvironment]{Env}{cmd}{\Environment}
2985 \DefineDoubleIndex{Option}{opt}{\Option}
2986 \DefineDoubleIndex[\GuidePackage]{Package}{fil}{\Package}
2987 \DefineDoubleIndex[\GuideClass]{Class}{fil}{\Class}
2988 \DefineDoubleIndex{File}{fil}{\File}
2989 \DefineDoubleIndex[\GuideVariable]{Variable}{cmd}{\Variable}
2990 \DefineDoubleIndex{FontElement}{elm}{\FontElement}
2991 \DefineDoubleIndex{PLength}{len}{\PLength}
2992 \DefineDoubleIndex{DoHook}{hok}{\DoHook}
2993 \fi
2994 % \end{macrocode}
2995 %
2996 % \begin{macro}{\indexrm}
2997 % \begin{macro}{\indexother}
2998 % \begin{macro}{\indexit}
2999 % \begin{macro}{\indexbf}
3000 % \begin{macro}{\indexmain}
3001 % \begin{macro}{\indexsl}
3002 % \begin{macro}{\indexsf}
3003 % \begin{macro}{\indexsc}
3004 % Some helpers to get page numbers with different fontification but hyper
3005 % links.
3006 % \begin{macrocode}
3007 \newcommand*{\indexrm}[1]{\textrm{\hyperpage{#1}}}
3008 \newcommand*{\indexother}{}\let\indexother\indexrm
3009 \newcommand*{\indexit}[1]{\textit{\hyperpage{#1}}}
3010 \newcommand*{\indexbf}[1]{\textbf{\hyperpage{#1}}}
3011 \newcommand*{\indexmain}{}\let\indexmain\indexbf
3012 \newcommand*{\indexsl}[1]{\textsl{\hyperpage{#1}}}
3013 \newcommand*{\indexsf}[1]{\textsf{\hyperpage{#1}}}
3014 \newcommand*{\indexsc}[1]{\textsc{\hyperpage{#1}}}
3015 % \end{macrocode}
3016 % \end{macro}
3017 % \end{macro}
3018 % \end{macro}
3019 % \end{macro}
3020 % \end{macro}
3021 % \end{macro}
3022 % \end{macro}
3023 % \end{macro}
3024 %
3025 %
3026 \endinput
3027 %
3028 %%% Local Variables:
3029 %%% mode: doctex
3030 %%% coding: utf-8
3031 %%% ispell-local-dictionary: "en_US"
3032 %%% eval: (flyspell-mode 1)
3033 %%% End: