Saraswat, Rajil schrieb:
I am trying to reference a subfigure in my report but the label is coming
out wrong in the document. For subrefencing i add \label{foo} to my
subfigure and inserted \ref{foo} in the main document. Additionaly,in the
preamble, i have set the command to  represent labels by section, however in
the rendered document, the subsection number is not getting included for the
subfigure.

attached the testfile. It is not a good idea to count figures sectionwide, when having chapters.

Herbert
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass report
\begin_preamble
\usepackage[subfigure]{tocloft}
[EMAIL PROTECTED] 
\renewcommand{\theequation}{\thesection.\arabic{equation}}
[EMAIL PROTECTED] 
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}  
 [EMAIL PROTECTED] 
 \renewcommand{\thetable}{\thesection.\arabic{table}}  
\renewcommand\includegraphics[2][]{\rule{4cm}{3cm}}
\end_preamble
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Chapter

Heading
\layout Section

Section 1
\layout Standard

Test
\layout Subsection

Subsection
\layout Standard

This is a reference to a subfigure given by the label Figure 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
ref{foo}
\end_inset 

 , but the label coming out is incorrect.
\layout Standard


\begin_inset Float figure
placement H
wide false
collapsed false

\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
centering
\end_inset 


\begin_inset Graphics
        filename pct-U.p
        lyxscale 50
        scale 50
        rotateAngle -90
        subcaption
        subcaptionText "Displacement due to tapered mould\label{foo}"

\end_inset 

\SpecialChar ~

\begin_inset Graphics
        filename pct-RF.p
        lyxscale 50
        scale 50
        rotateAngle -90
        subcaption
        subcaptionText "Reaction Force\label{baz}"

\end_inset 


\layout Caption


\begin_inset LatexCommand \label{cap:c-U}

\end_inset 

Displacement of the midface point under thermal strain alone in the absence
 of ferrostatic pressure
\end_inset 


\layout Standard

This is a reference to a subfigure given by the label Figure 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
ref{baz}
\end_inset 

 , but the label coming out is incorrect.
\layout Section

Section 2
\layout Standard

Test
\layout Subsection

Subsection
\layout Standard

This is a reference to a subfigure given by the label Figure 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
ref{baz2}
\end_inset 

 , but the label coming out is incorrect.
\layout Standard


\begin_inset Float figure
placement H
wide false
collapsed false

\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
centering
\end_inset 


\begin_inset Graphics
        filename pct-U.p
        lyxscale 50
        scale 50
        rotateAngle -90
        subcaption
        subcaptionText "Displacement due to tapered mould\label{baz2}"

\end_inset 

\SpecialChar ~

\begin_inset Graphics
        filename pct-RF.p
        lyxscale 50
        scale 50
        rotateAngle -90
        subcaption
        subcaptionText "Reaction Force\label{foo2}"

\end_inset 


\layout Caption


\begin_inset LatexCommand \label{cap:c-U}

\end_inset 

Displacement of the midface point under thermal strain alone in the absence
 of ferrostatic pressure
\end_inset 


\layout Standard

This is a reference to a subfigure given by the label Figure 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
ref{foo2}
\end_inset 

 , but the label coming out is incorrect.
\the_end

Reply via email to