0

The figure's caption is rendered very bad (see below image). No matter if the text is centered or ragged right, there is an ugly line break after the first letter B. No specialties in the preamble/document are included, even stripped-down to only a three-line preamble and the figure, the error persists.

\begin{figure}
\includegraphics[width=1\textwidth]{./img/annstructure.png}
\caption Basic structure of an ANN \footnote{Structure of an artificial neural network - \url{https://commons.wikimedia.org/wiki/File:ArtificialNeuronModel_english.png}}
\end{figure}

screenshot of the error

Zarko
  • 296,517
Jan
  • 1
  • 2
    Welcome! Add braces and \protect: \caption{Basic structure of an ANN \protect\footnote{Structure of an artificial neural network - \url{https://commons.wikimedia.org/wiki/File:ArtificialNeuronModel_english.png}}}. –  Jan 17 '20 at 02:38
  • 1
    Apart from the braces, you may be interested in the answers of this question, which teach you how to get a footnote in the caption. My above proposal to add \protect "works" in the sense that you do not get an error (provided you load hyperref and graphicx) yet does not yield an output with a footnote. –  Jan 17 '20 at 03:00
  • 2
    To expand on the comment by @Schrödinger'scat, \caption is defined to take an argument, so it will accept either what follows it in braces, or the first character that follows it, which is why in your example, only the "B" is treated as the caption. – barbara beeton Jan 17 '20 at 03:02
  • Oh that was too obvious that the \caption-command needs braces. Silly me, but thank you! For curiosity: what does \protect in this case exactly? – Jan Jan 17 '20 at 05:07
  • See https://tex.stackexchange.com/q/12698 and https://tex.stackexchange.com/q/4736. –  Jan 17 '20 at 08:24

0 Answers0