Begin footnoterule above footnote text, not aligned with main text body

footnoteskoma-scriptrules

The footnoterule should follow the same left margin as the footnotetext, not the same margin as the main body.
Here, it should start above the “T” in the footnote, not above the footnote mark “1”.

\documentclass{scrartcl}
\usepackage{lipsum}
\deffootnote{2em}{1em}{\thefootnotemark\hskip 1.5em}

\begin{document}
\lipsum[1-4]%
\footnote{This is a footnote.}
\lipsum[5]
\end{document}

I tried adding an \hspace or a \leftmargin in the command \setfootnoterule integrated in the scrartcl class, but the command is clearly not meant for this and it didn’t work.

I saw the answers to these two questions, but they’re very old, I couldn’t adapt them properly and I was hoping there might be a new, more intuitive approach to this:
move \footnoterule to right,
Add indent to \footnoterule.

The decision to move the footnoterule is not mine.

I kept the definition of the footnotemark, because it is supposed to be like that in the final document (not my decision either) and with the distance between the footnote mark and the footnote text, moving the footnoterule doesn’t look quite as odd.

The koma-script tag is added, because I’m not sure a solution for the article class would also work in the scrartcl class.

Best Answer

The only solution I found requires some low-level tinkering. Add the following lines to the preamble.

\usepackage{xpatch}
\makeatletter
\xpatchcmd\footnoterule{%
  \hrule\@height\ftn@rule@height\@width\ftn@rule@width
}{%
  \moveright0.9em\vbox{\hrule\@height\ftn@rule@height\@width\ftn@rule@width}% Modify 0.9em to change indentation
}{}{}
\makeatother

enter image description here

\documentclass{scrartcl}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\footnoterule{%
  \hrule\@height\ftn@rule@height\@width\ftn@rule@width
}{%
  \moveright0.9em\vbox{\hrule\@height\ftn@rule@height\@width\ftn@rule@width}%
}{}{}
\makeatother
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]%
\footnote{This is a footnote.}
\lipsum[5]
\end{document}
Related Question