Graphics, Figures & TablesHow to reset figure numbering to default?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hedinn
Posts: 4
Joined: Tue Aug 03, 2010 12:02 pm

How to reset figure numbering to default?

Post by hedinn »

Hi.

Does anyone know how I can completely reset the whole figure labeling and numbering to default of documentclass book?

What started my troubles:
I use the subfig-package. With this the labels of my figures are in the form:
"Figure [chapter].[figure number]: [Caption]"
Labels of subfigures are in the form:
"[smalcap letter]: [Caption]"

In part of my book, I tried to reformat the labeling of my subfigures to numeric only. I found some code in the subfig doku and tried:

Code: Select all

\renewcommand{\thesubfigure}{\alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple,labelsep=colon,listofformat=simple}
\captionsetup{lofdepth=2}
\makeatletter
\renewcommand{\p@subfigure}{}
\makeatother
This completely messed up my figure numbering. After removing the code, figure labels still look like:
"Figure [chapter].-[figure number reversed]: [Caption]"

I don't have clue where the "-" before figure-numbers came from, and the reversing figure number wasn't quite what I hoped for (Figure 6.9, Figure 6.8, Figure 6.7, etc).

Hope anyone more skilled can help me fix this.

Regards

Hedinn
Last edited by hedinn on Tue Aug 03, 2010 5:44 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

How to reset figure numbering to default?

Post by Stefan Kottwitz »

Hi Hedinn,

welcome to the board!

Are you sure there's no redefinition of \thefigure in your document any more? Perhaps post your preamble or a minimal working example to examine it.

Stefan
LaTeX.org admin
hedinn
Posts: 4
Joined: Tue Aug 03, 2010 12:02 pm

Re: How to reset figure numbering to default?

Post by hedinn »

Hmm..

Searched the whole document. No "\thefigure" anywhere.

Hedinn
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: How to reset figure numbering to default?

Post by Stefan Kottwitz »

You showed only already removed code, not the remaining code containing the problem. So, who might guess what you're doing...

Stefan
LaTeX.org admin
hedinn
Posts: 4
Joined: Tue Aug 03, 2010 12:02 pm

Re: How to reset figure numbering to default?

Post by hedinn »

Well.

I added the code in the first post and compiled. All the label problems happened at this compilation (I had compiled just a minute before I added the code, and then everything was ok).
Then I removed the code and compiled again, but labels are still wrong.

The only difference in my whole project directory from before and after the label problems was this short bit of code. I've also tried deleting all of the latex-generatet files before compilation.
I do not know much about the backend of latex, but could it be that this code changed something permanently in some of the package files?

Anyway. That's why I wondered if there was any method to "reset" the latex figure labelling to some default values.

Thanks for quick answers.

Hedinn
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

How to reset figure numbering to default?

Post by Stefan Kottwitz »

hedinn wrote:could it be that this code changed something permanently in some of the package files?
That's not possible.
hedinn wrote:That's why I wondered if there was any method to "reset" the latex figure labelling to some default values.
LaTeX produces .aux files. You could "reset" your project by removing those .aux files. They will be generated in the next compiler run. Normally they should be overwritten, but if such a strange behaviour occurs I would delete them manually.

Stefan
LaTeX.org admin
hedinn
Posts: 4
Joined: Tue Aug 03, 2010 12:02 pm

Re: How to reset figure numbering to default?

Post by hedinn »

Actually, that did the trick.

I hadn't deleted the aux files. Doing this removed the bad labelling.

Thanks
Hedinn
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: How to reset figure numbering to default?

Post by Stefan Kottwitz »

I'm glad that it helped.
Btw. if a problem has been solved the topic should be marked as "solved". This can be done by editing the first post of the topic and choosing the checkmark.

Stefan
LaTeX.org admin
Post Reply