Text\footnote{text1} Text\footnote{text2}

\item X\footnotemark{}
\item Y\footnotemark{}
\item Z\footnotemark{}


Text^1 Text^2

* X^3
* Y^4
* Z^5

1 text1
2 text2
5 a
5 b
5 c

How to recover \footnotetext numbering without manual numbering?

I assume, I know that I used \footnotemark n times, so I would like solution like (It is "pseudocode" of draft of an idea) :

\newcounter{tempcounter := footnotecounter - n}
\footnotetext[ ++tempcounter ]{a}
\footnotetext[ ++tempcounter ]{b}
\footnotetext[ ++tempcounter ]{c}

Or other authomatic numbering solution. I don't want to manually correct this list each time I change footnotes in chapter.

P.S. I know putting list into vbox might look strange, please assume it's just a toy-example of environment that needs usage of \footnotemark+\footnotetext.



Text\footnote{text1} Text\footnote{text2}

 \item X\footnotemark{} \item Y\footnotemark{} \item Z\footnotemark{} 

 \addtocounter{footnote}{-3} %3=n

enter image description here

  • 1
    one might approach automating this by keeping a temporary counter, setting it to zero at the beginning of the list, and decrementing it by one each time an applicable \footnotemark is issued. – barbara beeton Feb 7 '12 at 15:13
  • 5
    @barbara: Yes a lot of additional automating is possible. But the question explicitly said "I assume, I know that I used \footnotemark{} n times" and asked for answers using this "n". Also I think that as to much code in a question can hide the core of a problem, to much code in a answer can hide the core of a solution. – Ulrike Fischer Feb 7 '12 at 15:23
  • 1
    Great balance between simplicity of answer and clear of solution. You addressed precisely to problem specification. – Grzegorz Wierzowiecki Feb 7 '12 at 20:40

An alternative would be to fix the environment to not need this, and lift the footnotes out of the environment so manual correction isn't needed. tabularx for example does


at the start of the environment and


at the end, where \TX@ftntext is

% \begin{macro}{\TX@ftntext}
% \begin{macro}{\TX@xftntext}
% Inside the alignment just save up the footnote text in a token
% register.
%    \begin{macrocode}
                    [\the\csname c@\@mpfn\endcsname]}%
%    \end{macrocode}
% \end{macro}
% \end{macro}

So putting it all into your example:

                    [\the\csname c@\@mpfn\endcsname]}%
     \csname c@\@mpfn\endcsname #1\relax


Text\footnote{text1} Text\footnote{text2}


\item X\footnote{a}
\item Y\footnote{b}
\item Z\footnote{c}
\item W fff\footnote[42]{kkk}

  • Great answer, I'd love to select as solution but Ulrike addressed problem specification perfectly. Even thou, your solution is very educative in long term. Could you, please, write in comments above in high level way how pushftn and popftn works ? I'd love to learn latex programming. – Grzegorz Wierzowiecki Feb 7 '12 at 20:44
  • 1
    To see what it is doing, easiest is to comment out the \makeatother so you can use commands with @ in their names, then add \showthe\FTN@ftn just before the \popftn TeX will then stop as for an error message and show you the contents of that register, which you will see is a collection of saved up \footnotetext commands to be executed outside the box. the rest of the code just locally redefines the footnote commands to save their arguments in this register instead of executing them directly. (This is no doubt what the package in the other abswer is doing as well) – David Carlisle Feb 7 '12 at 21:01
  • It works great. The beauty of your solution is that is has no dependencies, so it works everywhere I check just "out-of-the-box". – Grzegorz Wierzowiecki Feb 8 '12 at 14:28
  • Could you help me in applying youtr solution to centered tabular tex.stackexchange.com/q/43839/7128 ? – Grzegorz Wierzowiecki Feb 8 '12 at 15:26
  • @DavidCarlisle Great approach! Do you have any idea why this does not work for the tufte-book document class? – Manuel Schmidt May 29 '20 at 18:04

For tables the tablefootnote package implements the automation asked for (and also takes care of hyperlinks, when the hyperref package is used). (Please see its manual.pdf.) For other environments, the package can be "abused" (see explanation at my answer to "Nested footnotes disrupts comma delineation of footnotes"). It saves the (table)footnote(text)s and issues it/them after the end of the table environment. When you use a vbox, it must be (manually) issued at its end, which \spewfootnotes does. Complete automation would redefine \vbox to include \spewfootnotes after the end of the box and redefine \footnote to be a \tablefootnote inside of a \vbox.


\usepackage{hyperref}% if you want/for demonstration of  hyperlinks


Text\footnote{text1} Text\footnote{text2}

\item X\tablefootnote{a}
\item Y\tablefootnote{b}
\item Z\tablefootnote{c}



Just to get another page to demonstrate the hyperlinks.

  • You answer sounds very helpful. I haven't knew about this package and it can be applied to other environments than table, with \spewfootnotes. It looks more comfortable than solution I asked for. – Grzegorz Wierzowiecki Feb 7 '12 at 20:46
  • How ever, I've found that package tablefootnote is not installed on workspaces I use. While at personal computer installation is not an issue, at work I change computers so I can not install package every time. So I will put tablefootnote for future, it looks nice, at this moment I nice more "portable" solution. – Grzegorz Wierzowiecki Feb 8 '12 at 14:27
  • @GrzegorzWierzowiecki: tablefootnote is in recent MiKTeX and TeXlive, but if the distribution is not updated (or another distribution is used), this does not help you, sorry. Maybe the people administrating the computers will update some day (but maybe they behave like so many other administrators and refuse to do any updates). – Stephen Feb 8 '12 at 18:17
  • As I said, It's good to know about tablefootnote. As It will be on all workspaces, I will switch to it :). – Grzegorz Wierzowiecki Feb 8 '12 at 18:36

Since Ulrike Fischer has provided a simple and clear solution, I try to improve her answer to automate the counting of \footnotemarks.

Just add these lines to the preamble:

% I put all the commands in one line to avoid generating extra space before the footnote superscript number.


(You can customise the new command names as you like.)

And use the \fnm(modified \footnotemark) and \fnt(modified \footnotetext) like this:



Text\footnote{text1} Text\footnote{text2}

 \item X\fnm \item Y\fnm \item Z\fnm 



The output will be the same with Ulrike Fischer's answer. As the result shows, the new commands are also compatible with \footnote{...}.

Ulrike Fischer's ouput

The only problem of both Fischer's and my solutions is that only the first one of the several continuous \footnotetexts can be correctly hyperlinked (via the hyperref package).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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