TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to reference labels in the sentence, as above in the code: like this - \ref{X,Y,Z} to give "Fig. 1a,1b,1c" or "Fig. 1a-c" in text.



...in the three statistically favoured models (Fig.~\ref{fig:LocalPoly1_residual,   
fig:IDW2_residual, fig:RBF_residual}) discussed below and not as well in the case of 
GlobalPoly5 (Fig.~\ref{fig:GlobalPoly5_residual}).

  \subfloat[GlobalPoly5]{\label{fig:GlobalPoly5_residual}\includegraphics[width=0.25\textwidth]{"Data Analysis Files/GlobalPoly5_residual"}}                
  \subfloat[LocalPoly1]{\label{fig:LocalPoly1_residual}\includegraphics[width=0.25\textwidth]{"Data Analysis Files/LocalPoly1_residual"}}
  \subfloat[IDW2]{\label{fig:IDW2_residual}\includegraphics[width=0.25\textwidth]{"Data Analysis Files/IDW2_residual"}}
  \subfloat[RBF]{\label{fig:RBF_residual}\includegraphics[width=0.25\textwidth]{"Data Analysis Files/RBF_residual"}}
  \caption{Residual plots of each of the interpolators.}


@Leo Liu : it gives a lower case "f" for "figs." - do you know how make it uppercase "F" for consistency with my labelling elsewhere?

share|improve this question
This is not a good question. What do you want to "work"? Please explain what you want. – Seamus Jun 14 '11 at 11:43
Sorry, I thought the title was sufficiently self-explanatory but perhaps I should be clearer. I want to reference labels in the sentence, as above in the code: like this - \ref{X,Y,Z}. – ptrcao Jun 14 '11 at 11:47
I have to agree with @Seamus. The actual question should be stated in the body, not only in the title. "Reference multiple labels" can mean different things and the reader should not be forced to read the requested solution from the code! – Martin Scharrer Jun 14 '11 at 11:58
Acknowledged, fixed. Let me know if anything else needs to be edited for clarity. Thanks. – ptrcao Jun 14 '11 at 11:59
What exact output do you want? Something like "Fig. 1a,b,c"? – Martin Scharrer Jun 14 '11 at 11:59
up vote 13 down vote accepted

Just use \cref or \Cref from cleveref package to reference multiple labels in one command.

For example, \cref{fig1,fig2,fig3} is valid. And use \Cref for capitals.

share|improve this answer
I don't think you can have the space after the comma. (At least that didn't work when I just tested.) – Torbjørn T. Jun 14 '11 at 12:04
@Torbjorn: Indeed. It seems that cleveref should be impoved. – Leo Liu Jun 14 '11 at 12:23
@Leo Liu : see my OP for a refinement request – ptrcao Jun 14 '11 at 12:24
@ptrcao: Use \Cref. And you'd better read the package manual first for details. – Leo Liu Jun 14 '11 at 12:27
@Leo @ptrcao: \Cref is intended for the beginning of a sentence. To capitalize all refs, add the capitalize (or capitalise) option to the package, i.e. \usepackage[capitalize]{cleveref}. See the manual, section 5. – Torbjørn T. Jun 14 '11 at 16:12

without package cleveref is must be \ref{..},\ref{...}

share|improve this answer
This didn't work for me – geo909 Jun 25 '15 at 12:53
that is not a useful description of your problem ... – Herbert Jun 25 '15 at 14:19
You're right.. What I meant is the following: If I have two theorems, say 1 and 2 labelled \label{first} and \label{second}, writing \ref{first}\ref{second} as you suggested will produce "12" and not "1,2", as the op was asking in his question. – geo909 Jun 25 '15 at 14:37
Yes, it must be \ref{...},\ref{...} – Herbert Jun 25 '15 at 16:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.