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.
I just came across the exact same problem while writing on my thesis and Google brought me directly to your solution here. Thanks! 🙂
Same problem here, same solution works. Thanks!
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
I had a similar problem…putting \protect in front of the argument works!
You can’t imagine how much you helped me! Thanks a lot! 🙂
Saved my day, the thesis that compiled fine on Linux returned these weird errors on Windows, \protect before \subref{} solved everything.
Thank you.
Thank you so much, this deserves to be #1 in search. Instant solution.
Hello everyone !
\protect is a very useful command, but I did it and I still have some problems. The file is compiled, but in the legend I just obtain ?? instead of a) and b).
Do you know the reason of this ?
In my code, I open a “figure” environnement and inside there are two “minipage” environnements. The label for each is placed the line before the “\end{minipage}” for both.
Any idea ?
Thanks !!!