[Tex/LaTex] How to insert an extra footnote without changing the previous numbering

footnotesnumbering

LaTeX is very good in adjusting the numbering — and more importantly the references to it — when inserting new chapters, sections, etc.

Legal documents (and books), at least here in Germany, tend to insert these things by keeping the previous numbering intact, but using the number before the insertion followed by a small letter (a, b, c, …), to indicate that something has changed (either at the last minute, or — which is the really important case — from a previous edition).

Since I thought it rare that there would be more than one additional consecutive footnote, I tried the following (incredibly crude and dirty) hack, shown in the MWE:

\documentclass{article}
\newcommand{\myextrafootnote}[1]{\renewcommand{\thefootnote}{\arabic{footnote}a}\footnote[\thefootnote]{#1}\renewcommand{\thefootnote}{\arabic{footnote}}}%
\begin{document}
This is the old text\footnote{foo}, followed by the new insert\myextrafootnote{New Exciting Stuff!!}, followed by the old next one.\footnote{bar}
\end{document}

Sadly, it doesn't work as I had hoped. While the footnotes themselves look as they should:
Footnotes, with a bit of extra in between

the text gets the additional a also added just before the footnotemark: as shown here:
text, with more extra than is actually wanted

Ideally, of course, the a would also come from some form of counter (I tried that too, but it turned into lots of error messages about missing arguments, so I abandoned it and decided to better ask the experts…) so if there were more than one additional consecutive added footnote, it would still work correctly [and be less crude than it is now].

Best Answer

The optional argument of the \footnote command expects an integer containing the number of the footnote, not the textual representation of that number. So, you should use

\footnote[\value{footnote}]{#1}

instead of

\footnote[\thefootnote]{#1}

Addition

So, where does the extra “a” come from? To understand this, let us examine step by step how the erroneous code

\footnote[\thefootnote]{#1}

is digested by TeX. The macro \thefootnote expands (in the context in which the OP used it) to 1a, so (La)TeX sees the equivalent of

\footnote[1a]{...}

But, as already said, it expects the optional argument to contain an integer value; this integer value is locally assigned to a dedicated counter (either footnote or mpfootnote, depending on the context) inside the \@xfootnote internal command. The code for this assignment is (equivalent to)

<counter> = #1\relax

that, in our case, becomes

<counter> = 1a\relax

But the a terminates the integer constant 1, and therefore also the assignment; at this point, the a token is interpreted as a command to typeset an “a” character in horizontal (i.e., the current) mode. And here we are.