TL;DR: Is there a package that allows writing the text of a footnote after the position where the mark should be inserted? Note that I'm asking about positioning of source code, not about positioning of the note in the output document.
When writing LaTeX I find the inline character of footnote source somewhat distracting.
This is some text\footnote{That for
whatever reason contains a long
footnote. The main text becomes split
apart} so far that it is barely readable.
Doing tricks with newlines like
This is some text\footnote{
That for whatever reason contains a long
footnote. The main text becomes split
apart}
so far that it is barely readable.
Also helps only so much. I'd much prefer to write
This is some text\fn{1} that contains a
couple\fn{2} footnotes yet remain readable.
\text{1}{Here is the text of the first
footnote, conveniently readable while reading
the main source, yet not disrupting it.}
\text{2}{-/2}
I know that some tricks are possible with
\footnotemark
and \footnotetext
. When having
more than one footnote in a paragraph however this
would require manually changing the footnote
counter, which is too inconvenient to make this a
sensible alternative. Also if I'm not mistaken, it
carries the risk of causing footnotes to be
displayed on the wrong page, when the paragraph
stretches to the next page but the \footnotemark
is in text on the current page.
+---------------+ +---------------+
|... | |end of the page|
| | |... |
| | | |
|some text with²| |————— |
|footnote on the| |²The FNText |
+---------------+ +---------------+
Is there maybe some package that automates such a style?
As a quick hack I sometimes used constructs like
\def\fnlater#1#2{\def#1{\footnote{#2}}}
...
\fnlater\myfnI{The footnote text must be
defined before the paragraph.}
...
Here is some textparagraph\myfnI that refers
to the previously defined footnote.
Sadly this custom solution has two major flaws:
It requires defining the footnote before using it, while intuitively footnotes are expected after the surrounding text.
It should cause a compilation error, when the footnote is accidentially used twice.
It should also cause a compilation error, when the footnote isn't used at all.
Since I don't think that these issues are easily fixed, especially the requirement to define the footnote before the surrounding text, using custom hacks is undesireable.
If such a package exists for LaTeX, availability of a corresponding module for LyX would be even better.
As a minimal compileable example put any of these code examples into a skeleton
\documentclass{article}
\begin{document}
...
\end{document}
foot 1
. I assume you're asking whether an additional package that does this sort of magic should be used by a LyX module rather than the default footnote module.