# two- and three-digit footnote numbers ragged right

here is a publisher’s request I wasn’t able to fulfill... Footnote numbers are supposed to be ragged right in line with the left margin. After every number a skip of »--« (\enskip ?). Here is a try that looks good for one digit (but still isn’t correct) but is wrong for two and three digits.

\documentclass[english,showframe]{scrbook}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{geometry}

\deffootnote[0.5em]{0em}{1em}{\raggedright{\textsuperscript{\thefootnotemark}}}

\usepackage{blindtext}
\begin{document}

\part{First Part}
Some text.\footnote{Text.}

\chapter{First Chapter}
\blindtext \footnote{\blindtext}
\setcounter{footnote}{10}
\footnote{Test}
\setcounter{footnote}{100}
\footnote{Test}

\end{document}

• In your title you say ragged left but in your question you say ragged right. Which is it? – Peter Wilson Jul 11 '18 at 17:19
• I mean ragged right for the numbers. Sorry, that was a confusion because of the German »linksbündig«. Edited the question – Alex Jul 15 '18 at 13:34
• So the indent from the left margin to the start of the note text needs to vary? If so, I think you will need to redefine KOMA's creation of footnotes and not just customise the marker. – cfr Jul 15 '18 at 18:29
• Could you confirm that the text is being typeset in lmodern's defaults? If so, you might be able to do something tricky to get the desired effect. (Note that this means you are not using cfr-lm's defaults or, for that matter, another set of fonts entirely.) – cfr Jul 15 '18 at 18:31
• But it is probably easier to just redefine \footnote .... – cfr Jul 15 '18 at 18:48

I don't guarantee this at all. It survives extremely minimal testing i.e. your example seems to work, if I've understood your desiderata.

# Caveat emptor

\documentclass[british,showframe]{scrbook}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{geometry}

\usepackage{blindtext}
\makeatletter
\renewcommand\deffootnote[4][]{%
\long\def\@makefntext##1{%
\raggedfootnote
\leftskip #2
}%
\parindent #3 \noindent
\ftn@font{\@@makefnmark##1}%
}%
\def\@@makefnmark{%
\ftnm@font{#4}%
\IfArgIsEmpty{#1}{}{%
\hskip \dimexpr #1-#2\relax
}%
}%
}
\makeatother
\deffootnote[.5em]{0em}{1em}{\raggedright{\textsuperscript{\thefootnotemark}}}

\begin{document}

\part{First Part}
Some text.\footnote{Text.}

\chapter{First Chapter}
\blindtext \footnote{\blindtext}
\setcounter{footnote}{10}
\footnote{Test}
\setcounter{footnote}{100}
\footnote{Test}

\end{document}