[Tex/LaTex] Align the footnote markers to the right in footnotes

footnotes

my footnotes are justified hanging footnotes that work well, but I would like a bit more:

since the footnote number takes a variable space, depending on whether it is a one-digit or two-digit number, I would like to have the footnote number flushed right inside its own "space", i.e. still indented 8pt, but footnote numbers will "grow" flushed right, so keeping a constant separation from the first letter of the footnote text.

Code example:

\documentclass[10pt,english]{book}
\usepackage{charter}
\usepackage{babel}
\usepackage[unicode=true] {hyperref}

\usepackage[bottom,hang]{footmisc}
\setlength\footnotemargin{8pt}
\setlength{\footnotesep}{10pt}
\setlength{\skip\footins}{7mm}
\interfootnotelinepenalty=10000

\begin{document}

Footnotes with flush align left of their footnote marks\footnote{first footnote}.
But I want them aligned right on their marks\footnote{second footnote .... OOO}
Simple sentences talking about attenuators and\footnote{Available somewhere}
bearing a lot of footnotes\footnote{yet another footnote}
bla bla bla bla bla bla\footnote{it's getting boring}
attenuator is useful\footnote{yes, right}
attenuator is beautiful\footnote{oh, yeah ...} and
bla bla bla\footnote{we are almost there} bla bla bla bla
and is also cheap\footnote{not all of them}.
But I want to save money\footnote{Who does not??}
and I will build one... or two\footnote{here we are}.
That's it\footnote{last footnote}, now we have more than 10 footontes!

\end{document}

Best Answer

I am not sure if this is quite what you want but perhaps it is close. You can redefine \thefootnote so that it is within its' own little box and push the number to the righthand side using:

\renewcommand\thefootnote{\hbox to 6pt{\hss\arabic{footnote}}}

This now gives footnotes like this:

enter image description here

Here is the full code:

\documentclass[10pt,english]{book}
\usepackage{charter}
\usepackage{babel}
\usepackage[unicode=true] {hyperref}

\usepackage[bottom,hang]{footmisc}
\setlength\footnotemargin{8pt}
\setlength{\footnotesep}{10pt}
\setlength{\skip\footins}{7mm}
\interfootnotelinepenalty=10000
\renewcommand\thefootnote{\hbox to 6pt{\hss\arabic{footnote}}}

\begin{document}

Footnotes with flush align left of their footnote marks\footnote{first footnote}.
But I want them aligned right on their marks\footnote{second footnote .... OOO}
Simple sentences talking about attenuators and\footnote{Available somewhere}
bearing a lot of footnotes\footnote{yet another footnote}
bla bla bla bla bla bla\footnote{it's getting boring}
attenuator is useful\footnote{yes, right}
attenuator is beautiful\footnote{oh, yeah ...} and
bla bla bla\footnote{we are almost there} bla bla bla bla
and is also cheap\footnote{not all of them}.
But I want to save money\footnote{Who does not??}
and I will build one... or two\footnote{here we are}.
That's it\footnote{last footnote}, now we have more than 10 footontes!

\end{document}
Related Question