Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
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.

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted


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

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

 \addtocounter{footnote}{-3} %3=n
share|improve this answer
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
@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
Great balance between simplicity of answer and clear of solution. You addressed precisely to problem specification. –  Grzegorz Wierzowiecki Feb 7 '12 at 20:40
add comment

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}

share|improve this answer
This doesn't really address the \foonote[42]{Text} case. –  egreg Feb 7 '12 at 15:33
@egreg so it doesn't. I updated the answer to fix this, thanks –  David Carlisle Feb 7 '12 at 16:29
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
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
show 1 more comment

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.

share|improve this answer
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
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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