2

I have started to use semantic linefeeds for the purposes of version control, as suggested by e.g. Brandon Rhodes, which I found through the answer: How to format source to take advantage of VCS?

It seems quite reasonable to put footnotes on their own line, but this inserts an ugly space before the footnote mark. Can this be dealt with in any easy fashion?

MWE:

\documentclass{article}

\begin{document}

This is how footnotes should work.\footnote{My mark is stuck where it should be!}

Attempting semantic linefeeds,
the footnotes seem to float away. 
\footnote{Can anyone make my mark stick to the previous character?}

\end{document}

This seems to ask something similar, but has not been answered: How to ignore spaces before footnotes

5
  • 5
    \usepackage{xpatch} and \xpretocmd{\footnote}{\unskip}{}{}
    – egreg
    May 24 '16 at 9:03
  • @egreg That works perfectly!
    – trmdttr
    May 24 '16 at 9:06
  • Can you add that as an answer, @egreg? Or are you hoping someone ”golfs” it even further? ;)
    – trmdttr
    May 24 '16 at 9:32
  • 1
    add % at the end of the sentence before the the footnote
    – Guido
    May 24 '16 at 11:01
  • 1
    @trmdttr I asked for an answer to the previous question; now this can be closed as duplicate.
    – egreg
    May 24 '16 at 11:36