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 have redefined \ref like this:


so that I get "Figure nn" automatically by default.

However, this makes \subref (from package subcaption) behave incorrectly.

How can \subref be redefined to get its correct behavior while keeping the redefined behavior of \ref?

share|improve this question
Use \AtBeginDocument{\renewcommand{\ref}[1]{\autoref{#1}}} However I have the feeling that this redefinition isn't a good idea. – Marco Daniel Oct 16 '12 at 18:21
That is what I am doing and causes trouble when using \subref (these are not rendered correctly). Somewhat there is some interference doing that and later using \subref. – mljrg Oct 16 '12 at 18:23
up vote 0 down vote accepted

I have resolved this issue by quitting on redefining the \ref. So I am now using \autoref directly and \subref is working properly.

share|improve this answer

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.