# Figure caption rendering problem

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}

• 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}}}. – Schrödinger's cat Jan 17 at 2:38
• 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. – Schrödinger's cat Jan 17 at 3:00
• 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 at 3: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 at 5:07
• – Schrödinger's cat Jan 17 at 8:24