Graphics, Figures & TablesSubfigure reference format

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sandsoftime
Posts: 8
Joined: Mon Sep 21, 2009 9:04 pm

Subfigure reference format

Post by sandsoftime »

Hi
I am trying to change the default way in which the \ref command works with subfigure references. Right now the output I get is a figure number appended with the subfigure alphabet eg. 4c. I want it to appear as 4 (c) instead. I tried changing the \subref and \thefigure commands but couldn't figure it out.

Murtaza

Recommended reading 2024:

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

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

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

Subfigure reference format

Post by gmedina »

Hi Murtaza,

the suggestion given in this other thread could be useful for you.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
sandsoftime
Posts: 8
Joined: Mon Sep 21, 2009 9:04 pm

Re: Subfigure reference format

Post by sandsoftime »

Hi
The captions themselves appear in the parentheses by default. The \subref only generates a reference to the subfigure and gives the alphabet (a), (b) etc. However, with \ref the parantheses disappear. Is there a way to make \subref work so that reference to the parent figure is also generated. Or anyway to modify the \ref command?

Sands
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Subfigure reference format

Post by localghost »

It's recommendable to use the subcapton package that comes with the current version of the caption package. It has its own manual which explains everything in detail. References are much easier.


Best regards and welcome to the board
Thorsten
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Subfigure reference format

Post by gmedina »

sandsoftime wrote:...Is there a way to make \subref work so that reference to the parent figure is also generated...
That's exactly what the example code in the linked thread does.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
sandsoftime
Posts: 8
Joined: Mon Sep 21, 2009 9:04 pm

Re: Subfigure reference format

Post by sandsoftime »

Thanks. It works. I just forgot to add the \usepackage{subfig} explicitly in Lyx document preamble.
Post Reply