I am migrating from subfig to subcaption package and wondering how to make the following thing. The subcaption labels in floats should look like a single italic letter in brackets (a), and \subref{f:a} should give (a). At the same time, I would like \ref{f:a} to give me 1, a, i.e. \thefigure,~\thesubfigure. By default \ref{} gives 1a.

The code


gives exactly what I want, except for the "comma and space" separator in \refs. Is there any macro in caption or subcaption package to redefine this separator?

  • 1
    Could you provide a minimal working example (MWE) for your code? That would make it easier for people to work on it and find solutions.
    – Jake
    Aug 14, 2011 at 3:19

1 Answer 1


You can redefine \p@subfigure. For an example code see Error using russian letters for appendix counter with hyperref and subfig


Please note that your method of patching the internal macro \subcaption@ref will not work with the upcoming version 1.1 of the subcaption package. See above link for patching \subref in a better way. (BTW: Version 1.1 will offer \captionsetup{subrefformat=parens} so patching is not needed anymore, furthermore the parenthesis will be part of the hyperlink then.)

  • @Stanislav: I converted your "answer" to a comment. Note that answers are only for solution of the question. You couldn't add a comment because your first session expired and you then automatically created a new unregistered account (but which looks the same way). I merged the accounts now together. Please consider registering the account to avoid such things in the future. Please also accept Axel's answer by clicking the green tick symbol on the upper left side if this question solved your issue. Aug 15, 2011 at 7:05
  • @Axel, it took me awhile to figure out what part of that answer you are referring to. Would you quote it? (\makeatletter ...) Oct 3, 2011 at 21:33
  • @Justin: This depends on what part of the question you are referring to. The extra parentheses will be setup by the option subrefformat=parens, the custom format of \ref will be setup by the redefinition of \p@subfigure. I think it's a good idea just to take one of the example codes and play around with it to see what change will have what effect. Please also take a look at the section "References" of the recent subcaption package documentation which gives additional examples. If you have any further questions please don't hesitate to ask.
    – user2574
    Oct 4, 2011 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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