Re: Defining a new LaTeX-counter (off-topic)
Mark Wagnon:
> Johann Spies wrote:
...
> > \newcounter{mynecounter}
> >
> > However the following file results in an error message when I run LaTeX:
...
> > \bepaling
...
> I am by no means a LaTeX guru, but I think the problem is that \bepaling
> isn't a TeX or LaTeX command.
If you are trying to print out the value of the counter, you need to say
*how* you want it printed out:
\arabic{bepaling} or \roman{bepaling} or whatever
> If you're trying to increment the counter then according to A Guide to
> LaTeX2e by Kopka and Daly, you need to use the \stepcounter command like
> so:
>
> \stepcounter{bepaling}
To reset the counter, use
\setcounter{bepaling}1
To make things easier, you can define a command:
\newcommand{\bepaling}{Bepaling \arabic{bepaling}\stepcounter{bepaling}}
(Note: if you are making a command that lots of other people might use,
it's a good idea to put all text in a separate command for localization's
sake. Ie, instead of `Bepaling' it would say `\bepalingtext'.)
There's a way to step a counter by more than one, but I think I only ever
did that with inbuilt counters or those allocated with \newcount.
Jiri
--
<jiri@baum.com.au>
We'll know the future has arrived when every mailer transparently
quotes lines that begin with "From ", but no-one remembers why.
Reply to: