TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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 used to have code like this: \caption{In \subref{fig:foo:a} you can see...}. Now I switched to using memoirs subtop/subbottom command instead of \subfigure. How can I refer to that subfigure?

As a temporary step I changed \subref to \autoref but that results in output like "In 1.1a you can see... ", I want "In (a) you can see...".

share|improve this question
tex.stackexchange.com/questions/30572/… might be relevant – jonalv Oct 17 '11 at 13:59
I saw that but I specifically only want the non-number part. I.e. the letter (a, b) – Unapiedra Oct 17 '11 at 14:03
It is always best to compose a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. – Peter Grill Oct 17 '11 at 15:32
up vote 4 down vote accepted

memoir defines a "parent" macro for each of the subfloat counters. More specifically, when you issue the command

\newsubfloat{figure}% Allow for subfigures

it creates the subfigure counter as well as a p@subfigure macro to extract/prints the parent figure number. Modifying this macro to be empty removes this functionality. If you only want to disable this "parent" counter removal temporarily, you should use grouping to limit the scope of the macro redefinition:

enter image description here

\usepackage[margin=10mm]{geometry}% http://ctan.org/pkg/geometry
\usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx
% Allow subfloats for the following floats via \subbottom and/or \subtop
\newsubfloat{figure} % Subfigures
\newsubfloat{table} % Subtables
\renewcommand{\p@subfigure}{}% Void parent macro for figures
  \subbottom[This is a subfigure\label{fig:label:a}]{\includegraphics{figure1}} \qquad
  \subbottom[This is a subfigure\label{fig:label:b}]{\includegraphics{figure2}}
  \caption{These are some awesome figures}
See Figure~\ref{fig:label1}. It has subfigures~\ref{fig:label:a} and~\ref{fig:label:b}.

  \subbottom[This is a subfigure\label{fig:label:c}]{\includegraphics{figure3}} \qquad
  \subbottom[This is a subfigure\label{fig:label:d}]{\includegraphics{figure4}}
  \caption{These are some awesome figures}
See Figure~\ref{fig:label2}. It has subfigures~\ref{fig:label:c} and~\ref{fig:label:d}.

  \subbottom[This is a subtable\label{tbl:label:a}]{\includegraphics{table1}} \qquad
  \subbottom[This is a subtable\label{tbl:label:b}]{\includegraphics{table2}}
  \caption{These are some awesome tables}
See Table~\ref{tbl:label}. It has subtables~\ref{tbl:label:a} and~\ref{tbl:label:b}.

geometry was loaded just to make the minimal example fit on a single page.

share|improve this answer
Thanks! Also learned about the \begingroup command. – Unapiedra Oct 18 '11 at 16:36

I don't know if this is a new addition but as documented in the manual, on page 206, you can achieve this with \subcaptionref. Here is an example adapted from the manual:


\newsubfloat{figure} % Subfigures


Figure \ref{fig:twosubfig} has two subfigures, namely \ref{sf:1} and \subcaptionref{sf:2}.

  \subbottom[Subfigure 1]{\fbox{SUBFIGURE ONE}\label{sf:1}}
  \subbottom[Subfigure 2]{\fbox{SUBFIGURE TWO}\label{sf:2}}
  \caption{Figure with two subfigures} \label{fig:twosubfig}



Correct subfigure referencing

share|improve this answer
Great suggestion! That solves my problem in a more elegant way than the other solutions proposed here. Thanks a lot! – rmbianchi Sep 29 '15 at 16:59

One solution is to type that in by hand. This isn't an idiomatic solution and quite evident that it isn't great. It is easy to make a mistake (i.e. if subfigures are moved around).

However, it is not completely bad because the scope of usage will always be local. I will use this in the caption of the figure itself and from there reference the subfigures. It would be different if I were to do this in the body.

See this answer as the challenge to provide a better answer.

share|improve this answer

Change subfigure.sty...




change for:




share|improve this answer
Welcome to TeX.SX. Usually it is better to not edit directly originals .sty files. There are always other options for doing the same job. – Claudio Fiandrino Dec 27 '13 at 18:16

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.