Take the 2-minute tour ×
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.

I have redefined \ref like this:

\renewcommand{\ref}[1]{\autoref{#1}}

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.