Using \subref in the caption of a figure (LaTeX)

Posted February 21st @ 10:45 by Werner

I use the subfig package and when I compiled my thesis in Linux I encountered a problem, when I used the \subref command in the caption of a figure. The compilation was stopped with the error message “Argument of \@tempf has an extra }.”

Scanning the internet I found this forum entry in German where it was proposed to add the command “\protect” before “\subref{fig:1}, which actually did the trick for me. I didn’t have this problem though with MikTeX.

3 Comments

  1. foosel
    March 15, 2007 at 18:34

    I just came across the exact same problem while writing on my thesis and Google brought me directly to your solution here. Thanks! :)

  2. roel
    February 7, 2008 at 14:42

    Same problem here, same solution works. Thanks!

  3. Amy8492
    September 23, 2009 at 08:51

    I had a different error message, but the problem was similar. And your solution worked. Thanks!

    ! Use of \caption@@settype doesn’t match its definition.
    \new@ifnextchar …served@d = #1\def \reserved@a {
    #2}\def \reserved@b {#3}\f…

    Amy

Leave a comment

OpenID Login

Standard Login

Options:

Size

Colors