0

I'm trying to modify the code of Andrew's answer here, which implements a solution to get a hanging footnotes where the indent of the text increases with the footnotemarker.

What I am trying to change in the code is to print the footnote marker in normal font instead of superscript (while at the same time not breaking anything else):

% !TEX TS-program = xelatexmk
\documentclass{report}
\usepackage{lipsum}
\usepackage{etoolbox}

\usepackage[bottom,hang,splitrule,multiple]{footmisc} % setspace must be loaded before
\setlength{\footnotemargin}{-0.5em}

\addtolength{\footskip}{2mm}
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{1em} % Between footnotes [= previous] % Was: \skip\footins
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1.5em}

% Patch to make hanging indent of footnotes dependent on width of footnotemarker
% From here: https://tex.stackexchange.com/questions/79039/extra-space-between-footnote-numbers-and-content-for-high-count
\makeatletter
\ifFN@para
\else
  \long\def\@makefntext#1{%
    \ifFN@hangfoot
      \bgroup%\def\@makefnmark{\rlap{\normalfont\@thefnmark}}
      \setbox\@tempboxa\hbox{%
        \ifdim\footnotemargin>0pt
          \hb@xt@\footnotemargin{\@makefnmark\hss}%
        \else
          \@makefnmark\hskip-\footnotemargin      %%Changed here
        \fi
      }%
      \leftmargin\wd\@tempboxa
      \rightmargin\z@
      \linewidth \columnwidth
      \advance \linewidth -\leftmargin
      \parshape \@ne \leftmargin \linewidth
      \footnotesize
      \@setpar{{\@@par}}%
      \leavevmode
      \llap{\box\@tempboxa}%
      \parskip\hangfootparskip\relax
      \parindent\hangfootparindent\relax
    \else
      \parindent1em
      \noindent
      \ifdim\footnotemargin>\z@
        \hb@xt@ \footnotemargin{\hss\@makefnmark}%
      \else
        \ifdim\footnotemargin=\z@
          \llap{\@makefnmark}%
        \else
          \llap{\hb@xt@ -\footnotemargin{\@makefnmark\hss}}%
        \fi
      \fi
    \fi
    \footnotelayout#1%
    \ifFN@hangfoot
      \par\egroup
    \fi
  }
\fi
\makeatother

\usepackage{hyperref}
\usepackage{footnotebackref} 

\begin{document}
Some text.\footnote{\lipsum[7-8]}
Some text.\footnote{Footnote text.}
Some text.\footnote{Footnote text.}
\setcounter{footnote}{1010}
Some text.\footnote{\lipsum[7]}
Some text. 
\end{document}

I've tried with \def\@makefnmark{\rlap{\normalfont\@thefnmark}} (see outcommented in MWE), but that clearly doesn't work. It breaks the flexible indent, and also the backreference provided by \footnotebackref.

More generally: Is footmisc the right way to go here? Or is there maybe a simpler solution with another package?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.