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}