I try to put a url as a reference in a caption of a figure. But it seem to give all kinds of errors like:

! Argument of \@caption has an extra }.
! Paragraph ended before \contentsline was complete.

Is there a way to make this work?

  • 2
    Footnotes to captions don't really make sense. Why not simply set the URL in the caption? – egreg May 3 '14 at 16:59
  • 1
    I think it is kind of ugly, a long url with signs in (not as short as the example). – Lennart May 5 '14 at 15:59
  • It will be uglier in a footnote. – egreg May 5 '14 at 16:10

You can use combination of footnotemark and footnotetext. Here is MWE:

    \caption[Caption for LOC]{Real caption\footnotemark}
Anywhere on page where float appears\footnotetext{\url{test.com}}
  • This doesn't guarantee that the footnote will appear in the same page as the figure. – egreg May 5 '14 at 16:11
  • @egreg No it does not. But if you put it close it will not happen often, and in rare occasions when it happen you can move footnotetext before figure or move it around so it is on the same page. – Tahtisilma May 5 '14 at 16:45
  • 1
    It did not work in the image code that I had already. But removing it and using this worked! – Lennart May 6 '14 at 17:17
  • For me, this did not work too if I put the code suggested by @Tahtisilma but not if I do it myself in a subfigure environment. What I was missing was the [ brackets before the Real caption\footnotemark – kalmanIsAGameChanger Mar 19 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.