# Footnote marks always under the rule in koma script

I'm trying to modify the standard appearance of the footnote mark in the KOMA-Script class scrbook.

The behavior should be similar to the behavior in Microsoft Word. So the footnote numbers are left aligned under the horizontal rule. And with every next order of magnitude (I have footnote numbers going up to 2000) the box for the superscripted footnote mark is extended so that the numbers stay under the horizontal rule.

However, the below code doesn't look good as the space between the footnote mark and the following text varies. And my impression is that guessing the right ?em is the wrong way. Here I would like to have the koma standard behavior (koma script guide p. 91):

The first line of the footnote follows directly.

So now I'm looking for a way to have both the alignment from the koma class, but with footnote marks which stay under the horizontal rule. (One note: I think setting the mark width to the width of the greatest number looks odd for the smaller numbers. So this not an option.)

\documentclass{scrbook}

\deffootnote
[
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
]
{
\ifnum\the\value{footnote}<10
0.9em
\else
\ifnum\the\value{footnote}<100
1.3em
\else
\ifnum\the\value{footnote}<1000
1.7em
\else
2.1em
\fi
\fi
\fi
}
{1.0em}
{\makebox[
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
][l]{\textsuperscript{\thefootnotemark}}}

\begin{document}
Test1\footnote{Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1.}

\setcounter{footnote}{9}
Test10\footnote{Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. }

\setcounter{footnote}{99}
Test100\footnote{Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. }

\setcounter{footnote}{999}
Test1000\footnote{Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. }

\end{document}


Well, the correct definition in KOMA-Script for the footnote in your case is

\deffootnote{fnmarkA}{fnmarkB}{\makebox[fnmarkA][l]{\textsuperscript{\thefootnotemark}}}%


\deffootnote{%
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
}
{
\ifnum\the\value{footnote}<10
0.9em
\else
\ifnum\the\value{footnote}<100
1.3em
\else
\ifnum\the\value{footnote}<1000
1.7em
\else
2.1em
\fi
\fi
\fi
}
{\makebox[
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
][l]{\textsuperscript{\thefootnotemark}}}


With the following MWE

\documentclass{scrbook}

%\deffootnote{fnmarkA}{fnmarkB}{\makebox[fnmarkA][l]{\textsuperscript{\thefootnotemark}}}%
\deffootnote{%
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
}
{
\ifnum\the\value{footnote}<10
0.9em
\else
\ifnum\the\value{footnote}<100
1.3em
\else
\ifnum\the\value{footnote}<1000
1.7em
\else
2.1em
\fi
\fi
\fi
}
{\makebox[
\ifnum\the\value{footnote}<10
0.4em
\else
\ifnum\the\value{footnote}<100
0.8em
\else
\ifnum\the\value{footnote}<1000
1.2em
\else
1.6em
\fi
\fi
\fi
][l]{\textsuperscript{\thefootnotemark}}}

\begin{document}
Test1\footnote{Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1. Footnote Test 1.}

\setcounter{footnote}{9}
Test10\footnote{Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. Footnote Test 10. }

\setcounter{footnote}{99}
Test100\footnote{Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. Footnote Test 100. }

\setcounter{footnote}{999}
Test1000\footnote{Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. Footnote Test 1000. }

\end{document}


you get

BTW: I personaly would use more space between number and footnote text ... If you are writing in German do not superscript the footenote number ...

You mentioned:

And my impression is that guessing the right ?em is the wrong way

Well, it is the only way to get what you want, it depends on the used font and the space you want to have between footnote number anf text ...

• Thank you for the correct definition, I've overlooked it. I was thinking of a way to calculate the box width based on the widest number of a magnitude category like \makebox[\calculatewidth{8}] or something similar. As the text will indeed be in German I'm curious if there is an official guideline you know why I should not superscript the footnote number in the footnote (by default koma script uses superscript numbers) . Dec 19 '18 at 7:33
• It's not just German. Superior numbers are useful in the text itself, by making the footnote signal inconspicuous; but they serve no such purpose in the notes themselves, where the reader would rather prefer them to be easy to locate. So typographers (eg Robert Bringhurst) often recommend ordinary sized numbers, hung left. They also generally prefer to avoid rules, except for continuation notes. In this as in so much, Word does not represent sound typographic design. But it's up to you! Dec 19 '18 at 7:49