Graphics, Figures & TablesHow to remove \numberwithn?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zwierz
Posts: 5
Joined: Thu Jan 20, 2011 2:22 am

How to remove \numberwithn?

Post by zwierz »

Hi,

I have a appendix in my document which contains figures and I wanted them to be numbered like: Fig. A.1, Fig. A.2 etc., where A is from appendix. To achieve that I used:

\appendix
\numberwithin{figure}{section}
\section{Appendix}

but after appendix I have other sections with figures inside and I don't want them to be numbered with section number like: Fig. 1.1, Fig. 1.2 etc. but just Fig 1, Fig. 2. My question is how can I unbind figure and section counters? I'll appreciate any help.
Last edited by zwierz on Thu Feb 03, 2011 7:37 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.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to remove \numberwithn?

Post by frabjous »

A minimal working example should always be given. Otherwise, I don't see the problem. The \numberwithin command shouldn't take effect until the appendix -- and at least in the article class, prior to that, you'd just get "Figure 1" and "Figure 2" by default.

However, there are plenty of options. One option would be to load the chngcntr package which defines a pair of commands

Code: Select all

\counterwithin{figure}{section}
and

Code: Select all

\counterwithout{figure}{section}
(which work just like \numberwithin from amsmath) -- with these you could turn it on and off at will.

Finally you could use

Code: Select all

\renewcommand{\thefigure}{\arabic{figure}}
to just get "Figure 1" wherever you needed to.
zwierz
Posts: 5
Joined: Thu Jan 20, 2011 2:22 am

Re: How to remove \numberwithn?

Post by zwierz »

Thank U :) \renewcommand{\thefigure}{\arabic{figure}} works fine for me. And sorry for the lack of MWE - I just thought that description would be enough in this case.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to remove \numberwithn?

Post by localghost »

Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply