6

If I write a footnote as follows:

abc\footnote{XYZ}

it doesn't leave a space after abc, which is ok. If I write as follows, with the hope of tidying up the source:

abc
\footnote{XYZ}

it leaves a space after abc.

Because footnotes are structurally separate from the text, it would be nice if I could keep them on their own lines in the source file, while preventing the space.

What is the best practice of source editing in this and similar cases?

2 Answers2

4

For short notes, you can do this:

This is body text.%
  \footnote{This is footnote.}

For longer notes, you can use the semantic-markup package, which provides a Footnote environment:

This is body text.%
  \begin{Footnote}
  This is a long footnote.
  See how many sentences there are.
  \end{Footnote}

In either case, you have to "escape" the end-of-line character by putting a % at the end of the line before the footnote.

musarithmia
  • 12,463
  • 1
    Full disclosure: I am the package author. – musarithmia Sep 14 '16 at 17:47
  • 1
    For what it's worth, if you write in TEI XML you still have the same problem with space before a footnote: You have to write <p>Body text<note>Footnote text</note></p> if you don't want a space. Or you can do exactly the same as in LaTeX and escape the end-of-line by using half of a comment tag <!-- at the end of one line and the other half before the note --><note> You can probably get around this with XSLT, just like you could try using \unskip with TeX footnotes. – musarithmia Sep 14 '16 at 18:46
0

A convenient solution that works without additional packages is to use the \footnotemark and \footnotetext commands instead of \footnote:

Lorem ipsum \footnotemark dolor sit amet.
\footnotetext{Here goes the text}