I have the following MWE:
\documentclass[a4paper,12pt, oneside, final, headsepline]{scrartcl}
\usepackage{endnotes}
\usepackage[perpage, multiple]{footmisc}
\renewcommand{\notesname}{Linkverzeichnis}
\usepackage{float}
\usepackage[bf]{caption}
\begin{document}
\section{Grundlagen}
Bla bla bla Link\endnote{url1}
\begin{figure}[h]
\centering
\caption[Short caption without endnote to avoid errors]{Blubber. (Quelle\endnote{url2})}
\end{figure}
Bla bla bla Link\endnote{url3}
\theendnotes
\end{document}
The result is:
Instead of the endnotes counting
1. url1
2. url2
3. url3
I get
1. url1
3. url2
4. url3
or alternatively:
1. url1
2. url2
3. url2
4. url3
In this case you can trigger the last one by commenting out the \usepackage[bf]{caption} line, but I get both in my text. I already figured out that this happens if there is an endnote inside a float, but I really don't know why.
How can I fix this?
Edit:
Based on the solution provided in the accepted answer, I built the following commands for future reuse:
\newcommand{\endnoteouter}[1]{\sbox0{\endnotemark}\endnotetext{\sloppy#1}}
\newcommand{\endnoteinner}{\usebox0}
Declare the endnote with \endnoteouter{Text} before the figure and call it with \endnoteinner at the correct place. If there are multiple endnotes in a figure, an argument could be passed to specify the box number.


\usepackage[singlelinecheck=false]{caption}see: http://tex.stackexchange.com/a/127935/124842 . – Bobyandbob Mar 13 '17 at 09:45\centeringof the\caption. – Skillmon Mar 13 '17 at 09:59