Skip to content

Instantly share code, notes, and snippets.

@AnthonyWharton
Created April 22, 2019 14:48
Show Gist options
  • Save AnthonyWharton/7510af4fb77e6f6d01ce388bcbdfaa00 to your computer and use it in GitHub Desktop.
Save AnthonyWharton/7510af4fb77e6f6d01ce388bcbdfaa00 to your computer and use it in GitHub Desktop.
Simple yet more useful footnotes in LaTeX
% Define macros to handle footnotes better
% Usage: \fnm will mark footnotes, and then \fnt{foobar} will populate footnote
% with "foobar".
% Note: \fnt{} order will evaluate in a 1-to-1 correspondence with ordering of
% \fnm usage.
% Credit: https://tex.stackexchange.com/a/437538/121389
\newcounter{footnotemarknum}
\newcommand{\fnm}{\addtocounter{footnotemarknum}{1}\footnotemark{}}
\newcommand{\fnt}[1]{
\addtocounter{footnote}{-\value{footnotemarknum}}
\addtocounter{footnote}{1}
\footnotetext{#1}
\setcounter{footnotemarknum}{0}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment