problem with length macros in `\deffootnote`
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
[v3.49.2]
Consider the following example code
\documentclass{scrartcl}
\newlength{\X}
\setlength{\X}{1em}
\deffootnote[1em]{1em}{1em}{%
\textsuperscript{\thefootnotemark}~%
}
\def\Y{Bla bla bla bla bla bla bla bla}
\textheight 20ex
\textwidth 10em
\begin{document}
\framebox[1em]{X}
\framebox[\X]{X}
This is a test\footnote{\Y}.
\end{document}
As can be seen, it doesn't matter whether I use 1em or \X in the optional argument of the \framebox macro.
Image koma-script-length.png shows how this renders with pdflatex.
If I now replace the line
\deffootnote[1em]{1em}{1em}{%
with
\deffootnote[\X]{1em}{1em}{%
I get a different result, which is completely unexpected – the length is larger; see image koma-script-macro.png.
Maybe there is somewhere a line end in the code not being properly protected with %?
BTW, a similar effect happens if I replace
1emwith\Xin the first mandatory argument of\deffootnote.When LaTeX runs
\@makefntextthe font size is already\footnotesize. Length\Xis set to 1em in the font size of the active font at\setlength{\X}{1em}time not at usage of\X. So you would need to compare:or:
Last edit: Markus Kohm 2026-09-01
Length are not macros.
Works as expected.
Ah, silly me, I forgot that 'em' is a relative size. Thanks for the explanation, and sorry for the noise.