LaTeX Fixing Subfloat Image Labels in LaTeX Captions

  • Thread starter Thread starter ehrenfest
  • Start date Start date
  • Tags Tags
    Image Latex
Click For Summary
The discussion revolves around using the subfloat package in LaTeX to create figures with subcaptions labeled as (a), (b), and (c) instead of (1a), (1b), and (1c). The user seeks a solution to reference these subfigures correctly in the main caption without the leading "1" that indicates the figure number. The recommended approach is to use the \subref command instead of the \ref command for referencing subfigures. This allows for proper labeling in the caption, achieving the desired format of (a), (b), and (c) for subfigures. The user is directed to resources that explain how to implement this correctly within the subfloat command structure.
ehrenfest
Messages
2,001
Reaction score
1
Hello,

I am using the subfloat package. I have several images in my figure and I wanted to have an (a), (b), (c) under them and then refer to them like that in the caption. However, when I do ref {image1a} in the caption it shows up as "1a" instead of "a". I don't want the "1" because this is the caption for figure 1. Is there any way to get rid of that?

Does this make sense?

Thanks.
 
Last edited:
Physics news on Phys.org
I want to something like this

Code:
\begin{figure}
  \centering
  \subfloat[A gull]{\label{fig:gull}\includegraphics[width=0.3\textwidth]{gull}}                
  \subfloat[A tiger]{\label{fig:tiger}\includegraphics[width=0.3\textwidth]{tiger}}
  \subfloat[A mouse]{\label{fig:mouse}\includegraphics[width=0.3\textwidth]{mouse}}
  \caption{Here we a gull \ref{fig:gull} and a tiger \ref{fig:tiger} and a mouse \ref{fig:mouse}}
  \label{fig:animals}
\end{figure}

except I want it to say (a) instead of (1a) where I put \ref{fig:gull}.
 
use \subref{reflabel} rather than \ref{...}
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 5 ·
Replies
5
Views
5K