LyXProblem with cross-referencing figures

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
hooman
Posts: 41
Joined: Tue Jul 06, 2010 3:03 pm

Problem with cross-referencing figures

Post by hooman »

Hi,
When I cross-reference figures in my thesis, the reference picks up the section numbers rather than the figure number. My figures are numbered automatically according to chapter numbers which is how I want them.
I have tried a number of things including putting the label before or after the caption, but cannot figure it out, and would appreciate some help ASPA.
Thanks,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

hooman
Posts: 41
Joined: Tue Jul 06, 2010 3:03 pm

Re: Problem with cross-referencing figures

Post by hooman »

I have figured it out. In case this has not been mentioned before:
Place the label, inside the caption box, after whatever your caption text is. I was placing the label, outside the caption box.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Problem with cross-referencing figures

Post by cgnieder »

hooman wrote:I have figured it out. In case this has not been mentioned before:
Place the label, inside the caption box, after whatever your caption text is. I was placing the label, outside the caption box.
Thanks for providing the solution!

The important thing is that \label is called after \caption and not before. Placing it inside the caption indeed ensures this.

Regards
site moderator & package author
Post Reply