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 would like to use subfig while using the autoref package. I have added the line

\usepackage[listofformat=subparens,subrefformat=parens,labelformat=parens]{subfig}
\newcommand{\subfigureautorefname}{\figureautorefname}

to my master tex file. The purpose of adding these lines was to see Figure 1(a) instead of Figure 1a each time I reference a subfigure. I wish to see the parenthesis. The problem is if use \autoref{fig:ABC} instead of seeing Figure 1(a) I see Figure 1a. However if I

share|improve this question
3  
It looks like you didn't finish your question. Ideally, please post a Minimal Working example: meta.tex.stackexchange.com/questions/228/… –  cmhughes Oct 7 '11 at 15:45

1 Answer 1

You could use \renewcommand\thesubfigure{(\alph{subfigure})}, as shown below.

\documentclass{article}

% subfig setup
\usepackage[labelformat=simple]{subfig}
\renewcommand\thesubfigure{(\alph{subfigure})}
\newcommand{\subfigureautorefname}{\figureautorefname}

\usepackage{hyperref}

\begin{document}

\begin{figure}
 \subfloat[]{
 \centering
 \rule{30pt}{20pt}
 \label{fig:firstpic}
 }
 \hfill
 \subfloat[]{
 \centering
 \rule{30pt}{20pt}
 \label{fig:secondpic}
 }
 \caption{}
\end{figure}

\autoref{fig:firstpic} and \autoref{fig:secondpic}

\end{document}

enter image description here

Note that \autoref is from the \hyperref package.

share|improve this answer

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.