# Why does the first footnote display as the second?

I'm writing in the Springer LNCS format, and I added a footnote to the caption of a figure:

\documentclass[runningheads]{llncs}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{appendix}

\begin{document}
\title{TITLE}
\author{AUTHOR}
\institute{INSTITUTE} \\
\maketitle
\begin{figure}
\includegraphics[width=\textwidth]{Beta.eps}
\caption{When $m=k=6$, and $500$ samples of $\mathbf{X}$ are generated from the bimodal distribution, $Beta(0.5,0.5)$, $\mathcal{L}_{co}$ fluctuates so drastically that in about half of the $20$ simulations, the MDL approach would miss the causality between $\mathbf{X}$ and $Y$ and leads to the wrong conclusion. $(\mathbf{X},Y)$ purely confounded by $Beta$ sources, on the other hand, work well with the CoCa model.\footnotemark}
\label{Fig.2}
\end{figure}
\footnotetext{https://github.com/PawinData/CoCa}
\end{document}


It's the only footnote in the article, yet somehow it displays as the 2nd in the pdf output. Why is that? How can I fix it?

Problem solved by @UlrikeFischer

• Use \caption[abcdefg]{abcdefg\footnotemark} to avoid that the mark wanders in the listoffigures. – Ulrike Fischer Feb 3 at 9:11
• Sorry, it doesn't work.@UlrikeFischer – Paw in Data Feb 3 at 15:25
• My comment wasn't meant as a solution, you should generally use this syntax. I can't offer an advice for your problem as you didn't provide a complete example that would allow to reproduce it. – Ulrike Fischer Feb 3 at 15:28
• @UlrikeFischer You're right. I just editted the post and provide a MWE. Sorry for the trouble. – Paw in Data Feb 3 at 15:45
• The class processes the caption twice if it is longer than one line. You will have to reset the number before the caption (\addtocounter{footnote}{-1}) – Ulrike Fischer Feb 3 at 15:52

Since you provide only code fragment, we haven't information about your document (in form of small complete document, which reproduce your problem) and consequently we are not able to test it and see what can be a problem.

However, your code fragment has some issues:

• label of figure had to be after \caption{...}
• \footnotemark had to be "protected": \caption{abcdefg\protect\footnotemark}

Edit (1): Considering aforementioned the MWE (Minimal Working Example) can and llncs document class is:

\documentclass[runningheads]{llncs}
\usepackage[demo]{graphicx} % in real document remove option "demo"

\usepackage{lipsum}
\begin{document}
\lipsum[1-3]
\begin{figure}[ht]
\includegraphics[width=\textwidth]{Beta.eps}
\caption{abcdefg\protect\footnotemark}  % <---
\label{Fig.2}                           % <---
\end{figure}
\footnotetext{https://github/com}
\end{document}


which (still) gives correct result:

Edit 2 Apparently you have between footnotemark in caption and \footnotetext one more \footnotemark (or \footnote), which cause your problem. It can be eliminated by inserting \footnotetext immediately after figure before the next \footnotemark (or \footnote} in text.

• Thank you, Zarko! Your codes did work. I applied the two corrections as you suggested, and the problem was still there. The only difference is \documentclass[runningheads]{llncs}, I think. Does it matter that I use the Springer LNCS format? – Paw in Data Feb 3 at 14:54
• @PawinData, so far you not inform us anything about your document. Some document classes heavily interfere with default features of article class. I will look, what is going on with use of the your document class (I'm afraid that I need to install it first. – Zarko Feb 3 at 15:03
• Sorry, I mentioned in the message but didn't include in the code chunk. I'll put up a MWE here. – Paw in Data Feb 3 at 15:31
• @PawinData, also with using llncs document document class I get correct result. This means, that in your document you have after figure one more \footnotemark or \footnote in text before \footnotetext. This cause a mess in \footnotetext numbering. – Zarko Feb 3 at 16:02

The class defines its own caption processing mechanism. Here's the part that sets the actual caption:

\long\def\@makecaption#1#2{%
\small
\vskip\abovecaptionskip
\sbox\@tempboxa{{\bfseries #1.} #2}%
\ifdim \wd\@tempboxa >\hsize
{\bfseries #1.} #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}


It sets the caption in a box via

\sbox\@tempboxa{{\bfseries #1.} #2}%


and then measures whether this box is wider than the current allowable box width. If this holds true, it's reset to allow for appropriate line-breaking. This dual setting increments whichever counter is used within the mandatory argument of \caption[<ToC>]{<main>}. You'll notice this in the following minimal example:

\documentclass{llncs}

\begin{document}

\begin{figure}
\caption[short caption]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnotemark\space
%Nunc id nulla at dui facilisis pharetra non scelerisque mi.% <- Uncomment
}
\end{figure}

\footnotetext{https://github.com/PawinData/CoCa}
\end{document}


If you add the second line of the \caption it spans wider than \textwidth, is processed twice and therefore footnote is incremented twice. A clean and convenient way to counter this is to step the footnote counter within the figure environment and use a fixed \footnotemark[<mark>]:

\documentclass{llncs}

\begin{document}

\begin{figure}
\stepcounter{footnote}% Increment footnote counter
\caption[short caption]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnotemark[\thefootnote]\space
%Nunc id nulla at dui facilisis pharetra non scelerisque mi.
}
\end{figure}

\footnotetext{https://github.com/PawinData/CoCa}
\end{document}