Why doesn't LaTeX2e have a \renewcounter?

Why doesn't LaTeX2e have a \renewcounter?

Post by Manas Mand » Sat, 30 Jul 1994 03:07:48



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?

Post by Donald Arsene » Sat, 30 Jul 1994 01:47:00



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?

Post by Robin Fairbair » Mon, 01 Aug 1994 01:11:08




>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/
 
 
 

1. Why doesn't `~' (tilde) show up in \verb?

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,

<a href="http://www.engr.wisc.edu/~tomas">Home Page</a>
%cat std-disclaimer | more

2. First Log-on after installation

3. Why doesn't cmex scale?

4. XML Spy

5. why doesn't TeX have an IANA registration

6. Cell Phone Cables & Accessories

7. \futurelet problem: why doesn't this work?

8. Amiga 500 with 50 Meg HD/ Trumpcard Forsale!

9. Why Yap doesn't show .eps figure?

10. Why doesn't newcommand work with verbatim?

11. why doesn't this work?

12. why doesn't my \cline work??

13. *** Why doesn't \enlargethispage work???