## Why doesn't LaTeX2e have a \renewcounter?

### Why doesn't LaTeX2e have a \renewcounter?

The*gurus keep insisting that instead of making new
classes/packages from scratch, one should write classes/packages on
top of existing software. They therefore recommened that we do
\renewcommand and \renewenvironment instead of just putting in \defs
all over the place while redefining existing commands. I have reached
a stage where I need to redefine a counter from an existing class to
make it suit my needs without having to copy the entire class file and
then change the one line I want to change.

Q1) Why doesn't*have a \renewcounter? Is it because someone
thought that the implementation will be too hard because it will have
to remove the counter from the parent counter's reset list?

Q2) Well, given that*has no \renewcounter, any sugegstions on
how to solve this problem? I want to build a document class which has
many similarities to the report class. However, the report class uses
figure numbers as chapternumber.figurenumber. I need continuous figure
numbers across all chapters, which are not reset for every chapter.

The report class (or style) defines
\newcounter{figure}[chapter]

What I want is
\newcounter{figure}

As to how to play with \thefigure, I can use \renewcommand on it (not
\def because that's not a nice method!!) to fix it.

Any sugegstions on how to write clean code that allows me to use
figure' as my counter with the values I want in them?

Thanks in advance for any help.

Manas
--
:     Manas Mandal             Department of Computer and Information Science :
:                                        The Ohio State University            :

### Why doesn't LaTeX2e have a \renewcounter?

Quote:>The report class (or style) defines
>\newcounter{figure}[chapter]

>What I want is
>\newcounter{figure}

LaTeX keeps a list of counters that are to be reset with section BAR

needs to be done is to remove the equation counter from the list

to remove from a list than to add to one.  Here it is:

With this, numbering equations consecutively is set up by:

\def\theequation{\arabic{equation}}

a style file.

=====
* "just" is relative... This is a repost from several years ago.

### Why doesn't LaTeX2e have a \renewcounter?

>The*gurus keep insisting that instead of making new
>classes/packages from scratch, one should write classes/packages on
>top of existing software. They therefore recommened that we do
>\renewcommand and \renewenvironment instead of just putting in \defs
>all over the place while redefining existing commands. I have reached
>a stage where I need to redefine a counter from an existing class to
>make it suit my needs without having to copy the entire class file and
>then change the one line I want to change.

>Q1) Why doesn't*have a \renewcounter? Is it because someone
>thought that the implementation will be too hard because it will have
>to remove the counter from the parent counter's reset list?

The problem is that the reset lists are held as dependencies from the
master, but there's no indication in the slave' as to which masters
may reset it.

Quote:>Q2) Well, given that*has no \renewcounter, any sugegstions on
>how to solve this problem? [...]

What you could reasonably do is to write a piece of macro to remove a
named counter from the dependency list of another named counter.
Indeed, I could do that, too, but just now I don't have the time.
--

U of Cambridge Computer Lab, Pembroke St, Cambridge  CB2 3QG, UK
Private page: http://www.veryComputer.com/

I have never had trouble with \verb|my literal junk here| until today.

I wrote \verb|http://www.engr.wisc.edu/~tomas|
and I get, in tt, http://www.engr.wisc.edu/ tomas
^note the space here.

Bah, and humbug.  Why is \verb broken this way?

TIA

--
ciao,