I am in the position of needing footnotes for my document. I found that the syntax is:

Something pretty complicated\footnote{This complicated thing needs details.}

This will make my source hard to read so I have to ask you guys: is there any method to work like this?

Something pretty compLicated\footnote{ref:1}

\footnote{1}{This complicated thing needs details.}

If you are using plain TeX then you can try this:

\input opmac

   \expandafter\ifx\csname fn:#1\endcsname\relax Footnote not declared yet.%
   \else \csname fn:#1\endcsname\fi}}


Something pretty complicated\fnote{ref:1}

% at the end of the document (or somewhere else):
\fnotedef{ref:1}{This complicated thing needs details.}


If you are using different TeX macro (for example LaTeX) then you can find only the inspiration here. The \fnotedef macro saves the information to the working file (aux, ref etc.) in the format:


When the document is processed again, then this file is read and \sdef macro defines \fn:ref:1 as text. So, the \fnote macro can execute the original \fnote where the \fn:ref:1 is expanded.


Something like this, that uses the .aux file for saving the footnotes. I don't think it's a real advancement in readability.


    \@latex@warning@no@line{Footnotes have changed, rerun LaTeX}%



\textheight=4cm % just for the example


Something pretty complicated\footnote{ref:1}

\savefootnote{ref:1}{This complicated thing needs details.}

Whatever\footnote{ref:what} and another\footnote{ouch}



enter image description here

A check for duplicate keys can be added. For the moment, just a warning the footnotes have changed is issued, if it's the case.

Not the answer you're looking for? Browse other questions tagged or ask your own question.