| 1 |
% \iffalse meta-comment |
| 2 |
% ====================================================================== |
| 3 |
% scrkernel-miscellaneous.dtx |
| 4 |
% Copyright (c) Markus Kohm, 2002-2023 |
| 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-miscellaneous.dtx 4223 2025-09-11 09:09:44Z kohm $ |
| 22 |
%<init>%%% (run: init) |
| 23 |
%<option>%%% (run: option) |
| 24 |
%<execoption>%%% (run: execoption) |
| 25 |
%<body>%%% (run: body) |
| 26 |
%<*dtx> |
| 27 |
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi |
| 28 |
\begingroup |
| 29 |
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} |
| 30 |
\filedate$Date: 2025-09-11 11:09:44 +0200 (Do, 11. Sep 2025) $ |
| 31 |
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} |
| 32 |
\filerevision$Revision: 4223 $ |
| 33 |
\edef\reserved@a{% |
| 34 |
\noexpand\endgroup |
| 35 |
\noexpand\ProvidesFile{scrkernel-miscellaneous.dtx}% |
| 36 |
[\filedate\space\filerevision\space |
| 37 |
KOMA-Script source |
| 38 |
(miscellaneous, maybe everything or nothing)] |
| 39 |
}% |
| 40 |
\reserved@a |
| 41 |
\documentclass[USenglish]{koma-script-source-doc} |
| 42 |
\usepackage{babel} |
| 43 |
\setcounter{StandardModuleDepth}{2} |
| 44 |
\begin{document} |
| 45 |
\DocInput{scrkernel-miscellaneous.dtx} |
| 46 |
\end{document} |
| 47 |
%</dtx> |
| 48 |
% \fi |
| 49 |
% |
| 50 |
% \changes{v2.95}{2002/07/01}{first version after splitting \file{scrclass.dtx}} |
| 51 |
% \changes{v3.36}{2022/03/01}{switch over from \cls*{scrdoc} to |
| 52 |
% \cls*{koma-script-source-doc}} |
| 53 |
% \changes{v3.36}{2022/03/01}{whole implementation documentation in English} |
| 54 |
% \changes{v3.40}{2023/04/17}{guide names changed} |
| 55 |
% |
| 56 |
% \GetFileInfo{scrkernel-miscellaneous.dtx} |
| 57 |
% \title{All the Code of |
| 58 |
% \href{https://komascript.de}{\KOMAScript} not Fitting into another File} |
| 59 |
% \author{\href{mailto:[email protected]}{Markus Kohm}} |
| 60 |
% \date{Revision \fileversion{} of \filedate} |
| 61 |
% \maketitle |
| 62 |
% \begin{abstract} |
| 63 |
% Currently \file{scrkernel-miscellaneous.dtx} is a mess of miscellaneous |
| 64 |
% code. There is a big, fat \textbf{ToDo} to change this! |
| 65 |
% \end{abstract} |
| 66 |
% \tableofcontents |
| 67 |
% |
| 68 |
% \section{User Manual} |
| 69 |
% |
| 70 |
% You can find the user documentation the commands implemented here in the |
| 71 |
% \KOMAScript{} manual, either the German \file{scrguide-de.pdf} or the |
| 72 |
% English \file{scrguide-en.pdf}. |
| 73 |
% |
| 74 |
% \MaybeStop{\PrintIndex} |
| 75 |
% |
| 76 |
% \section{\KOMAScript{} Classes do Currently not Support Tagging} |
| 77 |
% |
| 78 |
% \changes{v3.49}{2025/09/11}{tagging warning added} |
| 79 |
% In future \KOMAScript{} classes should support tagging, but currently they |
| 80 |
% don't. So if tagging is enabled, we warn. I expect the tagging support to be |
| 81 |
% added step by step. So the warning here will also change step by |
| 82 |
% step. However the name of the message used to warn, will not change. So |
| 83 |
% packages can add tagging support and also deactivate the message using |
| 84 |
%\begin{verbatim} |
| 85 |
%\msg_redirect_name:nnn { \KOMAClassName } { tagging-not-supported } { none } |
| 86 |
%\end{verbatim} |
| 87 |
% As an alternative packages could change the message. |
| 88 |
% \begin{macrocode} |
| 89 |
%<*class&body> |
| 90 |
\ExplSyntaxOn |
| 91 |
\cs_if_exist:NT \tag_if_active:T |
| 92 |
{ |
| 93 |
\msg_new:nnn { \KOMAClassName } { tagging-not-supported } |
| 94 |
{ |
| 95 |
Activated~tagging~detected~but~not~supported!\\ |
| 96 |
Note:~This~class~currently~does~not~actively~support~tagging.~ |
| 97 |
This~means:~Several~elements~will~not~be~tagged~correctly.~ |
| 98 |
We~therefore~currently~suggest~to~not~use~tagging~and~i.e.~ |
| 99 |
use\\ |
| 100 |
\ \ \token_to_str:N\RequirePackage{pdfmetadata}\\ |
| 101 |
\ \ \token_to_str:N\SetKeys[document/metadata]{...}\\ |
| 102 |
instead~of\\ |
| 103 |
\ \ \token_to_str:N\DocumentMetadata{...}\\ |
| 104 |
to~avoid~automatic~activation~of~tagging. |
| 105 |
} |
| 106 |
\hook_gput_code:nnn { begindocument } { \KOMAClassName } |
| 107 |
{ |
| 108 |
\tag_if_active:T |
| 109 |
{ \msg_warning:nn { \KOMAClassName } { tagging-not-supported } } |
| 110 |
} |
| 111 |
} |
| 112 |
\ExplSyntaxOff |
| 113 |
%</class&body> |
| 114 |
% \end{macrocode} |
| 115 |
% |
| 116 |
% \section{Implementation of Special Requirements of Package \pkg*{scrletter}} |
| 117 |
% |
| 118 |
% The \pkg*{scrletter} depends on some features of the \KOMAScript{} |
| 119 |
% classes. However, a special user request was to make it work with the |
| 120 |
% standard classes too. So we need additional code to detect not using a |
| 121 |
% \KOMAScript{} class and to make this work. |
| 122 |
% \begin{description} |
| 123 |
% \item[ToDo:] Can we move this code into a letter file or use a new file only |
| 124 |
% used for package \pkg*{scrletter}? |
| 125 |
% \end{description} |
| 126 |
% \begin{macrocode} |
| 127 |
%<*package&letter&init> |
| 128 |
\scr@ifundefinedorrelax{KOMAClassName}{% |
| 129 |
\PackageWarningNoLine{scrletter}{% |
| 130 |
Cannot detect any KOMA-Script class.\MessageBreak |
| 131 |
Package `scrletter' is an extension to\MessageBreak |
| 132 |
KOMA-Script classes.\MessageBreak |
| 133 |
Usage with another class is not recommended% |
| 134 |
\@ifclassloaded{article}{}{% |
| 135 |
\@ifclassloaded{report}{}{% |
| 136 |
\@ifclassloaded{book}{}{% |
| 137 |
\MessageBreak and can result in several errors% |
| 138 |
}% |
| 139 |
}% |
| 140 |
}% |
| 141 |
}% |
| 142 |
\RequirePackage{scrextend}% |
| 143 |
% \end{macrocode} |
| 144 |
% |
| 145 |
% \begin{command}{\setparsizes} |
| 146 |
% \changes{v3.23}{2017/02/22}{simple fallback definition} |
| 147 |
% \begin{macro}{\par@updaterelative} |
| 148 |
% \changes{v3.23}{2017/02/22}{empty fallback definition} |
| 149 |
% If \pkg*{scrletter} is not used with a \KOMAScript{} class \cs{setparsizes} |
| 150 |
% would not be available. But it is used in \cs{vb@t@z}, \cs{@addrfield}, |
| 151 |
% \cs{@datefield}, \cs{@makelettertitle}, \cs{@subjfield}, \cs{opening}, |
| 152 |
% \cs{closing}. Instead of changing the implementation of all these commands |
| 153 |
% and macros, we define a very simple version of \cs{setparsizes}. And in case |
| 154 |
% of using this simple version \cs{par@updaterelative} would become a |
| 155 |
% do-nothing macro. This does work in case of the commands and macros listed |
| 156 |
% above. But maybe it does not work in other cases. |
| 157 |
% \begin{description} |
| 158 |
% \item[ToDo:] Can we move this code into \file{scrkernel-paragraphs.dtx} or |
| 159 |
% use a new file only for package \pkg*{scrletter}? |
| 160 |
% \end{description} |
| 161 |
% \begin{macrocode} |
| 162 |
\providecommand*{\setparsizes}[3]{% |
| 163 |
\setlength{\parindent}{#1}% |
| 164 |
\setlength{\parskip}{#2}% |
| 165 |
\setlength{\parfillskip}{#3}% |
| 166 |
} |
| 167 |
\providecommand*{\par@updaterelative}{} |
| 168 |
% \end{macrocode} |
| 169 |
% \end{macro}^^A \par@updaterelative |
| 170 |
% \end{command}^^A \setparsizes |
| 171 |
% \begin{macrocode} |
| 172 |
}{} |
| 173 |
%</package&letter&init> |
| 174 |
% \end{macrocode} |
| 175 |
% |
| 176 |
% \begin{macro}{\scr@renewforletter,\@renewforletter,\do@renewforletter@list, |
| 177 |
% \do@renewforletter} |
| 178 |
% \changes{v3.20}{2014/04/10}{added} |
| 179 |
% \changes{v3.25}{2017/11/15}{removed} |
| 180 |
% \end{macro} |
| 181 |
% |
| 182 |
% |
| 183 |
% \section{Implementation of the Draft Mode} |
| 184 |
% |
| 185 |
% The \KOMAScript{} classes provide two draft options, the general one and a |
| 186 |
% more specific. |
| 187 |
% \begin{description} |
| 188 |
% \item[ToDo:] Should we move this to \file{scrkernel-paragraphs.dtx}? |
| 189 |
% \end{description} |
| 190 |
% |
| 191 |
% \begin{option}{draft} |
| 192 |
% \changes{v2.95}{2002/12/05}{re-implemented using \pkg{keyval}} |
| 193 |
% \changes{v3.17}{2015/03/12}{using internal value storage} |
| 194 |
% \changes{v3.25}{2017/11/21}{respect option \opt{overfullrule}} |
| 195 |
% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}} |
| 196 |
% \changes{v3.39}{2022/11/11}{initial dot removed from member argument of |
| 197 |
% option storage commands} |
| 198 |
% \begin{option}{final} |
| 199 |
% \changes{v2.95}{2002/12/05}{obsolete} |
| 200 |
% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by |
| 201 |
% \cs{PackageInfoNoLine}} |
| 202 |
% \changes{v3.01a}{2008/11/21}{standard instead of obsolete} |
| 203 |
% \changes{v3.02c}{2008/02/17}{explicit optional argument for \pkg*{scrextend}} |
| 204 |
% In draft mode classes usually show a rule for overfull boxes. Despite this |
| 205 |
% is usually already handled by the class, package \pkg*{scrextend} also |
| 206 |
% provides the option, because of correct setting of the internal value |
| 207 |
% storage also of option \opt{overfullrule}. |
| 208 |
% \begin{macrocode} |
| 209 |
%<*(class|extend)&option> |
| 210 |
\KOMA@key{draft}[true]{% |
| 211 |
\KOMA@set@ifkey{draft}{@tempswa}{#1}% |
| 212 |
\ifx\FamilyKeyState\FamilyKeyStateProcessed |
| 213 |
\if@tempswa |
| 214 |
\KOMA@kav@replacebool{% |
| 215 |
%<class> \KOMAClassFileName |
| 216 |
%<package&extend> scrextend.\scr@pkgextension |
| 217 |
}{draft}{@tempswa}% |
| 218 |
\KOMA@kav@replacebool{% |
| 219 |
%<class> \KOMAClassFileName |
| 220 |
%<package&extend> scrextend.\scr@pkgextension |
| 221 |
}{overfullrule}{@tempswa}% |
| 222 |
\setlength{\overfullrule}{5pt}% |
| 223 |
\else |
| 224 |
\KOMA@kav@replacebool{% |
| 225 |
%<class> \KOMAClassFileName |
| 226 |
%<package&extend> scrextend.\scr@pkgextension |
| 227 |
}{draft}{@tempswa}% |
| 228 |
\KOMA@kav@replacebool{% |
| 229 |
%<class> \KOMAClassFileName |
| 230 |
%<package&extend> scrextend.\scr@pkgextension |
| 231 |
}{overfullrule}{@tempswa}% |
| 232 |
\setlength{\overfullrule}{\z@}% |
| 233 |
\fi |
| 234 |
\fi |
| 235 |
} |
| 236 |
%<class>\KOMA@kav@add{\KOMAClassFileName}{draft}{false} |
| 237 |
%<*package&extend> |
| 238 |
\KOMA@kav@xadd{scrextend.\scr@pkgextension}{draft}{% |
| 239 |
\ifdim\overfullrule>\z@ true\else false\fi |
| 240 |
} |
| 241 |
%</package&extend> |
| 242 |
\KOMA@DeclareStandardOption |
| 243 |
%<package&extend>[scrextend] |
| 244 |
{final}{draft=false} |
| 245 |
% \end{macrocode} |
| 246 |
% \begin{option}{overfullrule} |
| 247 |
% \changes{v3.25}{2017/11/21}{added} |
| 248 |
% \changes{v3.39}{2022/11/11}{initial dot removed from member argument of |
| 249 |
% option storage commands} |
| 250 |
% Because option \opt{draft} can result in unwanted effects I've added a |
| 251 |
% new option to explicite only change the overfull rule setting. However for |
| 252 |
% \textsf{scrextend} and the \KOMAScript{} classes the result is the same. |
| 253 |
% \begin{macrocode} |
| 254 |
\KOMA@key{overfullrule}[true]{% |
| 255 |
\KOMA@set@ifkey{overfullrule}{@tempswa}{#1}% |
| 256 |
\ifx\FamilyKeyState\FamilyKeyStateProcessed |
| 257 |
\if@tempswa |
| 258 |
\KOMA@kav@replacebool{% |
| 259 |
%<class> \KOMAClassFileName |
| 260 |
%<package&extend> scrextend.\scr@pkgextension |
| 261 |
}{draft}{@tempswa}% |
| 262 |
\KOMA@kav@replacebool{% |
| 263 |
%<class> \KOMAClassFileName |
| 264 |
%<package&extend> scrextend.\scr@pkgextension |
| 265 |
}{overfullrule}{@tempswa}% |
| 266 |
\setlength{\overfullrule}{5pt}% |
| 267 |
\else |
| 268 |
\KOMA@kav@replacebool{% |
| 269 |
%<class> \KOMAClassFileName |
| 270 |
%<package&extend> scrextend.\scr@pkgextension |
| 271 |
}{draft}{@tempswa}% |
| 272 |
\KOMA@kav@replacebool{% |
| 273 |
%<class> \KOMAClassFileName |
| 274 |
%<package&extend> scrextend.\scr@pkgextension |
| 275 |
}{overfullrule}{@tempswa}% |
| 276 |
\setlength{\overfullrule}{\z@}% |
| 277 |
\fi |
| 278 |
\fi |
| 279 |
} |
| 280 |
%<class>\KOMA@kav@add{\KOMAClassFileName}{overfullrule}{false} |
| 281 |
%<*package&extend> |
| 282 |
\KOMA@kav@xadd{scrextend.\scr@pkgextension}{overfullrule}{% |
| 283 |
\ifdim\overfullrule>\z@ true\else false\fi |
| 284 |
} |
| 285 |
%</package&extend> |
| 286 |
%</(class|extend)&option> |
| 287 |
% \end{macrocode} |
| 288 |
% \end{option}^^A overfullrule |
| 289 |
% \end{option}^^A final |
| 290 |
% \end{option}^^A draft |
| 291 |
% |
| 292 |
% |
| 293 |
% \section{Implementations for the Math Mode} |
| 294 |
% |
| 295 |
% \KOMAScript{} does not make something special for the math mode. |
| 296 |
% \begin{description} |
| 297 |
% \item[ToDo:] Should we move this to the special treatment of \pkg{amsmath} |
| 298 |
% in \file{scrkernel-basics.dtx} or move it with the special treatment of |
| 299 |
% \pkg{amsmath} in \file{scrkernel-basics.dtx} to a new file |
| 300 |
% \file{scrkernel-math.dtx}? |
| 301 |
% \end{description} |
| 302 |
% |
| 303 |
% \begin{option}{leqno,fleqno} |
| 304 |
% The \KOMAScript{} classes but \cls*{scrlttr2} do support the standard |
| 305 |
% class options \opt{leqno} and \opt{fleqn}. |
| 306 |
% \begin{macrocode} |
| 307 |
%<*class&!letter&option> |
| 308 |
\DeclareOption{leqno}{\input{leqno.clo}} |
| 309 |
\DeclareOption{fleqn}{\input{fleqn.clo}} |
| 310 |
%</class&!letter&option> |
| 311 |
% \end{macrocode} |
| 312 |
% \end{option} |
| 313 |
% |
| 314 |
% \begin{counter}{equation} |
| 315 |
% \changes{v3.37}{2022/08/24}{accidentally removed \cs{@addtoreset} added |
| 316 |
% again} |
| 317 |
% \begin{command}{\theequation} |
| 318 |
% \changes{v2.97e}{2007/11/23}{chapter numbers only in main matter} |
| 319 |
% \changes{v3.27}{2022/03/01}{\cs{relax} replaced by percent because of |
| 320 |
% \pkg*{hyperref}} |
| 321 |
% The \KOMAScript{} classes \cls*{scrbook} and \cls*{scrreprt} have a special |
| 322 |
% treatment for equation numbers. For \cls*{scrreprt} the number just depends |
| 323 |
% on the chapter number. But for \cls*{scrbook} it also depends on the active |
| 324 |
% matter. |
| 325 |
% \begin{description} |
| 326 |
% \item[ToDo:] With \cs{counterwidth} instead of \cs{@addtoreset} the |
| 327 |
% \cls*{scrreprt} code could be very simple. But currently we still support |
| 328 |
% old \LaTeX{} kernels without \cs{counterwithin}. |
| 329 |
% \item[ToDo:] Should we also add a definition for \cls*{scrartcl} as done for |
| 330 |
% \cls*{article}, though the same definition is already the default of the |
| 331 |
% \LaTeX{} kernel? |
| 332 |
% \end{description} |
| 333 |
% \begin{macrocode} |
| 334 |
%<*(book|report)&body> |
| 335 |
\@addtoreset{equation}{chapter} |
| 336 |
\renewcommand*{\theequation}{% |
| 337 |
%<*book> |
| 338 |
%<!v4> \expandafter\ifnum\scr@v@is@gt{2.97d}% |
| 339 |
\if@mainmatter\thechapter.\fi |
| 340 |
%<!v4> \else |
| 341 |
%</book> |
| 342 |
%<!v4> \thechapter.% |
| 343 |
%<book&!v4> \fi |
| 344 |
\@arabic\c@equation |
| 345 |
} |
| 346 |
|
| 347 |
%</(book|report)&body> |
| 348 |
% \end{macrocode} |
| 349 |
% \end{command}^^A \theequation |
| 350 |
% \end{counter}^^A equation |
| 351 |
% |
| 352 |
% |
| 353 |
% \section{Implementation of the Execution and Processing of Options} |
| 354 |
% |
| 355 |
% After the definition of all options, some defaults have to be executed and |
| 356 |
% all options have to be processed. |
| 357 |
% \begin{description} |
| 358 |
% \item[ToDo:] Can we move the execution of default to the files, where the |
| 359 |
% corresponding options are defined? |
| 360 |
% \item[ToDo:] Can we move the processing of options to |
| 361 |
% \file{scrkernel-basics.dtx} where the command itself is defined? |
| 362 |
% \end{description} |
| 363 |
% |
| 364 |
% \changes{v2.97c}{2007/04/19}{using \cs{KOMAExecuteOptions} instead of |
| 365 |
% \cs{KOMAoptions} and \cs{KOMAProcessOptions} instead of |
| 366 |
% \cs{ProcessOptions}} |
| 367 |
% \changes{v2.97c}{2007/04/19}{options that are implicit defaults are not set |
| 368 |
% explicitly} |
| 369 |
% \changes{v2.97c}{2007/07/18}{removed \opt{twoside} from the default} |
| 370 |
% \changes{v2.98c}{2008/03/10}{\opt{headings\quotechar=big} added to the |
| 371 |
% default} |
| 372 |
% \changes{v3.11c}{2013/03/04}{\opt{headings\quotechar=big} not with |
| 373 |
% \cls*{scrlttr2}} |
| 374 |
% \begin{macrocode} |
| 375 |
%<*execoption> |
| 376 |
%<*class> |
| 377 |
\KOMAExecuteOptions{% |
| 378 |
parskip=false,% |
| 379 |
%<!letter> headings=big% |
| 380 |
} |
| 381 |
%</class> |
| 382 |
\KOMAProcessOptions\relax |
| 383 |
%</execoption> |
| 384 |
% \end{macrocode} |
| 385 |
% |
| 386 |
% |
| 387 |
% \section{Implementation of Temporary Switch to Single Column Mode} |
| 388 |
% |
| 389 |
% Sometimes we need to temporary switch to single column mode, e.g., to print |
| 390 |
% a table of contents or similar. This is not needed for \cls*{scrlttr2} or |
| 391 |
% \pkg*{scrletter}. |
| 392 |
% \begin{description} |
| 393 |
% \item[ToDo:] Should we move this to \file{scrkernel-paragraphs.dtx} or |
| 394 |
% another file? Currently it is used in \file{scrkernel-index.dtx}, |
| 395 |
% \file{scrkernel-notepaper.dtx}, and \file{scrkernel-title.dtx} (and also |
| 396 |
% in \file{scrhack.dtx}, which also defines it of needed). |
| 397 |
% \end{description} |
| 398 |
% |
| 399 |
% \begin{macro}{\@restonecolfalse,\@restonecoltrue,\if@restonecol} |
| 400 |
% We need a local switch to be able to restore two column mode after locally |
| 401 |
% switching to one column mode (or visa versa). For \pkg*{scrextend} this is a |
| 402 |
% little bit complicated, because the switch could already exist in the used |
| 403 |
% class. |
| 404 |
% \begin{macrocode} |
| 405 |
%<*!letter&body> |
| 406 |
%<*!extend> |
| 407 |
\newif\if@restonecol |
| 408 |
%</!extend> |
| 409 |
%<*extend> |
| 410 |
\scr@ifundefinedorrelax{if@restonecol}{% |
| 411 |
\expandafter\newif\csname if@restonecol\endcsname |
| 412 |
\@restonecolfalse |
| 413 |
}{} |
| 414 |
%</extend> |
| 415 |
%</!letter&body> |
| 416 |
% \end{macrocode} |
| 417 |
% \end{macro} |
| 418 |
% |
| 419 |
% \section{Implementation of the Dictum} |
| 420 |
% |
| 421 |
% Printing a \emph{dictum} is also not supported by letters. |
| 422 |
% \begin{description} |
| 423 |
% \item[ToDo:] Should we move this to \file{scrkernel-sections.dtx} or to a |
| 424 |
% new file? |
| 425 |
% \end{description} |
| 426 |
% |
| 427 |
% \begin{command}{\dictum} |
| 428 |
% \changes{v2.8q}{2001/20/04}{added} |
| 429 |
% \changes{v2.9l}{2003/01/28}{\cs{edef} replaced by \cs{def} ersetzt} |
| 430 |
% \changes{v2.9q}{2004/04/19}{group added} |
| 431 |
% \begin{command}{\dictumwidth, |
| 432 |
% \raggeddictum,\raggeddictumtext,\raggeddictumauthor} |
| 433 |
% \changes{v2.8q}{2001/20/04}{added} |
| 434 |
% \begin{fontelement}{dictum} |
| 435 |
% \changes{v2.8q}{2001/20/04}{added} |
| 436 |
% \changes{v3.20}{2016/01/29}{\cs{sffamily} replaced by \cs{@gr@gsffamily}} |
| 437 |
% \changes{v3.39}{2023/04/04}{\cs{@gr@gsfamily} replaced by \cs{maybesffamily}} |
| 438 |
% \begin{fontelement}{dictumtext,dictumauthor} |
| 439 |
% \changes{v2.8q}{2001/20/04}{added} |
| 440 |
% \begin{command}{\dictumauthorformat} |
| 441 |
% \changes{v2.8q}{2001/20/04}{added} |
| 442 |
% \begin{command}{\dictumrule} |
| 443 |
% \changes{v3.10}{2011/09/02}{added} |
| 444 |
% The \emph{dictum} consist of a text, the dictum, and an optional |
| 445 |
% author. Text and author are separated by a horizontal rule. |
| 446 |
% \begin{macrocode} |
| 447 |
%<*!letter&body> |
| 448 |
\newcommand{\dictum}[2][]{\par% |
| 449 |
\begingroup |
| 450 |
\raggeddictum\parbox{\dictumwidth}{% |
| 451 |
{\@dictumfont{\raggeddictumtext #2\strut\par}% |
| 452 |
\def\@tempa{#1}\ifx\@tempa\@empty\else% |
| 453 |
{\raggeddictumtext\dictumrule}% |
| 454 |
\raggeddictumauthor\@dictumauthorfont\dictumauthorformat{#1}% |
| 455 |
\strut\par% |
| 456 |
\fi% |
| 457 |
}% |
| 458 |
}\par% |
| 459 |
\endgroup |
| 460 |
} |
| 461 |
\newcommand*{\dictumrule}{\vskip-1ex\hrulefill\par}% |
| 462 |
\newcommand*{\dictumwidth}{.3333\textwidth} |
| 463 |
\newcommand*{\raggeddictum}{\raggedleft} |
| 464 |
\newcommand*{\dictumauthorformat}[1]{(#1)} |
| 465 |
\newcommand*{\raggeddictumtext}{\raggedright} |
| 466 |
\newcommand*{\raggeddictumauthor}{\raggedleft} |
| 467 |
\newkomafont{dictum}{\normalfont\normalcolor\maybesffamily\small} |
| 468 |
\newkomafont{dictumauthor}{\itshape} |
| 469 |
\aliaskomafont{dictumtext}{dictum} |
| 470 |
%</!letter&body> |
| 471 |
% \end{macrocode} |
| 472 |
% \end{command}^^A \dictumrule |
| 473 |
% \end{command}^^A \dictumauthorformat |
| 474 |
% \end{fontelement}^^A dictumtext,dictumauthor |
| 475 |
% \end{fontelement}^^A dictum |
| 476 |
% \end{command}^^A \dictumwidth,\raggeddictum…\raggeddictumauthor |
| 477 |
% \end{command}^^A \dictum |
| 478 |
% |
| 479 |
% |
| 480 |
% \section{Setting Default Lengths of \env{minipage} and Frames} |
| 481 |
% |
| 482 |
% \begin{description} |
| 483 |
% \item[ToDo:] Should we move the default for \len{@mpfootins} to |
| 484 |
% \file{scrkernel-footnotes.dtx}? |
| 485 |
% \item[ToDo:] Do we really need to set initial values to \len{fboxsep} and |
| 486 |
% \len{fboxrule}? The same defaults using |pt| instead of \cs{p@} are already |
| 487 |
% used in the \LaTeX{} kernel. Wouldn't that be enough? |
| 488 |
% \end{description} |
| 489 |
% |
| 490 |
% \begin{length}{@mpfootins} |
| 491 |
% \begin{length}{fboxsep,fboxrule} |
| 492 |
% We are using the same settings like the standard classes. |
| 493 |
% \begin{macrocode} |
| 494 |
%<*class&body> |
| 495 |
\setlength{\skip\@mpfootins}{\skip\footins} |
| 496 |
\setlength\fboxsep{3\p@} |
| 497 |
\setlength\fboxrule{.4\p@} |
| 498 |
%</class&body> |
| 499 |
% \end{macrocode} |
| 500 |
% \end{length} |
| 501 |
% \end{length} |
| 502 |
% |
| 503 |
% |
| 504 |
% \section{Implementation of Detection of Odd and Even Pages} |
| 505 |
% |
| 506 |
% \begin{description} |
| 507 |
% \item[ToDo:] Should this code moved to \file{scrkernel-basics.dtx} or to a |
| 508 |
% new one? |
| 509 |
% \end{description} |
| 510 |
% |
| 511 |
% \begin{command}{\ifthispageodd,\Ifthispageodd} |
| 512 |
% \changes{v2.8q}{2001/11/22}{added} |
| 513 |
% \changes{v3.28}{2019/11/19}{\cs{ifthispageodd} renamed to \cs{Ifthispageodd}} |
| 514 |
% Users often use |\ifodd\value{page}| to test, whether the current page is |
| 515 |
% odd or even. But this is dramatically wrong, because of the asynchronous |
| 516 |
% output of \TeX. So here we define a command |
| 517 |
% \begin{quote} |
| 518 |
% \Ifthispageodd\marg{then code}\marg{else code} |
| 519 |
% \end{quote} |
| 520 |
% that internally uses a label-like mechanism to do the decision. We do not |
| 521 |
% really use \cs{label} and \cs{pageref}, because this would not work with |
| 522 |
% Roman or alphabetic page numbers. So we use a direct write to the \file{aux} |
| 523 |
% file instead. |
| 524 |
% |
| 525 |
% \begin{macro}{\new@tpo@label} |
| 526 |
% \changes{v2.8q}{2001/11/22}{added} |
| 527 |
% \changes{v2.95b}{2006/07/28}{using \cs{@newl@bel}} |
| 528 |
% \changes{v3.20}{2016/03/25}{use after definition in the \file{aux}-file} |
| 529 |
% Definition of a new \textbf{t}rue-\textbf{p}age-\textbf{o}dd label. To be |
| 530 |
% used in the \file{aux} file. A fallback definition is also added to the |
| 531 |
% \file{aux} file, so there wouldn't be an error, e.g., after removing package |
| 532 |
% \pkg*{scrextend} from a document. |
| 533 |
% \begin{macrocode} |
| 534 |
%<*(class|extend)&body> |
| 535 |
\newcommand*{\new@tpo@label}{\@newl@bel{tpo}} |
| 536 |
\AtBeginDocument{% |
| 537 |
\if@filesw |
| 538 |
\immediate\write\@auxout{% |
| 539 |
\string\providecommand*\string\new@tpo@label[2]{}% |
| 540 |
}% |
| 541 |
\fi |
| 542 |
} |
| 543 |
% \end{macrocode} |
| 544 |
% \end{macro}^^A \new@tpo@label |
| 545 |
% |
| 546 |
% \begin{macro}{\scr@tpo} |
| 547 |
% \changes{v2.8q}{2001/11/22}{added} |
| 548 |
% We need a kind of counter with the actual usage number of |
| 549 |
% \cs{Ifthispageodd}. |
| 550 |
% \begin{macrocode} |
| 551 |
\newcommand*{\scr@tpo}{0} |
| 552 |
% \end{macrocode} |
| 553 |
% \end{macro}^^A \scr@tpo |
| 554 |
% |
| 555 |
% \begin{macro}{\is@thispageodd} |
| 556 |
% \changes{v2.8q}{2001/11/22}{added} |
| 557 |
% \changes{v2.9l}{2003/01/28}{renamed \cs{if@thispageodd}} |
| 558 |
% \changes{v2.95b}{2006/07/28}{using \cs{@newl@bel}} |
| 559 |
% \changes{v3.17}{2015/03/23}{split into two macros} |
| 560 |
% \begin{macro}{\is@thispageodd@setlabel} |
| 561 |
% \changes{v3.17}{2015/03/23}{added} |
| 562 |
% \changes{v3.20}{2016/03/25}{write to \file{aux} file only \cs{if@filesw}} |
| 563 |
% \changes{v3.23}{2017/02/23}{empty macro after usage} |
| 564 |
% \changes{v3.42}{2023/12/05}{using \cs{number} instead of \cs{arabic} to fix |
| 565 |
% \href{https://sourceforge.net/p/koma-script/tickets/58/}{issue 58}} |
| 566 |
% The main workers of \cs{Ifthispageodd}. It is used to set |
| 567 |
% \cs{ifthispagewasodd} depending on the information it adds to the \file{aux} |
| 568 |
% file. |
| 569 |
% \begin{description} |
| 570 |
% \item[ToDo:] Why do we use an optional argument here? Are there any |
| 571 |
% circumstances, when the optional argument is not the default |
| 572 |
% \cs{is@thispageodd@setlabel}? |
| 573 |
% \item[ToDo:] From \LaTeX~2023-11-01 use the page property instead of |
| 574 |
% \cs{new@tpo@label}. |
| 575 |
% \end{description} |
| 576 |
% \begin{macrocode} |
| 577 |
\newcommand*{\is@thispageodd}[1][\is@thispageodd@setlabel]{% |
| 578 |
\@bsphack |
| 579 |
\begingroup |
| 580 |
\@tempcnta=\scr@tpo |
| 581 |
\advance\@tempcnta by\@ne |
| 582 |
\xdef\scr@tpo{\the\@tempcnta}% |
| 583 |
\expandafter\ifx\csname tpo@\scr@tpo\endcsname\relax |
| 584 |
\protect\G@refundefinedtrue |
| 585 |
%<!extend> \ClassWarning{\KOMAClassName}{% |
| 586 |
%<extend> \PackageWarning{scrextend}{% |
| 587 |
odd/even page label number \scr@tpo\space undefined}% |
| 588 |
\edef\@tempa{\the\value{page}}% |
| 589 |
\else |
| 590 |
\edef\@tempa{\csname tpo@\scr@tpo\endcsname}% |
| 591 |
\fi |
| 592 |
\ifodd\number\@tempa |
| 593 |
\aftergroup\thispagewasoddtrue |
| 594 |
\else |
| 595 |
\aftergroup\thispagewasoddfalse |
| 596 |
\fi |
| 597 |
\endgroup |
| 598 |
\edef\is@thispageodd@setlabel{% |
| 599 |
\if@filesw |
| 600 |
\unexpanded{\protected@write\@auxout{\let\number\relax}}{% |
| 601 |
\noexpand\string |
| 602 |
\noexpand\new@tpo@label{\scr@tpo}{\noexpand\number\c@page}}% |
| 603 |
\fi |
| 604 |
\noexpand\def\noexpand\is@thispageodd@setlabel |
| 605 |
{\unexpanded\expandafter{\is@thispageodd@setlabel}}% |
| 606 |
}% |
| 607 |
#1% |
| 608 |
\@esphack |
| 609 |
} |
| 610 |
\newcommand*{\is@thispageodd@setlabel}{} |
| 611 |
% \end{macrocode} |
| 612 |
% \end{macro}^^A \is@thispageodd@setlabel |
| 613 |
% \end{macro}^^A \is@thispageodd |
| 614 |
% |
| 615 |
% \begin{command}{\thispagewasoddfalse,\thispagewasoddtrue,\ifthispagewasodd} |
| 616 |
% \changes{v2.9l}{2003/01/20}{added} |
| 617 |
% Rolf Niepraschks asked for the possibility to check for the last decision, |
| 618 |
% e.g., inside the \meta{then code} or \meta{else code}. So the definition of |
| 619 |
% \cs{Ifthispageodd} has been changed not only to set such a switch, but also |
| 620 |
% use it. |
| 621 |
% \begin{macrocode} |
| 622 |
\newif\ifthispagewasodd |
| 623 |
% \end{macrocode} |
| 624 |
% \end{command} |
| 625 |
% |
| 626 |
% With all these macros the user command is very easy. |
| 627 |
% \changes{v3.31}{2020/04/27}{fixed class and package name in the warning} |
| 628 |
% \changes{v3.32}{2020/08/06}{\cs{KOMAClassName} fixed} |
| 629 |
% \begin{macrocode} |
| 630 |
\providecommand*{\ifthispageodd}{% |
| 631 |
%<class> \ClassWarning{\KOMAClassName}{% |
| 632 |
%<extend> \PackageWarning{scrextend}{% |
| 633 |
Usage of deprecated command |
| 634 |
`\string\ifthispageodd'.\MessageBreak |
| 635 |
The command has been renamed because of a\MessageBreak |
| 636 |
recommendation of The LaTeX Project Team.\MessageBreak |
| 637 |
Please replace `\string\ifthispageodd' by `\string\Ifthispageodd'% |
| 638 |
}% |
| 639 |
\Ifthispageodd |
| 640 |
} |
| 641 |
\newcommand{\Ifthispageodd}{% |
| 642 |
\is@thispageodd |
| 643 |
\ifthispagewasodd |
| 644 |
\expandafter\@firstoftwo |
| 645 |
\else |
| 646 |
\expandafter\@secondoftwo |
| 647 |
\fi |
| 648 |
} |
| 649 |
%</(class|extend)&body> |
| 650 |
% \end{macrocode} |
| 651 |
% \end{command}^^A \ifthispageodd,\Ifthispageodd |
| 652 |
% |
| 653 |
% |
| 654 |
% \section{Implementation of Notes to the Margin} |
| 655 |
% |
| 656 |
% \begin{description} |
| 657 |
% \item[ToDo:] This has been moved newly to |
| 658 |
% \file{scrkernel-miscellaneous.dtx}, but maybe we can find another suitable |
| 659 |
% file? |
| 660 |
% \end{description} |
| 661 |
% |
| 662 |
% \begin{command}{\marginline} |
| 663 |
% \changes{v2.4l}{1997/02/06}{using the optional argument of \cs{marginpar}} |
| 664 |
% \changes{v2.8q}{2001/11/27}{missing brace added} |
| 665 |
% \changes{v3.36}{2022/02/22}{moved from \file{scrkernel-floats.dtx} to |
| 666 |
% \file{scrkernel-miscellaneaous.dtx}} |
| 667 |
% \changes{v3.39}{2022/12/21}{braces fixed} |
| 668 |
% A very often wanted margin note feature is, to print all such notes in the |
| 669 |
% left margin ragged-left and all such notes in the right margin |
| 670 |
% ragged-right. So this is a simple shortcut for \cs{marginpar} with using |
| 671 |
% almost the same argument twice. |
| 672 |
% \begin{macrocode} |
| 673 |
%<*(class|extend)&body> |
| 674 |
\newcommand\marginline[1]{% |
| 675 |
\marginpar[{\raggedleft #1}]{\raggedright #1}% |
| 676 |
} |
| 677 |
%</(class|extend)&body> |
| 678 |
% \end{macrocode} |
| 679 |
% \end{command} |
| 680 |
% |
| 681 |
% |
| 682 |
% \section{Implementation of Subscripts} |
| 683 |
% |
| 684 |
% \begin{command}{\textsubscript} |
| 685 |
% \changes{v2.8h}{2001/07/19}{added} |
| 686 |
% \changes{v3.25}{2017/11/15}{define only if un-defined because of \LaTeX{} |
| 687 |
% kernel change} |
| 688 |
% \begin{macro}{\@textsubscript} |
| 689 |
% \changes{v2.8h}{2001/07/19}{added} |
| 690 |
% \changes{v3.10}{2011/09/05}{\cs{providecommand} instead of \cs{newcommand} |
| 691 |
% because of \pkg{fixltx2e}} |
| 692 |
% The \LaTeX{} kernel has \cs{textsuperscript}. But for several years |
| 693 |
% \cs{textsubscript} was missing. For such old \LaTeX{} kernels, we define it |
| 694 |
% similar to \cs{textsuperscript}. |
| 695 |
% \begin{macrocode} |
| 696 |
%<*(class|extend)&body> |
| 697 |
\scr@ifundefinedorrelax{textsubscript}{% |
| 698 |
\DeclareRobustCommand*\textsubscript[1]{% |
| 699 |
\@textsubscript{\selectfont#1}% |
| 700 |
}% |
| 701 |
}{% |
| 702 |
\scr@ifundefinedorrelax{textsubscript }{% |
| 703 |
\DeclareRobustCommand*\textsubscript[1]{% |
| 704 |
\@textsubscript{\selectfont#1}% |
| 705 |
}% |
| 706 |
}{}% |
| 707 |
} |
| 708 |
\providecommand*{\@textsubscript}[1]{% |
| 709 |
{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}% |
| 710 |
} |
| 711 |
%</(class|extend)&body> |
| 712 |
% \end{macrocode} |
| 713 |
% \end{macro} |
| 714 |
% \end{command}^^A \textsubscript |
| 715 |
% |
| 716 |
% |
| 717 |
% \section{Implementation of an Invisible Strut} |
| 718 |
% \label{sec:strut} |
| 719 |
% |
| 720 |
% \begin{description} |
| 721 |
% \item[ToDo:] Maybe \file{scrkernel-basics.dtx} would be a good place for |
| 722 |
% this and maybe is should become a user command and be used at several |
| 723 |
% places, currently \cs{strut} is used. |
| 724 |
% \end{description} |
| 725 |
% |
| 726 |
% \begin{macro}{\scr@endstrut} |
| 727 |
% \changes{v3.25}{2017/11/15}{added} |
| 728 |
% If we simply add \cs{strut} to the end of material which is assumed to be |
| 729 |
% horizontal, white spaces at the end of such material could become relevant, |
| 730 |
% even if the would not without the \cs{strut}. We can avoid this by adding |
| 731 |
% \cs{unskip} before the \cs{strut}. But in this case, the last work before |
| 732 |
% the \cs{strut} will not be hyphenated any more. If we are really in |
| 733 |
% horizontal mode, we can use \cs{nobreak} before the \cs{strut} you once |
| 734 |
% again allow hyphenation. |
| 735 |
% \begin{description} |
| 736 |
% \item[ToDo:] Should the \cs{unskip} also be moved behind \cs{ifhmode}? |
| 737 |
% \end{description} |
| 738 |
% \begin{macrocode} |
| 739 |
%<*(class|letter|extend)&body> |
| 740 |
\providecommand*{\scr@endstrut}{\unskip\ifhmode\nobreak\strut\fi} |
| 741 |
%</(class|letter|extend)&body> |
| 742 |
% \end{macrocode} |
| 743 |
% \end{macro} |
| 744 |
% |
| 745 |
% |
| 746 |
% \section{Warnings for Using Incompatible Packages} |
| 747 |
% \label{sec:packagewarning} |
| 748 |
% |
| 749 |
% \begin{description} |
| 750 |
% \item[ToDo:] This should be moved to a new file. |
| 751 |
% \end{description} |
| 752 |
% |
| 753 |
% \changes{v3.12}{2013/07/08}{warnings about several incompatible packages |
| 754 |
% added} |
| 755 |
% |
| 756 |
% \begin{macro}{\scr@package@not@recommended} |
| 757 |
% \changes{v3.12}{2013/07/08}{added} |
| 758 |
% \begin{macro}{\class@shoulddisablepackagewarning@list} |
| 759 |
% \changes{v3.24}{2017/06/25}{added} |
| 760 |
% \changes{v3.42}{2023/07/26}{indirect warnings can be redefined after loading |
| 761 |
% the class} |
| 762 |
% Loading of several incompatible packages should result in warnings using: |
| 763 |
% \begin{quote} |
| 764 |
% \cs{scr@package@not@recommended}\marg{package}\marg{alternatives} |
| 765 |
% \end{quote} |
| 766 |
% Usually the warning contains information about \meta{alternatives}, but this |
| 767 |
% argument can also be empty. Authors of classes can deactivate the warning, |
| 768 |
% by adding a \meta{package} to the comma separated list |
| 769 |
% \cs{class@shoulddisablepackagewarning@list}. This has to be done, before |
| 770 |
% loading the \KOMAScript{} class. However doing so is not recommended and the |
| 771 |
% class author is responsible for the drawbacks. Similar the indirect warning |
| 772 |
% messages \cs{scr@class@\meta{package}@warning} could be redefined after |
| 773 |
% loading the class, but this is also not recommended. |
| 774 |
% \begin{macrocode} |
| 775 |
%<*class&body> |
| 776 |
\newcommand*{\scr@package@not@recommended}[2]{% |
| 777 |
\scr@ifundefinedorrelax{class@shoulddisablepackagewarning@list}{% |
| 778 |
\@firstofone |
| 779 |
}{% |
| 780 |
\edef\reserved@a{% |
| 781 |
\noexpand\in@{#1}{\class@shoulddisablepackagewarning@list}}% |
| 782 |
\reserved@a |
| 783 |
\ifin@\expandafter\@gobble\else\expandafter\@firstofone\fi |
| 784 |
}{% |
| 785 |
\expandafter\providecommand\csname scr@class@#1@warning\endcsname{% |
| 786 |
\ClassWarning{\KOMAClassName}{% |
| 787 |
Usage of package `#1' together\MessageBreak |
| 788 |
with a KOMA-Script class is not recommended.\MessageBreak |
| 789 |
\if\relax\detokenize{#2}\relax\else |
| 790 |
I'd suggest to use #2.\MessageBreak |
| 791 |
\fi |
| 792 |
Nevertheless, using requested\MessageBreak |
| 793 |
package `#1'% |
| 794 |
}% |
| 795 |
}% |
| 796 |
\BeforePackage{#1}{% |
| 797 |
\csname scr@class@#1@warning\endcsname |
| 798 |
}% |
| 799 |
}% |
| 800 |
}% |
| 801 |
% \end{macrocode} |
| 802 |
% \end{macro}^^A \class@shoulddisablepackagewarning@list |
| 803 |
% Here are the not recommended packages and the alternatives: |
| 804 |
% \begin{description} |
| 805 |
% \item[\pkg{emptypage}:] is not needed, because there are corresponding |
| 806 |
% options and features in \KOMAScript. |
| 807 |
% \begin{macrocode} |
| 808 |
\scr@package@not@recommended{emptypage}{% |
| 809 |
option\MessageBreak |
| 810 |
`cleardoublepage' with one of it's\MessageBreak |
| 811 |
several values} |
| 812 |
% \end{macrocode} |
| 813 |
% \item[\pkg{fancyhdr}:] does not respect font settings of \KOMAScript{} and |
| 814 |
% also breaks some other features. |
| 815 |
% \changes{v3.24}{2017/06/25}{improved \pkg{fancyhdr} warning} |
| 816 |
% \begin{macrocode} |
| 817 |
\scr@package@not@recommended{fancyhdr}{% |
| 818 |
\MessageBreak |
| 819 |
package `scrlayer' or `scrlayer-scrpage', because\MessageBreak |
| 820 |
they support KOMA-Script classes.\MessageBreak |
| 821 |
With `fancyhdr' several features of class `\KOMAClassName'\MessageBreak |
| 822 |
like options `headsepline', `footsepline' or command\MessageBreak |
| 823 |
`\string\MakeMarkcase' and the commands `\string\setkomafont' and\MessageBreak |
| 824 |
`\string\addtokomafont' for the page style elements need\MessageBreak |
| 825 |
explicite user intervention to work} |
| 826 |
% \end{macrocode} |
| 827 |
% \item[\pkg{minitoc}:] |
| 828 |
% \changes{v3.23}{2017/02/04}{\pkg{minitoc} is not recommended} |
| 829 |
% re-defines, e.g., \cs{@sect} and therefore breaks all the extensions of |
| 830 |
% \KOMAScript{} to this command. Currently not all impacts of the package has |
| 831 |
% been explored. Currently there is only a workaround for the \cs{@sect} |
| 832 |
% issue. See \autoref{sec:packageworkarounds} for more information. |
| 833 |
% \begin{macrocode} |
| 834 |
%<*!letter> |
| 835 |
\scr@package@not@recommended{minitoc}{} |
| 836 |
%</!letter> |
| 837 |
% \end{macrocode} |
| 838 |
% \item[\pkg{multitoc}:] |
| 839 |
% \changes{v3.26}{2018/07/18}{\pkg{multitoc} not recommended} |
| 840 |
% At least up to version 2.01 this breaks all additional lists/tables of |
| 841 |
% contents, because the \cs{@starttoc} redefinition does not allow to use |
| 842 |
% another extension but \file{toc}, \file{lof}, or \file{lot}. The package is |
| 843 |
% also not needed, because the \env{multicols} environment can simply be added |
| 844 |
% using \cs{BeforeStartingTOC} and \cs{AfterStartingTOC}. |
| 845 |
% \begin{macrocode} |
| 846 |
%<*!letter> |
| 847 |
\scr@package@not@recommended{multitoc}{% |
| 848 |
package `multicol' and, e.g.:\MessageBreak |
| 849 |
\space\space |
| 850 |
\string\BeforeStartingTOC{\string\begin{multicols}{2}}\MessageBreak |
| 851 |
\space\space |
| 852 |
\string\AfterStartingTOC{\string\end{multicols}}\MessageBreak |
| 853 |
to make all ToCs two-columned.\MessageBreak |
| 854 |
\@ifpackagelater{2018/07/18}{}{% |
| 855 |
Note, package `multitoc' breaks additional\MessageBreak |
| 856 |
ToCs generated by `\string\DeclareNewTOC' or\MessageBreak |
| 857 |
packages like `listings' or `newcaption' and\MessageBreak |
| 858 |
even the standard table of contents,\MessageBreak |
| 859 |
list of figures or list of tables,\MessageBreak |
| 860 |
if you omit the corresponding options `toc',\MessageBreak |
| 861 |
`lof' or `lot'.% |
| 862 |
}% |
| 863 |
} |
| 864 |
%</!letter> |
| 865 |
% \end{macrocode} |
| 866 |
% \item[\pkg{parskip}:] is an emergency fallback package for classes, that |
| 867 |
% do not support paragraph skips themselves. |
| 868 |
% \begin{macrocode} |
| 869 |
\scr@package@not@recommended{parskip}{% |
| 870 |
option\MessageBreak |
| 871 |
`parskip' with one of it's several values} |
| 872 |
% \end{macrocode} |
| 873 |
% \item[\pkg{titleps}:] |
| 874 |
% \changes{v3.16}{2015/01/21}{\pkg{titleps} not recommended} |
| 875 |
% does not respect several font settings and other features of the |
| 876 |
% \KOMAScript{} classes. |
| 877 |
% \begin{macrocode} |
| 878 |
\scr@package@not@recommended{titleps}{% |
| 879 |
package `scrlayer-scrpage'} |
| 880 |
% \end{macrocode} |
| 881 |
% \item[\pkg{titlesec}:] |
| 882 |
% \changes{v3.36}{2022/03/01}{bring back \pkg{titlesec} warning} |
| 883 |
% breaks several \KOMAScript{} features and needs a lot |
| 884 |
% of workarounds to not result in errors. Note, these workarounds have been |
| 885 |
% removed from \KOMAScript{}, because they are very fragile and use internal |
| 886 |
% macros of \pkg{titlesec}. |
| 887 |
% \begin{macrocode} |
| 888 |
%<*!letter> |
| 889 |
\scr@package@not@recommended{titlesec}{% |
| 890 |
KOMA-Script features\MessageBreak |
| 891 |
like \string\setkomafont, \string\RedeclareSectionCommand, |
| 892 |
\string\sectionlinesformat\MessageBreak |
| 893 |
and several others to re-configure section\MessageBreak |
| 894 |
headings} |
| 895 |
%</!letter> |
| 896 |
% \end{macrocode} |
| 897 |
% \item[\pkg{sectsty}:] |
| 898 |
% \changes{v3.27}{2019/07/24}{\pkg{sectsty} up to v2.0.2 is incompatible} |
| 899 |
% uses up to version 2.0.2 internal commands of |
| 900 |
% \KOMAScript{}, that has been removed already 2001 in \KOMAScript{} 2.8e. So |
| 901 |
% it was never compatible with \KOMAScript~3. |
| 902 |
% \begin{macrocode} |
| 903 |
%<*!letter> |
| 904 |
\AfterPackage*{sectsty}{% |
| 905 |
\@ifpackagelater{sectsty}{2002/02/26}{% |
| 906 |
\ClassInfo{\KOMAClassName}{Unknown `sectsty' release.\MessageBreak |
| 907 |
Cross your fingers, that is compatible% |
| 908 |
}% |
| 909 |
}{% |
| 910 |
\ClassWarning{\KOMAClassName}{% |
| 911 |
Incompatible package `sectsty' loaded!\MessageBreak |
| 912 |
Package `sectsty' up to version 2.0.2 is incompatible\MessageBreak |
| 913 |
with KOMA-Script from version 2.8e released in 2001.\MessageBreak |
| 914 |
You should avoid that package and configure the\MessageBreak |
| 915 |
section titles of your document using the KOMA-Script\MessageBreak |
| 916 |
user interface, e.g., \string\chapterlinesformat,\MessageBreak |
| 917 |
\string\RedeclareSectionCommand\space etc. or you should ask\MessageBreak |
| 918 |
the `sectsty' maintainer for a more compatible release.\MessageBreak |
| 919 |
Ignoring this warning could result in several error\MessageBreak |
| 920 |
messages and formatting issues after loading package\MessageBreak |
| 921 |
`sectsty'% |
| 922 |
}% |
| 923 |
}% |
| 924 |
} |
| 925 |
%</!letter> |
| 926 |
% \end{macrocode} |
| 927 |
% \item[\pkg{tocbibind}:] |
| 928 |
% \changes{v3.25}{2017/11/21}{Usage of \pkg{tocbibind} not recommended} |
| 929 |
% \pkg{tocbibind} does several things, that break \KOMAScript, i.e.: |
| 930 |
% \begin{itemize} |
| 931 |
% \item usage of \cs{MakeUppercase} within running heads, |
| 932 |
% \item usage of hard codes \texttt{toc} for the ToC entries, |
| 933 |
% \item hard redefinition of \env{thebibliography}, |
| 934 |
% \item hard redefinition of \env{theindex}, |
| 935 |
% \item hard redefinition of \cs{tableofcontents}, |
| 936 |
% \item hard redefinition of \cs{listoftables}, |
| 937 |
% \item hard redefinition of \cs{listoffigures}, |
| 938 |
% \item hard redefinition of \cs{@makechapterhead} |
| 939 |
% \end{itemize} |
| 940 |
% \begin{macrocode} |
| 941 |
%<*!letter> |
| 942 |
\scr@package@not@recommended{tocbibind}{% |
| 943 |
options like `listof=totoc'\MessageBreak |
| 944 |
or `bibliography=totoc', or commands like\MessageBreak |
| 945 |
`\string\setuptoc{toc}{totoc}' instead of this package,\MessageBreak |
| 946 |
because it breaks several KOMA-Script features of\MessageBreak |
| 947 |
the list of figures, list of tables, bibliography,\MessageBreak |
| 948 |
index and the running head% |
| 949 |
} |
| 950 |
%</!letter> |
| 951 |
% \end{macrocode} |
| 952 |
% \item[\pkg{tocloft}:] |
| 953 |
% \changes{v3.26}{2018/07/18}{Usage of \textsf{tocloft} not recommended} |
| 954 |
% redefines \cs{tableofcontents}, \cs{listoffigures}, |
| 955 |
% \cs{listoftables}, \cs{l@part} \dots{} \cs{l@subparagraph} and breaks |
| 956 |
% \KOMAScript, i.e.: |
| 957 |
% \begin{itemize} |
| 958 |
% \item commands \cs{BeforeTOCHead}, \cs{AfterTOCHead}, |
| 959 |
% \cs{BeforeStartingTOC}, \cs{AfterStartingTOC}, |
| 960 |
% \item almost all TOC features, |
| 961 |
% \item options \opt{listof=totoc}, \opt{listof=numbered}, |
| 962 |
% \item option \opt{listof=flat}, |
| 963 |
% \item option \opt{listof=entryprefix}, |
| 964 |
% \item all options of \cs{DeclareTOCEntryStyle}, |
| 965 |
% \end{itemize} |
| 966 |
% \begin{macrocode} |
| 967 |
%<*!letter> |
| 968 |
\scr@package@not@recommended{tocloft}{% |
| 969 |
options like `listof=entryprefix',\MessageBreak |
| 970 |
commands like `\string\listoflofentryname' or\MessageBreak |
| 971 |
`\string\listoflotentryname', |
| 972 |
and `\string\DeclareTOCStyleEntry' or\MessageBreak |
| 973 |
`\string\RedeclareSectionCommand' |
| 974 |
instead of this package,\MessageBreak |
| 975 |
because it breaks several KOMA-Script features of\MessageBreak |
| 976 |
the list of figures, list of tables and table of\MessageBreak |
| 977 |
contents, i.e., options like `listof=numbered',\MessageBreak |
| 978 |
`listof=flat or `toc=flat', commands like\MessageBreak |
| 979 |
`\string\BeforeTOCHead{...}' and |
| 980 |
`\string\AfterTOCHead{...}',\MessageBreak |
| 981 |
`\string\BeforeStartingTOC{...}' and |
| 982 |
\string\AfterStartingTOC{...}',\MessageBreak |
| 983 |
all features of `\string\DeclareTOCStyleEntry',\MessageBreak |
| 984 |
and the ToC entry features of `\string\DeclareSecionCommand'\MessageBreak |
| 985 |
and `\string\RedeclareSectionCommand' of levels\MessageBreak |
| 986 |
`part', |
| 987 |
%<article> `chapter', |
| 988 |
`section', `subsection',\MessageBreak |
| 989 |
`subsubsection', `paragraph' and `subparagraph'% |
| 990 |
} |
| 991 |
%</!letter> |
| 992 |
%</class&body> |
| 993 |
% \end{macrocode} |
| 994 |
% \end{description} |
| 995 |
% \end{macro}^^A \scr@package@not@recommended |
| 996 |
% |
| 997 |
% \section{Workarounds for Incompatible Packages} |
| 998 |
% \label{sec:packageworkarounds} |
| 999 |
% |
| 1000 |
% \begin{description} |
| 1001 |
% \item[ToDo:] The code should be moved to the same file as the code of |
| 1002 |
% \autoref{sec:packagewarning} or maybe even to \pkg{scrhack}. |
| 1003 |
% \end{description} |
| 1004 |
% |
| 1005 |
% For some packages can be made compatible, patching some internal macros of |
| 1006 |
% these packages: |
| 1007 |
% \begin{description} |
| 1008 |
% \item[\pkg{minitoc}:] |
| 1009 |
% \changes{v3.23}{2017/02/04}{\pkg{minitoc} is incompatible} |
| 1010 |
% has some serious issues. The first issue is the hard re-definition of |
| 1011 |
% \cs{@sect} without respecting the changes the \KOMAScript{} classes |
| 1012 |
% already made. Here I'll try a ugly workaround for this, but is can |
| 1013 |
% break. So not using the package with a \KOMAScript{} class would be the |
| 1014 |
% better choice. |
| 1015 |
% \begin{macrocode} |
| 1016 |
%<*class&body> |
| 1017 |
%<*!letter> |
| 1018 |
\BeforePackage{minitoc}{% |
| 1019 |
\let\scr@mt@saved@sect\@sect |
| 1020 |
} |
| 1021 |
\AfterPackage{minitoc}{% |
| 1022 |
\def\@tempa#1#2#3#4#5#6[#7]#8{% |
| 1023 |
\ifnum #2<1 \relax |
| 1024 |
\addtocontents{toc}{\protect\sectbegin} |
| 1025 |
\fi |
| 1026 |
\stc@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}% |
| 1027 |
}% |
| 1028 |
\ifx\@sect\@tempa |
| 1029 |
% \end{macrocode} |
| 1030 |
% Note: There are several bugs in this definition (e.g. missing |
| 1031 |
% \cs{expandafter} and spurious spaced). Nevertheless its the original one |
| 1032 |
% from \pkg{minitoc} 61 and 62 and so I have to use it. |
| 1033 |
% \begin{macrocode} |
| 1034 |
\def\@tempa#1#2#3#4#5#6[#7]#8{ |
| 1035 |
\expandafter |
| 1036 |
\ifx\csname #1\endcsname\section\relax |
| 1037 |
\addcontentsline{lof}{xsect}{#7}% |
| 1038 |
\addcontentsline{lot}{xsect}{#7}% |
| 1039 |
\fi |
| 1040 |
\ifx\csname #1\endcsname\starsection\relax |
| 1041 |
\addcontentsline{lof}{xsect}{#7}% |
| 1042 |
\addcontentsline{lot}{xsect}{#7}% |
| 1043 |
\fi |
| 1044 |
\ifnum #2>\c@secnumdepth\relax |
| 1045 |
\let\@svsec\@empty |
| 1046 |
\else |
| 1047 |
\refstepcounter{#1}% |
| 1048 |
\edef\@svsec{\csname the#1\endcsname\hskip 1em}% |
| 1049 |
\fi |
| 1050 |
\@tempskipa #5\relax |
| 1051 |
\ifdim \@tempskipa>\z@ |
| 1052 |
\begingroup #6\relax |
| 1053 |
\@hangfrom{\hskip #3\relax\@svsec}% |
| 1054 |
{\interlinepenalty \@M #8\par}% |
| 1055 |
\endgroup |
| 1056 |
\csname #1mark\endcsname{#7}% |
| 1057 |
\addcontentsline{toc}{#1}{% |
| 1058 |
\ifnum #2>\c@secnumdepth\relax |
| 1059 |
\else |
| 1060 |
\protect\numberline{\csname the#1\endcsname}% |
| 1061 |
\fi |
| 1062 |
#7% |
| 1063 |
}% |
| 1064 |
\else |
| 1065 |
\def\@svsechd{#6\hskip #3\relax |
| 1066 |
\@svsec #8\csname #1mark\endcsname{#7}% |
| 1067 |
\addcontentsline{toc}{#1}{% |
| 1068 |
\ifnum #2>\c@secnumdepth\relax |
| 1069 |
\else |
| 1070 |
\protect\numberline{\csname the#1\endcsname} |
| 1071 |
\fi |
| 1072 |
#7}% |
| 1073 |
}% |
| 1074 |
\fi |
| 1075 |
\@xsect{#5}% |
| 1076 |
}% |
| 1077 |
\ifx\stc@sect\@tempa |
| 1078 |
\ClassWarning{\KOMAClassName}{% |
| 1079 |
Redefining minitoc's internal command |
| 1080 |
`\string\stc@sect'\MessageBreak |
| 1081 |
to prevent minitoc to destroy several features\MessageBreak |
| 1082 |
of KOMA-Script% |
| 1083 |
}% |
| 1084 |
\let\stc@sect\scr@mt@saved@sect |
| 1085 |
\else |
| 1086 |
\ClassInfo{\KOMAClassName}{% |
| 1087 |
Deactivating the `minitoc' workaround,\MessageBreak |
| 1088 |
because of unexpected definition of\MessageBreak |
| 1089 |
`\string\stc@sect'% |
| 1090 |
}% |
| 1091 |
\let\scr@mt@saved@sect\relax |
| 1092 |
\fi |
| 1093 |
\else |
| 1094 |
\ifx\@sect\scr@mt@saved@sect |
| 1095 |
\ClassInfo{\KOMAClassName}{% |
| 1096 |
Deactivating the `minitoc' workaround for |
| 1097 |
`\string\@sect',\MessageBreak |
| 1098 |
because it is not needed% |
| 1099 |
}% |
| 1100 |
\else |
| 1101 |
\ClassInfo{\KOMAClassName}{% |
| 1102 |
Deactivating the `minitoc' workaround,\MessageBreak |
| 1103 |
because of unexpected definition of\MessageBreak |
| 1104 |
`\string\@sect'% |
| 1105 |
}% |
| 1106 |
\fi |
| 1107 |
\let\scr@mt@saved@sect\relax |
| 1108 |
\fi |
| 1109 |
} |
| 1110 |
%</!letter> |
| 1111 |
%</class&body> |
| 1112 |
% \end{macrocode} |
| 1113 |
% \item[\pkg{titlesec}:] |
| 1114 |
% \changes{v3.13a}{2014/10/09}{\pkg{titlesec} is hardly incompatible} |
| 1115 |
% \changes{v3.27}{2019/07/23}{\pkg{titlesec} does not support |
| 1116 |
% KOMA-Script classes}% |
| 1117 |
% After several years \textsf{titlesec} still does not really support |
| 1118 |
% \KOMAScript{} classes and \KOMAScript{} would still need an ugly hack |
| 1119 |
% using internal \texttt{titlesec} macros and deactivating several features |
| 1120 |
% of \KOMAScript{} to make the package work. So IMO the better solution is |
| 1121 |
% to remove such hacks from the \KOMAScript{} classes. Maybe the |
| 1122 |
% \pkg{titlesec} author will support the \KOMAScript{} classes in some |
| 1123 |
% future, maybe not. If you really need to \pkg{titlesec} with a |
| 1124 |
% \KOMAScript{} class, see the ugly \texttt{standardsection} hack in |
| 1125 |
% \pkg*{scrhack}. |
| 1126 |
% \end{description} |
| 1127 |
% |
| 1128 |
% |
| 1129 |
% \Finale |
| 1130 |
% \PrintChanges |
| 1131 |
% |
| 1132 |
\endinput |
| 1133 |
% Local Variables: |
| 1134 |
% mode: doctex |
| 1135 |
% ispell-local-dictionary: "en_US" |
| 1136 |
% eval: (flyspell-mode 1) |
| 1137 |
% TeX-master: t |
| 1138 |
% TeX-engine: luatex-dev |
| 1139 |
% 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")) |
| 1140 |
% End: |