Graphics, Figures & TablesLabel

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kaosad
Posts: 2
Joined: Fri Aug 14, 2009 5:22 am

Label

Post by kaosad »

I am using subfig package. When I reference a sub-figure using \ref{} I get something like, 1.1a, where 'a' is the sub-figure 'number'. How do I change to display this --> 1.1(a)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Label

Post by gmedina »

Hi,

you can use the \subref command with some additional settings using the caption package (make sure that your system uses a recent version of the caption package):

Code: Select all

\documentclass{book}
\usepackage{caption}
\usepackage{subfig}

\captionsetup[subfloat]{listofformat=parens}

\begin{document}

\chapter{Test chapter}

\begin{figure}%
  \centering
  \subfloat[first subfigure]{\rule{3cm}{3cm}\label{fig:subfig1}}%
  \qquad
  \subfloat[second subfigure]{\rule{3cm}{3cm}\label{fig:subfig2}}
  \caption{two subfigures.}%
  \label{fig:test}%
\end{figure}


As we seen in figure \subref{fig:subfig1}...

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply