Fixing Subfloat Image Labels in LaTeX Captions

  • Context: LaTeX 
  • Thread starter Thread starter ehrenfest
  • Start date Start date
  • Tags Tags
    Image Latex
Click For Summary

Discussion Overview

The discussion revolves around the use of the subfloat package in LaTeX for creating figures with multiple images, specifically focusing on how to label subfigures with letters (a), (b), (c) instead of numbers (1a, 1b, 1c) in captions and references.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant seeks a way to label subfigures with letters instead of numbers in the caption, expressing confusion over the output of the \ref command.
  • Another participant suggests placing the caption inside the subfloat command as a potential solution, referencing an external source for guidance.
  • A third participant provides a code example illustrating their desired format, emphasizing the need for letter labels in references.
  • Another participant recommends using \subref instead of \ref to achieve the desired labeling.

Areas of Agreement / Disagreement

Participants present various approaches to the problem, and while some suggestions are made, there is no clear consensus on the best solution or method to achieve the desired labeling.

Contextual Notes

Participants do not clarify the specific version of LaTeX or the subfloat package being used, which may affect the applicability of the suggested solutions.

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
4K
  • · Replies 7 ·
Replies
7
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
12K