about me

LaTeX: Wrong figure numbers in subfloat

Post replyCan't edit post
Watch topicCan't delete post
Tuesday, August 4 2009, 16:14
I've been puzzled by some incorrect figure numbers in my LaTeX document recently. I have a figure, 2, with two subfigures, 2a and 2b, but when referencing them, I get figures 1a and 1b.
It turned out you have to put the \label commands in the correct order, like so:
\caption{Detail of cameras on a Nokia N95 smartphone}
\subfloat[User camera located above screen]{
\subfloat[Perspective camera on backside of device]{
Also, make sure that \caption always precedes \label as Luke Maciak suggests.
Note that as Matthias mentions in the comments below, you may have to put the \caption and \label after the \subfloats. I haven't determined yet when one or the other should be done, but just remember that moving them around may resolve your problem.
Actions:Post replyWatch topic
Matthias: Thanks for your post! I had a similar...Post reply Show 2 comments
Graham: Matthias- that has allowed me to heave a...

More updates

Click here to read more news items.
Members have extra privileges. You can login or register.
© 2005–2018 P. F. Lammertsma
No members currently online; 0 hits today by 0 unique users