Graphics, Figures & TablesReference to subfigures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Klaushh
Posts: 3
Joined: Fri Jan 21, 2011 10:48 am

Reference to subfigures

Post by Klaushh »

Hey dudes

My problem occurs when iam referencing to a subfigure with a number depth of more than 2. E.g. my main figure enviroment is called 2.4.1, and the subfigers are 2.4.1(a) and 2.4.1(b). However, when referencing to one of the to subfig-labels, LaTeX writes: Figure 2.4(a). Is there any way to adjust this setting so it writes: Figure 2.4.1(a)

Tanks :)
Last edited by Klaushh on Wed Jan 26, 2011 11:08 am, edited 1 time 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.

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: Reference to subfigures

Post by sommerfee »

Which package did you used to typeset the subfigures (I'm aware of three of them) and where have you placed the \label command?

I think the best is giving us a minimal but complete LaTeX example code which shows the problem, so we need neither to guess nor to take a look at the crystal ball.
Klaushh
Posts: 3
Joined: Fri Jan 21, 2011 10:48 am

Reference to subfigures

Post by Klaushh »

Iam not sure iam following you in which package you mean. My preamble only has this command dealing with the subfigure package...

Code: Select all

\usepackage{subfigure} 

This is the figure as written in latex code:

Code: Select all

\begin{figure}[H]
  \begin{center}
    \subfigure[Pressure areas.]{
     \includegraphics[width=0.85\textwidth]{Parts/Model/pics/Slider_Areas.eps}\label{fig:Areas}
    \subfigure[Topview]{
     \includegraphics[width=0.45\textwidth]{Parts/Model/pics/SliderTop.eps}\label{fig:SliderTop}}
    \subfigure[Bottomview ]{
     \includegraphics[width=0.45\textwidth]{Parts/Model/pics/SliderBelow.eps}\label{fig:SliderBelow}
}
\end{center}
\caption{Poppet.}
\label{fig:PoppetValveSubfig}
\end{figure}

When refferring to the first figure \ref{fig:Areas}. Latex only writes figure 2.2(a) instead of figure 2.2.2(a) ...

Hope this helps understanding the problem :)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reference to subfigures

Post by localghost »

With subfigure you are using an obsolete package [1]. Choose one of its predecessors and try again after reading the corresponding package manual. If the problem persists, feel free to ask further questions.

[1] View topic: Obsolete packages and document classes — Avoid usage!


Best regards and welcome to the board
Thorsten
Klaushh
Posts: 3
Joined: Fri Jan 21, 2011 10:48 am

Re: Reference to subfigures

Post by Klaushh »

Hi again
Thanks to localghost, your answer helped me understand the problem:
I replaced the subfigure package with the subfig package instead. This involves using \subfloat instead of \subfigure, and solved problem. References to subfigures are now correct.
Thanks again
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reference to subfigures

Post by localghost »

Klaushh wrote:[…] I replaced the subfigure package with the subfig package instead. This involves using \subfloat instead of \subfigure, and solved problem. References to subfigures are now correct. […]
Then please mark the topic accordingly as written in the Board Rules (to be read before posting) and as you have already been directed in my last reply.
Post Reply