From 3f1971c9b7717818766692c9aa497e20e7472f2c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 7 Apr 2010 22:47:28 +0000 Subject: FAQ-en 3.19d (7apr10) git-svn-id: svn://tug.org/texlive/trunk@17742 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/generic/FAQ-en/html/FAQ-addtoreset.html | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-addtoreset.html') diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-addtoreset.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-addtoreset.html index d70605711fc..9d69f493457 100644 --- a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-addtoreset.html +++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-addtoreset.html @@ -2,16 +2,16 @@ UK TeX FAQ -- question label addtoreset

Master and slave counters

-

It’s common to have things numbered “per chapter” (for example, in +

It’s common to have things numbered “per chapter” (for example, in the standard book and report classes, figures, tables and footnotes are all numbered thus). The process of resetting is -done automatically, when the “master” counter is stepped (when the +done automatically, when the “master” counter is stepped (when the \chapter command that starts chapter <n> happens, the chapter counter is stepped, and all the dependent counters are set to zero).

How would you do that for yourself? You might want to number algorithms per section, or corollaries per theorem, for example. If -you’re defining these things by hand, you declare the relationship +you’re defining these things by hand, you declare the relationship when you define the counter in the first place:

\newcounter{new-name}[master] @@ -19,7 +19,7 @@ when you define the counter in the first place: says that every time counter <master> is stepped, counter <new-name> will be reset.

But what if you have an uncooperative package, that defines the -objects for you, but doesn’t provide a programmer interface to make +objects for you, but doesn’t provide a programmer interface to make the counters behave as you want?

The \newcounter command uses a LaTeX internal command, and you can also use it: @@ -44,14 +44,14 @@ command without its asterisk:

will do the same, and also redefine \thecorollary as <theorem number>.<corollary number>, which is a good scheme -if you ever want to refer to the corollaries — there are potentially -many “corollary 1” in any document, so it’s as well to tie its number +if you ever want to refer to the corollaries — there are potentially +many “corollary 1” in any document, so it’s as well to tie its number to the counter of the theorem it belongs to. This is true of pretty -much any such counter-within-another; if you’re not using the +much any such counter-within-another; if you’re not using the chngcntr, refer to the answer to -redefining counters’ \the-commands for +redefining counters’ \the-commands for the necessary techniques. -

Note that the technique doesn’t work if the master counter is page, +

Note that the technique doesn’t work if the master counter is page, the number of the current page. The page counter is stepped deep inside the output routine, which usually gets called some time after the text for the new page has started to appear: so special @@ -64,11 +64,11 @@ may be applied to any counter. The command:

will cause <counter> to be reset for each page. The package uses a label-like mechanism, and may require more than one run of LaTeX -to stabilise counter values — LaTeX will generate the usual +to stabilise counter values — LaTeX will generate the usual warnings about labels changing.

-
chngcntr.sty
macros/latex/contrib/misc/chngcntr.sty -
perpage.sty
Distributed as part macros/latex/contrib/bigfoot (or browse the directory) +
chngcntr.sty
macros/latex/contrib/chngcntr (or browse the directory) +
perpage.sty
Distributed as part macros/latex/contrib/bigfoot (or browse the directory); catalogue entry

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=addtoreset -- cgit v1.2.3