LyXCross-references for Figures are wrong

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
grover20
Posts: 2
Joined: Wed Nov 23, 2011 6:13 pm

Cross-references for Figures are wrong

Post by grover20 »

My cross references for my figures only have single digits. So when I reference three figures in a chapter it prints out figure 3, figure 3, figure 3 instead of figure 3.1, 3.2, 3.3 etc.

Can anyone point me in a direction of things to try? I am using the report style that comes with Lyx 2.0.1 Running Windows xp.

Below is some code I've copied in case that helps... I am not a genius at code, which is why I am using Lyx :D and not LaTex. Let me know if you need something else.

Its a real bother to go back through the text and manual type in the .1 after each "see figure \ref{morph_computation_person}" I know there has to be a better way, but I haven't found it.

there is the code:

Code: Select all

% Preview source code

%% LyX 2.0.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{report}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


\makeatother

\usepackage{babel}
\begin{document}

\chapter{test}

see figure \ref{morph_computation_person}. blah blah blah

\label{morph_computation_person}
\begin{figure}[h]
\caption{Morophological Computation}
\includegraphics[width=1\textwidth]{\lyxdot \lyxdot /\lyxdot \lyxdot /FIGURES/morphological_computation_slide}
\end{figure}

\end{document}
Last edited by grover20 on Wed Nov 23, 2011 7:50 pm, edited 2 times in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Cross-references for Figures are wrong

Post by localghost »

The \label has always to be placed after the \caption and inside the float environment.


Best regards and welcome to the board
Thorsten
grover20
Posts: 2
Joined: Wed Nov 23, 2011 6:13 pm

Re: Cross-references for Figures are wrong

Post by grover20 »

Ah ha, and it is really that simple! Thanks for the quick and effective solution!

Always more obvious one it is pointed out to you! thanks I already have it working.
Post Reply