| 1 |
% \iffalse meta-comment |
| 2 |
% ====================================================================== |
| 3 |
% scrkernel-footnotes.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-footnotes.dtx 4245 2025-11-26 08:59:26Z 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-11-26 09:59:26 +0100 (Mi, 26 Nov 2025) $ |
| 29 |
\def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} |
| 30 |
\filerevision$Revision: 4245 $ |
| 31 |
\edef\reserved@a{% |
| 32 |
\noexpand\endgroup |
| 33 |
\noexpand\ProvidesFile{scrkernel-footnotes.dtx}% |
| 34 |
[\filedate\space\filerevision\space |
| 35 |
KOMA-Script source |
| 36 |
(footnotes)] |
| 37 |
}% |
| 38 |
\reserved@a |
| 39 |
\documentclass[USenglish]{koma-script-source-doc} |
| 40 |
\usepackage{babel} |
| 41 |
\setcounter{StandardModuleDepth}{2} |
| 42 |
\begin{document} |
| 43 |
\DocInput{scrkernel-footnotes.dtx} |
| 44 |
\end{document} |
| 45 |
%</dtx> |
| 46 |
% \fi^^A meta-comment |
| 47 |
% |
| 48 |
% \changes{v2.95}{2002/07/01}{new by splitting \file{scrclass.dtx}} |
| 49 |
% \changes{v3.36}{2022/02/16}{switch over from \cls*{scrdoc} to |
| 50 |
% \cls*{koma-script-source-doc}} |
| 51 |
% \changes{v3.36}{2022/02/16}{whole implementation documentation in English} |
| 52 |
% \changes{v3.40}{2023/04/17}{guide names changed} |
| 53 |
% |
| 54 |
% \GetFileInfo{scrkernel-footnotes.dtx} |
| 55 |
% \title{Index Code of the |
| 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 |
% The code for footnotes with \KOMAScript{} classes in |
| 62 |
% \file{scrkernel-footnotes.dtx} is somehow different from the code of the |
| 63 |
% standard classes. It provides several options and other configuration |
| 64 |
% possibilities. The initial change bases on a comment in the documented |
| 65 |
% \LaTeX{} kernel, \file{source2e.pdf}. But this was long ago and almost |
| 66 |
% everything has been changed meanwhile. |
| 67 |
% \end{abstract} |
| 68 |
% \tableofcontents |
| 69 |
% |
| 70 |
% \section{User Manual} |
| 71 |
% |
| 72 |
% You can find the user documentation the commands implemented here in the |
| 73 |
% \KOMAScript{} manual, either the German \file{scrguide-de.pdf} or the |
| 74 |
% English \file{scrguide-en.pdf}. |
| 75 |
% |
| 76 |
% \MaybeStop{\PrintIndex} |
| 77 |
% |
| 78 |
% \section{Implementation of Footnotes} |
| 79 |
% |
| 80 |
% \subsection{Options} |
| 81 |
% |
| 82 |
% \begin{option}{footnotes} |
| 83 |
% \changes{v2.98c}{2008/02/01}{new value \opt{multiple}} |
| 84 |
% \changes{v3.10}{2011/09/13}{\cs{let} replaced by \cs{def} fixes the using as |
| 85 |
% a class option} |
| 86 |
% \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyStateProcessed}} |
| 87 |
% \changes{v3.17}{2015/03/11}{internal value storage} |
| 88 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}} |
| 89 |
% \changes{v3.39}{2022/11/11}{initial dot removed from member argument of |
| 90 |
% option storage commands} |
| 91 |
% Multiple footnotes mean, that there are more than one footnote at the same |
| 92 |
% place in the text. Usually this would result in a sequence of numbers (or |
| 93 |
% other footnote signes) not seperated anyhow. So you would not be able, e.g., |
| 94 |
% if 12 means footnote number 1 and footnote number 2 or footnote number 12. A |
| 95 |
% better solution is to add automatic separation characters between such |
| 96 |
% footnote marks. The functionality has been made similar and compatible with |
| 97 |
% \pkg{footmisc} version 5.x. So it should be compatible with that |
| 98 |
% package. Even switching on and off should also work in case of using the |
| 99 |
% package. |
| 100 |
% \begin{macrocode} |
| 101 |
%<*option> |
| 102 |
\KOMA@key{footnotes}{% |
| 103 |
\ifx\@footnotemark\scr@saved@footnotemark |
| 104 |
\else |
| 105 |
\ifx\@footnotemark\scr@footnotemark |
| 106 |
\else |
| 107 |
%<class> \ClassWarning{\KOMAClassName}{% |
| 108 |
%<package> \PackageWarning{scrextend}{% |
| 109 |
Change of `\string\@footnotemark' detected!\MessageBreak |
| 110 |
Use of `footnotes=#1' may break\MessageBreak |
| 111 |
another package!\MessageBreak |
| 112 |
Maybe you should remove the usage of\MessageBreak |
| 113 |
option `footnotes=#1'}% |
| 114 |
\fi |
| 115 |
\fi |
| 116 |
\Ifstr{#1}{multiple}{% |
| 117 |
\let\@footnotemark\scr@footnotemark |
| 118 |
\def\FN@mf@prepare{\scr@mf@prepare}% |
| 119 |
\def\scr@footmisc@options{multiple}% |
| 120 |
\FamilyKeyStateProcessed |
| 121 |
\KOMA@kav@replacevalue{% |
| 122 |
%<class> \KOMAClassFileName |
| 123 |
%<package&extend> scrextend.\scr@pkgextension |
| 124 |
}{footnotes}{multiple}% |
| 125 |
}{% |
| 126 |
\Ifstr{#1}{nomultiple}{% |
| 127 |
\let\@footnotemark\scr@saved@footnotemark |
| 128 |
\let\FN@mf@prepare\relax |
| 129 |
\let\scr@footmisc@options\@empty |
| 130 |
\FamilyKeyStateProcessed |
| 131 |
\KOMA@kav@replacevalue{% |
| 132 |
%<class> \KOMAClassFileName |
| 133 |
%<package&extend> scrextend.\scr@pkgextension |
| 134 |
}{footnotes}{nomultiple}% |
| 135 |
}{% |
| 136 |
\KOMA@unknown@keyval{footnotes}{#1}{`multiple' and `nomultiple'}% |
| 137 |
}% |
| 138 |
}% |
| 139 |
} |
| 140 |
\AtBeginDocument{% |
| 141 |
\ifx\@footnotemark\scr@saved@footnotemark |
| 142 |
\KOMA@kav@removekey{% |
| 143 |
%<class> \KOMAClassFileName |
| 144 |
%<package&extend> scrextend.\scr@pkgextension |
| 145 |
}{footnotes}% |
| 146 |
\KOMA@kav@add{% |
| 147 |
%<class> \KOMAClassFileName |
| 148 |
%<package&extend> scrextend.\scr@pkgextension |
| 149 |
}{footnotes}{nomultiple}% |
| 150 |
\else\ifx\@footnotemark\scr@footnotemark |
| 151 |
\KOMA@kav@removekey{% |
| 152 |
%<class> \KOMAClassFileName |
| 153 |
%<package&extend> scrextend.\scr@pkgextension |
| 154 |
}{footnotes}% |
| 155 |
\KOMA@kav@add{% |
| 156 |
%<class> \KOMAClassFileName |
| 157 |
%<package&extend> scrextend.\scr@pkgextension |
| 158 |
}{footnotes}{multiple}% |
| 159 |
\fi\fi |
| 160 |
} |
| 161 |
% \end{macrocode} |
| 162 |
% \begin{macro}{\scr@footmisc@options} |
| 163 |
% \changes{v2.98c}{2008/02/14}{added} |
| 164 |
% For better compatibility \opt{footnotes=multiple} will be passed as |
| 165 |
% \opt{multiple} to package \pkg{footmisc} using a \KOMAScript-internal macro. |
| 166 |
% \begin{macrocode} |
| 167 |
\newcommand*{\scr@footmisc@options}{} |
| 168 |
\PassOptionsToPackage{\noexpand\scr@footmisc@options}{footmisc} |
| 169 |
% \end{macrocode} |
| 170 |
% \end{macro} |
| 171 |
% \begin{macro}{\scr@saved@footnotemark,\scr@footnotemark} |
| 172 |
% \changes{v2.98c}{2008/02/01}{added} |
| 173 |
% \begin{macrocode} |
| 174 |
\newcommand*{\scr@saved@footnotemark}{% |
| 175 |
\leavevmode |
| 176 |
\ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi |
| 177 |
\@makefnmark |
| 178 |
\ifhmode\spacefactor\@x@sf\fi |
| 179 |
\relax} |
| 180 |
\expandafter\CheckCommand\expandafter*\expandafter\@footnotemark |
| 181 |
\expandafter{\scr@saved@footnotemark} |
| 182 |
\newcommand*{\scr@footnotemark}{% |
| 183 |
\leavevmode |
| 184 |
\ifhmode\edef\@x@sf{\the\spacefactor}\FN@mf@check\nobreak\fi |
| 185 |
\@makefnmark |
| 186 |
\csname FN@mf@prepare\endcsname |
| 187 |
\ifhmode\spacefactor\@x@sf\fi |
| 188 |
\relax} |
| 189 |
%</option> |
| 190 |
% \end{macrocode} |
| 191 |
% \end{macro}^^A \scr@saved@footnotemark,\scr@footnotemark |
| 192 |
% \end{option}^^A footnotes |
| 193 |
% |
| 194 |
% |
| 195 |
% \subsection{Commands and macros for footnotes} |
| 196 |
% |
| 197 |
% \begin{command}{\footnoterule} |
| 198 |
% \changes{v2.3a}{1995/07/08}{using \cs{@width}} |
| 199 |
% \changes{v2.8q}{2002/02/06}{\cs{raggedbottom} changed} |
| 200 |
% \changes{v2.95}{2002/01/07}{\texttt{.05fil} instead of \texttt{.005fil}} |
| 201 |
% \changes{v3.06}{2010/04/03}{using new length macros} |
| 202 |
% \changes{v3.07}{2010/09/14}{using new font element \fnt{footnoterule}} |
| 203 |
% \changes{v3.19}{2015/08/24}{not with \pkg*{scrextend}} |
| 204 |
% In case of \cs{raggedbottom} the footnote rule is moved downwards. Note, |
| 205 |
% that this does not work, if there is a bottom placed float. The indication |
| 206 |
% of using \cs{raggedbottom} is, \cs{@textbottom} is not \cs{relax}. This can |
| 207 |
% fail, but nevertheless is an improvement. |
| 208 |
% \begin{macrocode} |
| 209 |
%<*body> |
| 210 |
%<*class> |
| 211 |
\renewcommand*\footnoterule{% |
| 212 |
\normalsize\ftn@rule@test@values |
| 213 |
\kern-\dimexpr 2.6\p@+\ftn@rule@height\relax |
| 214 |
\ifx\@textbottom\relax\else\vskip \z@ \@plus.05fil\fi |
| 215 |
{\usekomafont{footnoterule}{% |
| 216 |
\hrule \@height\ftn@rule@height \@width\ftn@rule@width}}% |
| 217 |
\kern 2.6\p@} |
| 218 |
% \end{macrocode} |
| 219 |
% \begin{macro}{\ftn@rule@test@values} |
| 220 |
% \changes{v3.06}{2010/04/03}{added} |
| 221 |
% Plausibility test for the lengths of the rule. |
| 222 |
% \begin{macrocode} |
| 223 |
\newcommand*{\ftn@rule@test@values}{% |
| 224 |
\ifdim\ftn@rule@height <\z@ |
| 225 |
\ClassWarning{\KOMAClassName}{% |
| 226 |
You might get into trouble, because the\MessageBreak |
| 227 |
height of the footnote rule has a value\MessageBreak |
| 228 |
less than 0% |
| 229 |
}% |
| 230 |
\else |
| 231 |
\ifdim\ftn@rule@height >\dimexpr\skip\footins -2.6\p@\relax |
| 232 |
\ClassWarning{\KOMAClassName}{% |
| 233 |
You might get into trouble, because the\MessageBreak |
| 234 |
height of the footnote rule has a value\MessageBreak |
| 235 |
greater than \the\dimexpr\skip\footins -2.6\p@\relax |
| 236 |
}% |
| 237 |
\fi |
| 238 |
\fi |
| 239 |
\ifdim\ftn@rule@width <\z@ |
| 240 |
\ClassWarning{\KOMAClassName}{% |
| 241 |
You might get into trouble, because the width\MessageBreak |
| 242 |
or length of the footnote rule has a value\MessageBreak |
| 243 |
less than 0pt% |
| 244 |
}% |
| 245 |
\else |
| 246 |
\ifdim\ftn@rule@width >\columnwidth |
| 247 |
\ClassWarning{\KOMAClassName}{% |
| 248 |
You might get into trouble, because the width\MessageBreak |
| 249 |
or length of the footnote rule has a value\MessageBreak |
| 250 |
greater than \string\columnwidth |
| 251 |
}% |
| 252 |
\fi |
| 253 |
\fi |
| 254 |
} |
| 255 |
% \end{macrocode} |
| 256 |
% \end{macro}^^A \ftn@rule@test@values |
| 257 |
% \begin{fontelement}{footnoterule} |
| 258 |
% \changes{v3.07}{2010/09/14}{added} |
| 259 |
% \changes{v3.19}{2015/08/24}{not with \pkg*{scrextend}} |
| 260 |
% To be able to change the color of the rule, we are using a font element. The |
| 261 |
% default is empty. |
| 262 |
% \begin{macrocode} |
| 263 |
\newkomafont{footnoterule}{} |
| 264 |
% \end{macrocode} |
| 265 |
% \end{fontelement} |
| 266 |
% \begin{macro}{\ftn@rule@width} |
| 267 |
% \changes{v3.06}{2010/04/03}{added} |
| 268 |
% \changes{v3.19}{2015/08/24}{not with \pkg*{scrextend}} |
| 269 |
% The length of the footnote rule. |
| 270 |
% \begin{macrocode} |
| 271 |
\newcommand*{\ftn@rule@width}{.4\columnwidth} |
| 272 |
% \end{macrocode} |
| 273 |
% \end{macro} |
| 274 |
% \begin{macro}{\ftn@rule@height} |
| 275 |
% \changes{v3.06}{2010/04/03}{added} |
| 276 |
% \changes{v3.19}{2015/08/24}{not with \pkg*{scrextend}} |
| 277 |
% The height of the footnote rule (depth is always 0). |
| 278 |
% \begin{macrocode} |
| 279 |
\newcommand*{\ftn@rule@height}{.4\p@} |
| 280 |
% \end{macrocode} |
| 281 |
% \end{macro} |
| 282 |
% \begin{command}{\setfootnoterule} |
| 283 |
% \changes{v3.06}{2010/04/03}{added} |
| 284 |
% \changes{v3.19}{2015/08/24}{not with \pkg*{scrextend}} |
| 285 |
% \changes{v3.28}{2019/11/18}{\cs{ifstr} replaced by \cs{IfArgIsEmpty}} |
| 286 |
% The first optional argument (\texttt{\#1}) it the height of the line. If it |
| 287 |
% is missing, the height is not changed. The first mandatory argument |
| 288 |
% (\texttt{\#2}) is the length of the line. |
| 289 |
% \begin{macrocode} |
| 290 |
\newcommand*{\setfootnoterule}[2][]{% |
| 291 |
\IfArgIsEmpty{#1}{}{% |
| 292 |
\renewcommand*{\ftn@rule@height}{#1}% |
| 293 |
}% |
| 294 |
\IfArgIsEmpty{#2}{}{% |
| 295 |
\renewcommand*{\ftn@rule@width}{#2}% |
| 296 |
}% |
| 297 |
\ftn@rule@test@values |
| 298 |
} |
| 299 |
%</class> |
| 300 |
% \end{macrocode} |
| 301 |
% \end{command}^^A \setfootnoterule |
| 302 |
% \end{command}^^A \footnoterule |
| 303 |
% |
| 304 |
% \begin{counter}{footnote} |
| 305 |
% The footnote counter is reset with every \cs{chapter}. So the numbering is |
| 306 |
% per chapter. |
| 307 |
% \begin{macrocode} |
| 308 |
%<book|report>\@addtoreset{footnote}{chapter} |
| 309 |
% \end{macrocode} |
| 310 |
% \end{counter} |
| 311 |
% |
| 312 |
% \begin{command}{\deffootnote} |
| 313 |
% \changes{v2.4l}{1997/02/06}{added} |
| 314 |
% \changes{v2.95}{2002/07/09}{paragraph indent fixed} |
| 315 |
% \changes{v2.9l}{2003/01/28}{\cs{edef}\cs{@tempa} replaced} |
| 316 |
% \changes{v2.9q}{2004/01/31}{\cs{ftn@font} does not support an argument |
| 317 |
% because of compatibility with \pkg{footnote}} |
| 318 |
% \changes{v3.22}{2017/01/03}{completely new implementation} |
| 319 |
% \changes{v3.23}{2017/03/27}{using \cs{raggedfootnote}} |
| 320 |
% \changes{v3.36}{2022/02/16}{hooks added} |
| 321 |
% This command defines the formatting of footnotes. The arguments are: |
| 322 |
% \begin{description} |
| 323 |
% \item[\oarg{first indent}:] the indent of the text of the first line of the |
| 324 |
% footnote, |
| 325 |
% \item[\marg{indent}:] the indent from the second line of the footnote, |
| 326 |
% \item[\marg{paragraph indent}:] the indent of the first line of a paragraph |
| 327 |
% if the footnote has more than one paragraph. |
| 328 |
% \item[\marg{mark code}:] the code of the footnote mark in the footnote (for |
| 329 |
% the mark in the text see \cs{deffootnotemark}). |
| 330 |
% \end{description} |
| 331 |
% The \meta{mark code} is additionally encapsulated in a \cs{hbox} of |
| 332 |
% with \meta{first indent}. If \meta{first indent} is not given it is set to |
| 333 |
% \meta{indent}. |
| 334 |
% \begin{macrocode} |
| 335 |
\newcommand\deffootnote[4][]{% |
| 336 |
%<!v4> \expandafter\ifnum\scr@v@is@ge{3.22}\relax |
| 337 |
\long\def\@makefntext##1{% |
| 338 |
\ExecuteDoHook{footnote/text/begin}% |
| 339 |
\raggedfootnote |
| 340 |
\leftskip #2 |
| 341 |
\l@addto@macro\@trivlist{% |
| 342 |
\ifnum\@listdepth=\@ne\advance\leftmargin #2\relax\fi |
| 343 |
}% |
| 344 |
\parindent #3\noindent |
| 345 |
\IfArgIsEmpty{#1}{}{% |
| 346 |
\hskip \dimexpr #1-#2\relax |
| 347 |
}% |
| 348 |
\ftn@font\hbox to \z@{\hss\@@makefnmark}##1% |
| 349 |
\ExecuteDoHook{footnote/text/end}% |
| 350 |
}% |
| 351 |
%<*!v4> |
| 352 |
\else |
| 353 |
%<class> \ClassInfo{\KOMAClassName}{% |
| 354 |
%<package> \PackageInfo{scrextend}{% |
| 355 |
Using old \string\@makefntext\space due to compatibility |
| 356 |
level\MessageBreak |
| 357 |
less than 3.22}% |
| 358 |
\long\def\@makefntext##1{% |
| 359 |
\setlength{\@tempdimc}{#3}% |
| 360 |
\def\@tempa{#1}\ifx\@tempa\@empty |
| 361 |
\@setpar{\@@par |
| 362 |
\@tempdima = \hsize |
| 363 |
\addtolength{\@tempdima}{-#2}% |
| 364 |
\parshape \@ne #2 \@tempdima}% |
| 365 |
\else |
| 366 |
\addtolength{\@tempdimc}{#2}% |
| 367 |
\addtolength{\@tempdimc}{-#1}% |
| 368 |
\@setpar{\@@par |
| 369 |
\@tempdima = \hsize |
| 370 |
\addtolength{\@tempdima}{-#1}% |
| 371 |
\@tempdimb = \hsize |
| 372 |
\addtolength{\@tempdimb}{-#2}% |
| 373 |
\parshape \tw@ #1 \@tempdima #2 \@tempdimb |
| 374 |
}% |
| 375 |
\fi |
| 376 |
\par |
| 377 |
\parindent\@tempdimc\noindent |
| 378 |
\ftn@font\hbox to \z@{\hss\@@makefnmark}##1% |
| 379 |
}% |
| 380 |
\fi |
| 381 |
%</!v4> |
| 382 |
% \end{macrocode} |
| 383 |
% \begin{macro}{\@@makefnmark} |
| 384 |
% \changes{v2.4l}{1997/02/06}{added} |
| 385 |
% Used to set the mark at the beginning of the footnote. Here we add the font |
| 386 |
% element. |
| 387 |
% \begin{macrocode} |
| 388 |
\def\@@makefnmark{\hbox{\ftnm@font{#4}}}% |
| 389 |
% \end{macrocode} |
| 390 |
% \end{macro}^^A \@@makefnmark |
| 391 |
% \begin{macrocode} |
| 392 |
} |
| 393 |
% \end{macrocode} |
| 394 |
% \end{command}^^A \deffootnote |
| 395 |
% |
| 396 |
% \begin{macro}{\raggedfootnote} |
| 397 |
% \changes{v3.23}{2017/03/27}{added} |
| 398 |
% Falk requested a new feature: Being able to change the |
| 399 |
% alignment/justification of the footnote text. The default is to change |
| 400 |
% nothing. |
| 401 |
% \begin{macrocode} |
| 402 |
\newcommand*{\raggedfootnote}{} |
| 403 |
% \end{macrocode} |
| 404 |
% \end{macro}^^A \raggedfootnote |
| 405 |
% |
| 406 |
% \begin{fontelement}{footnotelabel,footnotetext,footnote} |
| 407 |
% \begin{fontelement}{footnotenumber} |
| 408 |
% \changes{v3.36}{2022/02/16}{real alias of \fnt{footnotelabel}} |
| 409 |
% \begin{macro}{\ftn@font,\scr@fnt@footnote,\ftnm@font,\scr@fnt@footnotelabel} |
| 410 |
% \changes{v2.8q}{2001/11/16}{added} |
| 411 |
% There are two new font elements with two aliases. They are not defined using |
| 412 |
% \cs{newkomafont}, because they have to use not the default font commands but |
| 413 |
% another one compatible with \pkg{footnote}. |
| 414 |
% \begin{macrocode} |
| 415 |
\newcommand*{\ftn@font}{\normalfont} |
| 416 |
\newcommand*{\scr@fnt@footnote}{\ftn@font} |
| 417 |
\newcommand*{\ftnm@font}{} |
| 418 |
\aliaskomafont{footnotenumber}{footnotelabel} |
| 419 |
\newcommand*{\scr@fnt@footnotelabel}{\ftnm@font} |
| 420 |
\aliaskomafont{footnotetext}{footnote} |
| 421 |
% \end{macrocode} |
| 422 |
% \end{macro}^^A \fnt@font,\scr@fnt@footnote … \scr@fnt@footnotelabel |
| 423 |
% \end{fontelement}^^A footnotenumber |
| 424 |
% \end{fontelement}^^A footnotelabel,footnotetext,footnote |
| 425 |
% |
| 426 |
% \begin{command}{\deffootnotemark} |
| 427 |
% \changes{v2.4l}{1997/02/06}{added} |
| 428 |
% The definition of the footnote mark in the text can also changed. The |
| 429 |
% default is the usual definition extended by the font element. |
| 430 |
% \begin{macrocode} |
| 431 |
\newcommand*\deffootnotemark[1]{% |
| 432 |
\def\@makefnmark{\hbox{\ftntm@font{#1}}}% |
| 433 |
} |
| 434 |
% \end{macrocode} |
| 435 |
% \begin{fontelement}{footnotereference} |
| 436 |
% \begin{fontelement}{footnotemark,footnoteref} |
| 437 |
% \changes{v3.36}{2022/02/16}{real alias of \fnt{footnotereference}} |
| 438 |
% \begin{macro}{\ftntm@font,\scr@fnt@footnotereference} |
| 439 |
% \changes{v2.8q}{2001/11/16}{added} |
| 440 |
% The font element of the footnote mark in the text and two aliases. |
| 441 |
% \begin{macrocode} |
| 442 |
\newcommand*{\ftntm@font}{} |
| 443 |
\newcommand*{\scr@fnt@footnotereference}{\ftntm@font} |
| 444 |
\aliaskomafont{footnoteref}{footnotereference} |
| 445 |
\aliaskomafont{footnotemark}{footnotereference} |
| 446 |
% \end{macrocode} |
| 447 |
% \end{macro}^^A \ftntm@font,\scr@fnt@footnotereference |
| 448 |
% \end{fontelement}^^A footnotemark,footnoteref |
| 449 |
% \end{fontelement}^^A footnotereference |
| 450 |
% \begin{macro}{\FN@mf@check} |
| 451 |
% \changes{v2.98c}{2008/02/01}{added} |
| 452 |
% Detect multiple footnotes by \cs{lastkern} and add the separator. |
| 453 |
% \begin{macrocode} |
| 454 |
%<package>\providecommand*{\FN@mf@check}{% |
| 455 |
%<class>\newcommand*{\FN@mf@check}{% |
| 456 |
\ifdim\lastkern=\multiplefootnotemarker\relax |
| 457 |
\edef\@x@sf{\the\spacefactor}% |
| 458 |
\unkern\multiplefootnoteseparator |
| 459 |
\spacefactor\@x@sf\relax |
| 460 |
\fi |
| 461 |
} |
| 462 |
% \end{macrocode} |
| 463 |
% \end{macro}^^A \FN@mf@check |
| 464 |
% \begin{macro}{\scr@mf@prepare} |
| 465 |
% \changes{v2.98c}{2008/02/01}{added} |
| 466 |
% Add the kern to detect multiple footnotes without change of the resulting kern. |
| 467 |
% \begin{macrocode} |
| 468 |
\newcommand*{\scr@mf@prepare}{% |
| 469 |
\kern-\multiplefootnotemarker |
| 470 |
\kern\multiplefootnotemarker\relax |
| 471 |
} |
| 472 |
% \end{macrocode} |
| 473 |
% \end{macro}^^A \scr@mf@prepare |
| 474 |
% \begin{macro}{\F@mf@prepare} |
| 475 |
% \changes{v2.98c}{2008/02/14}{added} |
| 476 |
% \changes{v3.25a}{2018/04/17}{explicit definition} |
| 477 |
% To stay compatible with \pkg{footmisc} we define this too (but \cs{relax} |
| 478 |
% and only if not defined before). |
| 479 |
% \begin{macrocode} |
| 480 |
\@ifundefined{FN@mf@prepare}{\let\FN@mf@prepare\relax}{} |
| 481 |
% \end{macrocode} |
| 482 |
% \end{macro}^^A \F@mf@prepare |
| 483 |
% \begin{macro}{\@footnotetext} |
| 484 |
% \changes{v3.01a}{2008/11/22}{long} |
| 485 |
% \begin{macro}{\scr@saved@footnotetext} |
| 486 |
% \changes{v2.98c}{2008/02/01}{added} |
| 487 |
% \changes{v3.01a}{2008/11/22}{long} |
| 488 |
% We have to add the multiple footnote preparation to the definition of |
| 489 |
% \cs{@footnotetext}. |
| 490 |
% \begin{macrocode} |
| 491 |
\newcommand{\scr@saved@footnotetext}{} |
| 492 |
\let\scr@saved@footnotetext\@footnotetext |
| 493 |
\renewcommand{\@footnotetext}[1]{% |
| 494 |
\scr@saved@footnotetext{#1}% |
| 495 |
\csname FN@mf@prepare\endcsname |
| 496 |
} |
| 497 |
% \end{macrocode} |
| 498 |
% And \pkg{footmisc} should not warn because of a not expected definition of |
| 499 |
% \cs{@footnotemark}. |
| 500 |
% \begin{macrocode} |
| 501 |
\BeforePackage{footmisc}{% |
| 502 |
\ifx\@footnotemark\scr@footnotemark |
| 503 |
\let\@footnotemark\scr@saved@footnotemark |
| 504 |
\fi |
| 505 |
\let\@footnotetext\scr@saved@footnotetext |
| 506 |
} |
| 507 |
% \end{macrocode} |
| 508 |
% \changes{v3.10}{2011/09/12}{\pkg{setspace} workaround} |
| 509 |
% \pkg{setspace} also needs a workaround, because it redefines |
| 510 |
% \cs{@footnotemark} without respect of other definitions. So we use out |
| 511 |
% definition instead and add a \texttt{footnote/text/begin} do-hook. |
| 512 |
% \begin{macrocode} |
| 513 |
\BeforePackage{setspace}{% |
| 514 |
\let\@footnotetext\scr@saved@footnotetext |
| 515 |
} |
| 516 |
\AfterPackage{setspace}{% |
| 517 |
\let\scr@saved@footnotetext\@footnotetext |
| 518 |
\renewcommand{\@footnotetext}[1]{% |
| 519 |
\scr@saved@footnotetext{#1}% |
| 520 |
\csname FN@mf@prepare\endcsname |
| 521 |
}% |
| 522 |
} |
| 523 |
% \end{macrocode} |
| 524 |
% \end{macro}^^A \scr@saved@footnotetext |
| 525 |
% \end{macro}^^A \@footnotetext |
| 526 |
% \end{command}^^A \deffootnotemark |
| 527 |
% |
| 528 |
% \begin{command}{\multiplefootnoteseparator} |
| 529 |
% \changes{v2.98c}{2008/02/01}{added} |
| 530 |
% The multiple footnote separation marker with all formatting needed. |
| 531 |
% \begin{macrocode} |
| 532 |
\newcommand*{\multiplefootnoteseparator}{% |
| 533 |
\begingroup\let\thefootnotemark\multfootsep\@makefnmark\endgroup |
| 534 |
} |
| 535 |
% \end{macrocode} |
| 536 |
% \end{command} |
| 537 |
% |
| 538 |
% \begin{command}{\multfootsep} |
| 539 |
% \changes{v2.98c}{2008/02/01}{added} |
| 540 |
% The \pkg{footmisc} compatible separation without formatting. |
| 541 |
% \begin{macrocode} |
| 542 |
%<class>\newcommand*{\multfootsep}{,} |
| 543 |
%<package>\providecommand*{\multfootsep}{,} |
| 544 |
% \end{macrocode} |
| 545 |
% \end{command} |
| 546 |
% |
| 547 |
% \begin{command}{\multiplefootnotemarker} |
| 548 |
% \changes{v2.98c}{2008/02/01}{added} |
| 549 |
% \changes{v3.19}{2015/08/24}{\pkg*{scrextend} uses \cs{providecommand}} |
| 550 |
% The kerning of the marker also \pkg{footmisc} compatible. |
| 551 |
% \begin{macrocode} |
| 552 |
%<class>\newcommand*{\multiplefootnotemarker}{3sp} |
| 553 |
%<package>\providecommand*{\multiplefootnotemarker}{3sp} |
| 554 |
% \end{macrocode} |
| 555 |
% \end{command} |
| 556 |
% |
| 557 |
% \begin{command}{\thefootnotemark} |
| 558 |
% \changes{v2.4l}{1997/02/06}{added} |
| 559 |
% User level command using \cs{@thefnmark}. |
| 560 |
% \begin{macrocode} |
| 561 |
%<class>\newcommand*{\thefootnotemark}{\@thefnmark} |
| 562 |
%<package>\providecommand*{\thefootnotemark}{\@thefnmark} |
| 563 |
% \end{macrocode} |
| 564 |
% \end{command} |
| 565 |
% |
| 566 |
% \changes{v2.4l}{1997/02/06}{initialization using \cs{deffootnotemark}} |
| 567 |
% \begin{macro}{\@makefnmark} |
| 568 |
% \changes{v3.10}{2011/09/27}{\pkg*{scrextend} redefines \cs{@makefnmark} |
| 569 |
% to use \cs{thefootnotemark}} |
| 570 |
% \changes{v3.39}{2025/11/26}{first try \pkg{xpatch}} |
| 571 |
% \begin{macrocode} |
| 572 |
%<*class> |
| 573 |
\deffootnote[1em]{1.5em}{1em}{\textsuperscript{\thefootnotemark}} |
| 574 |
%</class> |
| 575 |
%<*package> |
| 576 |
\def\reserved@a{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} |
| 577 |
\ifx\reserved@a\@makefnmark |
| 578 |
%</package> |
| 579 |
\deffootnotemark{\textsuperscript{\thefootnotemark}} |
| 580 |
%<*package> |
| 581 |
\else |
| 582 |
\IfFileExists{xpatch.\@pkgextension}{% |
| 583 |
\PackageInfo{scrextend}{% |
| 584 |
unexpected definition of `\string\@makefnmark'.\MessageBreak |
| 585 |
Trying to patch it% |
| 586 |
}% |
| 587 |
\RequirePackage{xpatch}% |
| 588 |
\xpatchcmd{\@makefnmark}{\@thefnmark}{\thefootnotemark}{% |
| 589 |
\PackageInfo{scrextend}{patch seems to be successfull}% |
| 590 |
}{% |
| 591 |
\PackageWarning{scrextend}{% |
| 592 |
patching `\string\@makefnmark' failed.\MessageBreak |
| 593 |
Using hard coded redefinition% |
| 594 |
}% |
| 595 |
\deffootnotemark{\textsuperscript{\thefootnotemark}}% |
| 596 |
}% |
| 597 |
}{% |
| 598 |
\IfFileExists{etoolbox.\@pkgextension}{% |
| 599 |
\PackageInfo{scrextend}{% |
| 600 |
unexpected definition of `\string\@makefnmark'.\MessageBreak |
| 601 |
Trying to patch it% |
| 602 |
}% |
| 603 |
\RequirePackage{etoolbox}% |
| 604 |
\patchcmd{\@makefnmark}{\@thefnmark}{\thefootnotemark}{% |
| 605 |
\PackageInfo{scrextend}{patch seems to be successfull}% |
| 606 |
}{% |
| 607 |
\PackageWarning{scrextend}{% |
| 608 |
patching `\string\@makefnmark' failed.\MessageBreak |
| 609 |
Using hard coded redefinition% |
| 610 |
}% |
| 611 |
\deffootnotemark{\textsuperscript{\thefootnotemark}}% |
| 612 |
}% |
| 613 |
}{% |
| 614 |
\PackageWarning{scrextend}{% |
| 615 |
unexpected definition of `\string\@makefnmark'.\MessageBreak |
| 616 |
Using hard coded redefintion% |
| 617 |
}% |
| 618 |
\deffootnotemark{\textsuperscript{\thefootnotemark}}% |
| 619 |
}% |
| 620 |
}% |
| 621 |
\fi |
| 622 |
%</package> |
| 623 |
% \end{macrocode} |
| 624 |
% \end{macro} |
| 625 |
% |
| 626 |
% \subsection{Referencing footnote labels} |
| 627 |
% |
| 628 |
% \begin{command}{\footref} |
| 629 |
% \changes{v2.98c}{2008/02/01}{added} |
| 630 |
% \changes{v3.33}{2021/02/24}{using \cs{providecommand} because of |
| 631 |
% \LaTeX{} 2021-05-01} |
| 632 |
% \KOMAScript{} 3 provides this command for more more than 13 longer than |
| 633 |
% the \LaTeX{} kernel. It is compatible with \pkg{footmisc} but has also been |
| 634 |
% published for free in the Usenet. |
| 635 |
% \begin{macrocode} |
| 636 |
\providecommand*{\footref}[1]{% |
| 637 |
\begingroup |
| 638 |
\unrestored@protected@xdef\@thefnmark{\ref{#1}}% |
| 639 |
\endgroup |
| 640 |
\@footnotemark |
| 641 |
} |
| 642 |
%</body> |
| 643 |
% \end{macrocode} |
| 644 |
% \end{command} |
| 645 |
% |
| 646 |
% |
| 647 |
% \Finale |
| 648 |
% \PrintChanges |
| 649 |
% |
| 650 |
\endinput |
| 651 |
% Local Variables: |
| 652 |
% mode: doctex |
| 653 |
% ispell-local-dictionary: "en_US" |
| 654 |
% eval: (flyspell-mode 1) |
| 655 |
% TeX-master: t |
| 656 |
% TeX-engine: luatex-dev |
| 657 |
% 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")) |
| 658 |
% End: |