Debian Codegraph @

texmf-dist/source/latex/koma-script/scrkernel-paragraphs.dtx

raw
1 % \iffalse meta-comment
2 % ======================================================================
3 % scrkernel-paragraphs.dtx
4 % Copyright (c) Markus Kohm, 2002-2025
5 %
6 % This file is part of the LaTeX2e KOMA-Script bundle.
7 %
8 % This work may be distributed and/or modified under the conditions of
9 % the LaTeX Project Public License, version 1.3c of the license.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later and of this work.
14 %
15 % This work has the LPPL maintenance status "author-maintained".
16 %
17 % The Current Maintainer and author of this work is Markus Kohm.
18 %
19 % This work consists of all files listed in MANIFEST.md.
20 % ======================================================================
21 %%% From File: $Id: scrkernel-paragraphs.dtx 4145 2025-05-13 16:54:14Z kohm $
22 %<option>%%% (run: option)
23 %<body>%%% (run: body)
24 %<*dtx>
25 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
26 \begingroup
27 \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
28 \filedate$Date: 2025-05-13 18:54:14 +0200 (Di, 13. Mai 2025) $
29 \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
30 \filerevision$Revision: 4145 $
31 \edef\reserved@a{%
32 \noexpand\endgroup
33 \noexpand\ProvidesFile{scrkernel-paragraphs.dtx}%
34 [\filedate\space\filerevision\space
35 KOMA-Script
36 (paragraphs)]
37 }%
38 \reserved@a
39 \documentclass[USenglish]{koma-script-source-doc}
40 \usepackage{babel}
41 \setcounter{StandardModuleDepth}{3}
42 \begin{document}
43 \DocInput{scrkernel-paragraphs.dtx}
44 \end{document}
45 %</dtx>
46 % \fi
47 %
48 % \changes{v2.95}{2002/06/25}{first version after splitting \file{scrclass.dtx}}
49 % \changes{v3.36}{2022/03/07}{switch over from \cls*{scrdoc} to
50 % \cls*{koma-script-source-doc}}
51 % \changes{v3.36}{2022/03/07}{whole implementation documentation in English}
52 % \changes{v3.40}{2023/04/17}{guide names changed}
53 %
54 % \GetFileInfo{scrkernel-paragraphs.dtx}
55 % \title{The Code Related to Paragraph Building and Page Building of
56 % \href{https://komascript.de}{\KOMAScript} Classes}
57 % \author{\href{mailto:[email protected]}{Markus Kohm}}
58 % \date{Revision \fileversion{} of \filedate}
59 % \maketitle
60 % \begin{abstract}
61 % \file{scrkernel-paragraphs.dtx} does all the things about configuration of
62 % paragraphs and page breaking. Some of them are very special for
63 % \KOMAScript.
64 % \end{abstract}
65 % \tableofcontents
66 %
67 % \section{User Manual}
68 %
69 % You can find the user documentation the commands implemented here in the
70 % \KOMAScript{} manual, either the German \file{scrguide-de.pdf} or the
71 % English \file{scrguide-en.pdf}.
72 %
73 % \MaybeStop{\PrintIndex}
74 %
75 % \section{Implementation of Paragraphs and Pages}
76 %
77 % Almost all of this code is for the classes only.
78 % \begin{macrocode}
79 %<*class>
80 % \end{macrocode}
81 %
82 % \subsection{Options and macros to handle the paragraph layout}
83 %
84 % Already from version 2.8i \KOMAScript can handle paragraph skips instead of
85 % indenting paragraphs. But the corresponding code has changed a lot over the
86 % years.
87 %
88 % \begin{command}{\setparsizes}
89 % \changes{v2.95}{2004/11/05}{added}
90 % \changes{v3.17}{2015/03/10}{support for internal option value storage}
91 % \changes{v3.19}{2015/07/29}{\cs{par@update} should not reset itself to
92 % \cs{default@par@update} in the document preamble}
93 % \changes{v3.39}{2022/11/11}{initial dot removed from member argument of
94 % option storage commands}
95 % \begin{macro}{\f@parindent}
96 % \changes{v2.95}{2004/11/05}{added}
97 % \begin{macro}{\f@parskip,\f@parfillskip}
98 % \changes{v2.95}{2004/11/05}{added}
99 % \changes{v2.95}{2004/11/05}{meaning changed}
100 % \begin{macro}{\scr@parindent}
101 % \changes{v2.95}{2004/11/05}{added}
102 % \begin{macro}{\scr@parskip,\scr@parfillskip}
103 % \changes{v2.95}{2004/11/05}{added}
104 % \changes{v2.95}{2004/11/05}{meaning changed}
105 % Command
106 % \begin{quote}
107 % \cs{setparsizes}\marg{indent}\marg{skip}\marg{fill}
108 % \end{quote}
109 % not only sets the three main paragraph parameters of \TeX: \len{parskip},
110 % \len{parindent}, \len{parfillskip}. Because of option \opt{parskip=relative}
111 % it has to use a kind of delayed setting of these parameters at least at the
112 % document preamble. So these settings are not activated until
113 % \cs{selectfont}. To do so, not the \TeX{} parameters are changed, but the
114 % current values of the \TeX{} parameters are stored to \cs{f@parindent},
115 % \cs{f@parskip} and \cs{f@parfillskip} and the new values are stored to
116 % \cs{scr@parindent}, \cs{scr@parskip} and \cs{scr@parfillskip}
117 % only. Additionally \cs{par@update} is used to activate these new
118 % values. Later we will use a hook to automatically execute \cs{par@update}
119 % with every \cs{selectfont}. The current value storage is initialized twice:
120 % First immediately and second inside at the end of the class.
121 % \begin{description}
122 % \item[ToDo:] Is the second initialization really needed? Wouldn't it be done
123 % with the class options? Here user changes are not to be expected, because
124 % we are still inside the class and therefore there is no user interaction.
125 % \end{description}
126 % \begin{macro}{\par@update}
127 % \changes{v2.95}{2004/11/05}{added}
128 % \changes{v3.20}{2016/02/22}{\cs{AtBeginDocument} code added}
129 % \begin{macro}{\default@par@update}
130 % \changes{v2.95}{2004/11/05}{added}
131 % \begin{macro}{\par@updaterelative}
132 % \changes{v2.95}{2004/11/05}{added}
133 % \changes{v3.36}{2022/03/07}{using \cs{reserved@a} instead of \cs{@tempa}}
134 % \begin{macro}{\parindent@update,\parskip@update,\parfillskip@update}
135 % \changes{v2.95}{2004/11/05}{added}
136 % \changes{v3.36}{2022/03/07}{using \cs{reserved@a} and \cs{reserved@b}
137 % instead if \cs{@tempa} and \cs{@tempb}}
138 % The initial \cs{par@update} action is to do nothing. But with
139 % \opt{parskip=relative} it always and after \cs{setparsizes} it once (or in
140 % the document preamble also always) has to reactivate the new values. This is
141 % done using \cs{default@par@update} and
142 % \cs{par@updaterelative}. \cs{default@par@update} is either a do nothing
143 % (\opt{parskip=absolute}) or \cs{par@updaterelative}
144 % (\opt{parskip=relative}). \cs{par@updaterelative} does the real update.
145 % \begin{description}
146 % \item[ToDo:] Sometimes internally \cs{par@updaterelative} is used instead of
147 % \cs{selectfont} to do an immediate update after \cs{setparsizes}. But is
148 % this correct? Wouldn't be \cs{selectfont} the correct action, to also
149 % reset the definition of \cs{par@update}?
150 % \item[ToDO:] Does the \cs{AtBeginCode} execution of \cs{par@update} make
151 % sense? The \cs{par@update} is done after the initial \cs{normalsize} and
152 % the initial \cs{selectfont}. So shouldn't this be enough?
153 % \end{description}
154 % \begin{macrocode}
155 %<*option>
156 \newcommand*{\setparsizes}[3]{%
157 \edef\f@parindent{\the\parindent}%
158 \edef\f@parskip{\the\parskip}%
159 \edef\f@parfillskip{\the\parfillskip}%
160 \def\scr@parindent{#1}%
161 \def\scr@parskip{#2}%
162 \def\scr@parfillskip{#3}%
163 \def\par@update{%
164 \if@atdocument\let\par@update\default@par@update\fi
165 \par@updaterelative
166 }%
167 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{false}%
168 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{never}%
169 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{full}%
170 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{full-}%
171 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{full+}%
172 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{full*}%
173 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{half}%
174 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{half-}%
175 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{half+}%
176 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{half*}%
177 }
178 \newcommand*{\f@parindent}{\the\parindent}
179 \newcommand*{\f@parskip}{\the\parskip}
180 \newcommand*{\f@parfillskip}{\the\parfillskip}
181 \newcommand*{\scr@parindent}{1em}
182 \newcommand*{\scr@parskip}{\z@}
183 \newcommand*{\scr@parfillskip}{\z@ \@plus 1fil}
184 \AtEndOfClass{%
185 \edef\f@parindent{\the\parindent}%
186 \edef\f@parskip{\the\parskip}%
187 \edef\f@parfillskip{\the\parfillskip}%
188 }
189 \newcommand*{\par@update}{}
190 \let\par@update\relax
191 \newcommand*{\default@par@update}{}
192 \let\default@par@update\relax
193 \AtBeginDocument{\par@update}
194 %</option>
195 % \end{macrocode}
196 % Because of the currently complicated initialization, i.e., when switching
197 % between \cs{parskip=absolute} and \cs{parskip=relative}, we currently define
198 % \cs{par@updaterelative} not before the class options has been processed. New
199 % values are only set, if between the last \cs{setparsizes} and the current
200 % \cs{par@updaterelative} (e.g. inside \cs{selectfont}) the user has not
201 % changed the \TeX{} variables. If he has changed the \TeX{} variables instead
202 % of using \cs{setparsizes} we think, he does not want any other change. And
203 % because of to be able to do the tests inside a group without permanent
204 % change of \cs{reserved@a} we use three additional helpers.
205 % \begin{macrocode}
206 %<*body>
207 \newcommand*{\par@updaterelative}{%
208 \begingroup
209 \edef\reserved@a{\the\parindent}\ifx\reserved@a\f@parindent
210 \aftergroup\parindent@update
211 %<*trace>
212 \else
213 \ClassInfo{\KOMAClassName}{\string\parindent\space not changed}%
214 %</trace>
215 \fi
216 \edef\reserved@a{\the\parskip}\ifx\reserved@a\f@parskip
217 \aftergroup\parskip@update
218 %<*trace>
219 \else
220 \ClassInfo{\KOMAClassName}{\string\parskip\space not changed}%
221 %</trace>
222 \fi
223 \edef\reserved@a{\the\parfillskip}\ifx\reserved@a\f@parfillskip
224 \aftergroup\parfillskip@update
225 %<*trace>
226 \else
227 \ClassInfo{\KOMAClassName}{\string\parfillskip\space not changed}%
228 %</trace>
229 \fi
230 \endgroup
231 }
232 \newcommand*{\parindent@update}{%
233 \scr@defaultunits\parindent\scr@parindent
234 \begingroup
235 \let\reserved@b\endgroup
236 \edef\reserved@a{\the\parindent}\ifx\reserved@a\f@parindent\else
237 \def\reserved@b{\endgroup\edef\f@parindent{\the\parindent}}%
238 %<trace> \ClassInfo{\KOMAClassName}{\string\parindent=\the\parindent}%
239 \fi
240 \reserved@b
241 }
242 \newcommand*{\parskip@update}{%
243 \scr@defaultunits\parskip\scr@parskip
244 \begingroup
245 \let\reserved@b\endgroup
246 \edef\reserved@a{\the\parskip}\ifx\reserved@a\f@parskip\else
247 \def\reserved@b{\endgroup\edef\f@parskip{\the\parskip}}%
248 %<trace> \ClassInfo{\KOMAClassName}{\string\parskip=\the\parskip}%
249 \fi
250 \reserved@b
251 }
252 \newcommand*{\parfillskip@update}{%
253 \scr@defaultunits\parfillskip\scr@parfillskip
254 \begingroup
255 \let\reserved@b\endgroup
256 \edef\reserved@a{\the\parfillskip}\ifx\reserved@a\f@parfillskip\else
257 \def\reserved@b{\endgroup\edef\f@parfillskip{\the\parfillskip}}%
258 %<trace> \ClassInfo{\KOMAClassName}{\string\parfillskip=\the\parfillskip}%
259 \fi
260 \reserved@b
261 }
262 %</body>
263 % \end{macrocode}
264 % \end{macro}^^A \parindent@update,\parskip@update,\parfillskip@update}
265 % \end{macro}^^A \par@updaterelative
266 % \end{macro}^^A \default@par@update
267 % \end{macro}^^A \par@update
268 % \end{macro}^^A \scr@parskip,\scr@parfillskip
269 % \end{macro}^^A \scr@parindent
270 % \end{macro}^^A \f@parskip,\f@parfillskip
271 % \end{macro}^^A \f@parindent
272 % \end{command}^^A \setparsizes
273 %
274 % \begin{option}{parskip}
275 % \changes{v2.8i}{2001/07/22}{added}
276 % \changes{v2.95}{2006/03/11}{changed into \pkg{keyval} option}
277 % \changes{v3.08}{2010/12/14}{value \opt{\quotechar=never} added}
278 % \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}.}
279 % \changes{v3.17}{2015/03/10}{using value storage}
280 % \changes{v3.25}{2017/09/27}{typo fix in \cs{FamilyKeyStateUnknownValue}}
281 % \changes{v3.26b}{2019/02/01}{\cs{baselineskip} replaced by 1\cs{baselineskip}}
282 % \changes{v3.39}{2022/11/11}{initial dot removed from member argument of
283 % option storage commands}
284 % \begin{option}{parindent,parskip-,parskip+,parskip*,
285 % halfparskip,halfparskip-,halfparskip+,halfparskip*}
286 % \changes{v2.8i}{2001/07/22}{added}
287 % \changes{v2.95}{2006/03/11}{obsolete}
288 % \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by
289 % \cs{PackageInfoNoLine}}
290 % \changes{v3.01a}{2008/11/20}{deprecated}
291 % \changes{v3.99}{2022/11/16}{removed from \KOMAScript~4}
292 % Originally we have had nine options for all the paragraph indent and skip
293 % settings. Using \pkg*{scrbase} we have only one option with additional
294 % settings for relative and absolute values and paragraph indent without glue
295 % for paragraph skip.
296 % \begin{macrocode}
297 %<*option>
298 \KOMA@key{parskip}[true]{%
299 \begingroup
300 \KOMA@set@ncmdkey{parskip}{@tempa}{%
301 {never}{0},%
302 {false}{1},{off}{1},{no}{1},%
303 {full-}{2},%
304 {half-}{3},%
305 {full}{4},{true}{4},{on}{4},{yes}{4},%
306 {half}{5},%
307 {full+}{6},%
308 {half+}{7},%
309 {full*}{8},%
310 {half*}{9},%
311 {relative}{10},%
312 {absolute}{11}%
313 }{#1}%
314 \ifx\FamilyKeyState\FamilyKeyStateProcessed
315 \aftergroup\FamilyKeyStateProcessed
316 \ifcase\number\@tempa% 0
317 \endgroup
318 \setparsizes{1em}{\z@}{\z@ \@plus 1fil}%
319 \KOMA@kav@add{\KOMAClassFileName}{parskip}{never}%
320 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
321 \or% 1
322 \endgroup
323 \setparsizes{1em}{\z@ \@plus \p@}{\z@ \@plus 1fil}%
324 \KOMA@kav@add{\KOMAClassFileName}{parskip}{false}%
325 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
326 \or% 2
327 \endgroup
328 \setparsizes{\z@}{1\baselineskip \@plus .1\baselineskip}{%
329 \z@ \@plus 1fil}%
330 \KOMA@kav@add{\KOMAClassFileName}{parskip}{full-}%
331 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
332 \or% 3
333 \endgroup
334 \setparsizes{\z@}{.5\baselineskip \@plus .5\baselineskip}{%
335 \z@ \@plus 1fil}%
336 \KOMA@kav@add{\KOMAClassFileName}{parskip}{half-}%
337 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
338 \or% 4
339 \endgroup
340 \setparsizes{\z@}{1\baselineskip \@plus .1\baselineskip}{%
341 1em \@plus 1fil}%
342 \KOMA@kav@add{\KOMAClassFileName}{parskip}{full}%
343 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
344 \or% 5
345 \endgroup
346 \setparsizes{\z@}{.5\baselineskip \@plus .5\baselineskip}{%
347 1em \@plus 1fil}%
348 \KOMA@kav@add{\KOMAClassFileName}{parskip}{half}%
349 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
350 \or% 6
351 \endgroup
352 \setparsizes{\z@}{1\baselineskip \@plus .1\baselineskip}{%
353 .3333\linewidth\@plus 1fil}%
354 \KOMA@kav@add{\KOMAClassFileName}{parskip}{full+}%
355 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
356 \or% 7
357 \endgroup
358 \setparsizes{\z@}{.5\baselineskip \@plus .5\baselineskip}{%
359 .3333\linewidth \@plus 1fil}%
360 \KOMA@kav@add{\KOMAClassFileName}{parskip}{half+}%
361 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
362 \or% 8
363 \endgroup
364 \setparsizes{\z@}{1\baselineskip \@plus .1\baselineskip}{%
365 .25\linewidth \@plus 1fil}%
366 \KOMA@kav@add{\KOMAClassFileName}{parskip}{full*}%
367 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
368 \or% 9
369 \endgroup
370 \setparsizes{\z@}{.5\baselineskip \@plus .5\baselineskip}{%
371 .25\linewidth \@plus 1fil}%
372 \KOMA@kav@add{\KOMAClassFileName}{parskip}{half*}%
373 \if@atdocument\AfterKOMAoptions{\selectfont}\fi
374 \or% 10
375 \endgroup
376 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{absolute}%
377 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{relative}%
378 \KOMA@kav@add{\KOMAClassFileName}{parskip}{relative}%
379 \ifx\par@updaterelative\undefined
380 \expandafter\AtEndOfClass
381 \else
382 \expandafter\@firstofone
383 \fi
384 {%
385 \ifx\par@update\default@par@update
386 \let\par@update\par@updaterelative
387 \fi
388 \let\default@par@update=\par@updaterelative
389 }%
390 \or%11
391 \endgroup
392 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{absolute}%
393 \KOMA@kav@remove{\KOMAClassFileName}{parskip}{relative}%
394 \KOMA@kav@add{\KOMAClassFileName}{parskip}{absolute}%
395 \ifx\par@updaterelative\undefined
396 \expandafter\AtEndOfClass
397 \else
398 \expandafter\@firstofone
399 \fi
400 {%
401 \ifx\par@update\default@par@update
402 \let\par@update\relax
403 \fi
404 \let\default@par@update=\relax
405 }%
406 \else% should never be
407 \endgroup
408 \fi
409 \else
410 \endgroup
411 \FamilyKeyStateUnknownValue
412 \fi
413 }
414 %<*!v4>
415 \KOMA@DeclareDeprecatedOption{parskip-}{parskip=full-}
416 \KOMA@DeclareDeprecatedOption{parskip+}{parskip=full+}
417 \KOMA@DeclareDeprecatedOption{parskip*}{parskip=full*}
418 \KOMA@DeclareDeprecatedOption{halfparskip}{parskip=half}
419 \KOMA@DeclareDeprecatedOption{halfparskip-}{parskip=half-}
420 \KOMA@DeclareDeprecatedOption{halfparskip+}{parskip=half+}
421 \KOMA@DeclareDeprecatedOption{halfparskip*}{parskip=half*}
422 \KOMA@DeclareDeprecatedOption{parindent}{parskip=false}
423 %</!v4>
424 \KOMA@kav@add{\KOMAClassFileName}{parskip}{false}
425 \KOMA@kav@add{\KOMAClassFileName}{parskip}{absolute}
426 %</option>
427 % \end{macrocode}
428 % \end{option}^^A parindent … halfparskip*
429 % \end{option}^^A parskip
430 %
431 % \changes{v2.8i}{2001/07/22}{don't change \cs{baselinestretch}}
432 %
433 % \begin{length}{\lineskip,\normallineskip}
434 % The minimum line skip.
435 % \begin{macrocode}
436 %<*body>
437 \setlength{\lineskip}{\p@}
438 \setlength{\normallineskip}{\p@}
439 % \end{macrocode}
440 % \end{length}
441 %
442 % \begin{command}{\selectfont}
443 % \changes{v2.95}{2004/11/05}{added}
444 % \changes{v3.33}{2021/01/21}{from \LaTeX{} 2021/06/01 use hook instead of
445 % patch}
446 % \changes{v3.44}{2025/05/13}{code for \LaTeX{} before 2021/06/01 removed}
447 % Because of \opt{parskip=relative} we need a hook to activate the changes of
448 % the paragraph values. A good place to do so is \cs{selectfont}. With
449 % \KOMAScript{} 3.00 we needed to patch this command. But from \LaTeX{}
450 % 2021/06/01 we can use a new generic hook.
451 % \begin{macrocode}
452 \AddToHook{selectfont}{\par@update}%
453 \AfterPackage{everysel}{%
454 \IfPackageAtLeastTF{everysel}{2021/01/18}{}{%
455 \ClassError{\KOMAClassName}{%
456 incompatible `everysel' detected
457 }{%
458 You are using an old version of `everysel' in combination with a
459 LaTeX\MessageBreak
460 version >= 2021/06/01 and KOMA-Script >= 3.33. This combination
461 is\MessageBreak
462 not supported.\MessageBreak
463 You could switch back to an older LaTeX using package
464 `latexrelease'.\MessageBreak
465 But I recommend to update `everysel'%
466 }%
467 }%
468 }%
469 \AfterPackage{tracefnt}{%
470 \IfPackageAtLeastTF{tracefnt}{2020/12/22}{}{%
471 \ClassError{\KOMAClassName}{%
472 incompatible `tracefnt' detected
473 }{%
474 `tracefnt' is a LaTeX base package and therefore should be updated
475 together\MessageBreak
476 with LaTeX kernel. So this should never happen! Please check
477 your\MessageBreak
478 LaTeX installation%
479 }%
480 }%
481 }%
482 % \end{macrocode}
483 % \end{command}^^A \selectfont
484 %
485 % \begin{macro}{\scr@selectfont,\scr@new@selectfont}
486 % \changes{v2.95}{2006/04/14}{added}
487 % \changes{v3.10}{2010/09/28}{\pkg{everysel} support fixed}
488 % \changes{v3.10}{2010/09/28}{\pkg{tracefnt} supported}
489 % \changes{v3.10b}{2011/03/13}{\pkg{everysel} can be loaded inside
490 % \cs{begin\{document\}}}
491 % \changes{v3.44}{2025/05/13}{removed}
492 % \end{macro}^^A \scr@selectfont,\scr@new@selectfont
493 %
494 % \begin{macro}{\scr@defaultunits}
495 % \changes{v2.95}{2004/11/05}{added}
496 % \changes{v3.19}{2015/08/22}{\cs{setlength} replaced because of \pkg{tikz}}
497 % \begin{macro}{\scr@@defaultunits}
498 % \changes{v2.95}{2004/11/05}{added}
499 % \begin{macro}{\scr@@@defaultunits}
500 % \changes{v2.95}{2004/11/05}{added}
501 % \changes{v3.19}{2015/08/22}{\cs{setlength} and \cs{addtolength} replaced
502 % because of \pkg{tikz}}
503 % Above we've already used \cs{scr@defaultunits} inside
504 % \cs{par@updaterelative}. This is very similar to the \LaTeX{} kernel macro
505 % \cs{@defaultunits}, but accepts dimensions or skips as first and second
506 % value.
507 % \begin{macrocode}
508 \newcommand*{\scr@defaultunits}[2]{%
509 \begingroup
510 \edef\@tempa{#2}%
511 \expandafter\scr@@defaultunits\expandafter#1\@tempa plusplus\@nnil
512 \edef\@tempa{\noexpand\endgroup\noexpand#1\the\glueexpr #1\relax}%
513 \@tempa
514 }
515 \newcommand*{\scr@@defaultunits}{}
516 \def\scr@@defaultunits#1#2plus#3plus#4\@nnil{%
517 \ifx\relax#3\relax
518 \scr@@@defaultunits#1{}#2minusminus\@nnil
519 \else
520 \scr@@@defaultunits#1{#2}#3minusminus\@nnil
521 \fi
522 }
523 \newcommand*{\scr@@@defaultunits}{}
524 \def\scr@@@defaultunits#1#2#3minus#4minus#5\@nnil{%
525 \ifx\relax#2\relax
526 \@defaultunits\@tempskipa#3pt\relax\@nnil
527 #1\@tempskipa
528 \else
529 \@defaultunits\@tempskipa\z@\@plus#3pt\relax\@nnil
530 #1\@tempskipa
531 \@defaultunits\@tempskipa#2pt\relax\@nnil
532 \advance#1\@tempskipa
533 \fi
534 \ifx\relax#4\relax\else
535 \@defaultunits\@tempskipa\z@\@minus #4pt\relax\@nnil
536 \advance#1\@tempskipa
537 \fi
538 }
539 %</body>
540 % \end{macrocode}
541 % \end{macro}^^A \scr@@@defaultunits
542 % \end{macro}^^A \scr@@defaultunits
543 % \end{macro}^^A \scr@defaultunits
544 %
545 % \subsection{Extra list code}
546 %
547 % \begin{macro}{\@list@extra}
548 % \changes{v2.8q}{2001/11/06}{added}
549 % \changes{v2.95c}{2006/08/03}{\len{parsep} fixed}
550 % \begin{macro}{\add@extra@listi}
551 % \changes{v2.9h}{2002/09/03}{added}
552 % Some parameters of lists have to change, depending on the settings for
553 % paragraphs.
554 % \begin{description}
555 % \item[ToDo:] Move this code to \file{scrkernel-listsandtabulars.dtx} or
556 % \file{scrkernel-fontsizes.dtx}.
557 % \end{description}
558 % \begin{macrocode}
559 %<*body>
560 \newcommand*{\@list@extra}{%
561 \ifdim\parskip>\z@\topsep\z@\parsep\parskip\itemsep\z@\fi
562 }
563 \newcommand*{\add@extra@listi}[1]{%
564 \expandafter\let\csname #1@listi\endcsname=\@listi
565 \def\@listi{\csname #1@listi\endcsname\@list@extra}%
566 }
567 %</body>
568 % \end{macrocode}
569 % \end{macro}^^A \@list@extra
570 % \end{macro}^^A \add@extra@listi
571 %
572 % \subsection{Patching other packages}
573 %
574 % \begin{macro}{\deferred@thm@head}
575 % \changes{v3.27}{2019/02/10}{new patch of \textsf{amsthm}}
576 % Unfortunatly \pkg{amsthm} has a problem if a class handles \len{topsep}
577 % this way, because it is only prepared for the case, that \len{parskip} and
578 % \len{parsep} are changed manually without influence to \len{topsep}. So the
579 % initial distance is missing. To avoid this problem, we need to patch the
580 % package's internal command \cs{deferred@thm@head}. This is not nice, but
581 % unfortunaltly needed.
582 % \begin{description}
583 % \item[ToDo:] Move this code to the package patch code of
584 % \file{scrkernel-miscellaneous.dtx} resp. a new file as noted there.
585 % \end{description}
586 % \begin{macrocode}
587 %<*body>
588 \AfterPackage{amsthm}{%
589 \RequirePackage{xpatch}%
590 \xpatchcmd{\deferred@thm@head}{\addvspace{-\parskip}}{}{%
591 \ClassInfoNoLine{\KOMAClassName}{%
592 amsthm's \string\deferred@thm@head\space patched}%
593 }{%
594 \ClassWarningNoLine{\KOMAClassName}{%
595 cannot patch amsthm's \string\deferred@thm@head.\MessageBreak
596 This could result in wrong spacing before theorem\MessageBreak
597 environments defined by package `amsthm'%
598 }%
599 }%
600 }
601 %</body>
602 % \end{macrocode}
603 % \end{macro}
604 %
605 % \subsection{Extra code for font sizes}
606 %
607 % \begin{description}
608 % \item[ToDo:] Move this to \file{scrkernel-fontsizes.dtx}.
609 % \end{description}
610 % \begin{macrocode}
611 % \end{macrocode}
612 %
613 % \changes{v2.98c}{2008/03/26}{changed to be used in font size files}
614 % \changes{v3.17}{2015/03/25}{update of paragraph settings}
615 % \begin{macro}{\@listi}
616 % \changes{v2.98c}{2008/03/27}{\cs{g@addto@macro} replaced by \cs{l@addto@macro}}
617 % \changes{v3.01}{2008/11/13}{\cs{@listi} wird auf jeden Fall ausgeführt}
618 % \begin{macro}{\@listI}
619 % \begin{macro}{\@listii,\@listiii}
620 % \changes{v2.98c}{2008/03/27}{\cs{g@addto@macro} replaced by \cs{l@addto@macro}}
621 % \begin{command}{\footnotesize,\small}
622 % \changes{v2.9h}{2002/09/03}{improved}
623 % \changes{v2.98c}{2008/03/27}{\cs{g@addto@macro} replaced by \cs{l@addto@macro}}
624 % \begin{macrocode}
625 %</class>
626 %<*class|clo>
627 %<*body|10pt|11pt|12pt>
628 %<*10pt|11pt|12pt>
629 \@ifundefined{@list@extra}{}{%
630 \scr@ifundefinedorrelax{scr@v@is@ge}{\par@updaterelative}{%
631 \expandafter\ifnum\scr@v@is@ge{3.17}\par@updaterelative\fi
632 }%
633 %</10pt|11pt|12pt>
634 \l@addto@macro{\@listi}{\@list@extra}%
635 \let\@listI=\@listi
636 \l@addto@macro{\@listii}{\@list@extra}%
637 \l@addto@macro{\@listiii}{\@list@extra}%
638 \l@addto@macro{\footnotesize}{\protect\add@extra@listi{ftns}}%
639 \l@addto@macro{\small}{\protect\add@extra@listi{sml}}%
640 %<10pt|11pt|12pt>}
641 %<10pt|11pt|12pt>\@listi
642 %</body|10pt|11pt|12pt>
643 %</class|clo>
644 %<*class>
645 % \end{macrocode}
646 % \end{command}
647 % \end{macro}
648 % \end{macro}
649 % \end{macro}
650 %
651 %
652 % \subsection{Page layout parameters}
653 %
654 % \begin{length}{\columnsep,\columnseprule}
655 % Initial column separation. Note, we do not support two column letters. So
656 % this is not initialized for the letter class.
657 % \begin{macrocode}
658 %<*!letter&body>
659 \setlength{\columnsep}{10\p@}
660 \setlength{\columnseprule}{\z@}
661 %</!letter&body>
662 % \end{macrocode}
663 % \end{length}
664 %
665 %
666 % \subsection{Penalties}
667 %
668 % The initial values for the penalties are the same as for the standard classes.
669 % \begin{macrocode}
670 %<*body>
671 \@lowpenalty = 51
672 \@medpenalty =151
673 \@highpenalty =301
674 %</body>
675 % \end{macrocode}
676 %
677 %
678 % \begin{macrocode}
679 %</class>
680 % \end{macrocode}
681 %
682 % \Finale
683 % \PrintChanges
684 %
685 \endinput
686 % Local Variables:
687 % mode: doctex
688 % ispell-local-dictionary: "en_US"
689 % eval: (flyspell-mode 1)
690 % TeX-master: t
691 % TeX-engine: luatex-dev
692 % eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
693 % End:
694