{counters} is about macro writing involving counters. For general questions about numbering document elements, use {numbering}.

learn more… | top users | synonyms

8
votes
2answers
1k views

Building labels out of counters

There is a simple version to my question, and a complex version. First, the simple version: I want to generate label names by combining a constant string with a counter's value, something like what is ...
9
votes
1answer
1k views

Refer to customized `enumerate` counter

Background I'm typesetting a list of conditions for a certain mathematical object. There are three conditions. Later on I wish to provide an equivalent condition for the third. Therefore, it would be ...
22
votes
2answers
3k views

Wrong (hyper-)references after resetting chapter counter

The following MWE produces a PDF whose TOC has two entries: “Foo” and “Bar” with correct page numbers. So far, so good. However, upon clicking on the link to “Bar”, I am taken to the page for “Foo” ...
3
votes
2answers
537 views

Unexpected tikz/counter behaviour

What I've been trying to do, futilely, is to use the foreach[counter=\xi] x in {1,2,3} statement in tikz/pgf with LaTeX. This fails, every time. Whatever. So I moved on to trying to use a counter, ...
4
votes
1answer
495 views

Booleans fail in tabular environment

I've got a workaround for this problem, but maybe someone knows a cleaner way to fix it. I'm using the standard packages in TexLive 2009. Here's the code that doesn't work: \documentclass{article} ...
12
votes
3answers
678 views

Setting Initial Page number on command-line

I would like to typeset a LaTeX file and set the initial page number from the command line (as I need to often change it to merge with different documents). I thought that the following would work, ...
0
votes
1answer
524 views

restating a theorem using theomac.sty

I am trying to restate a theorem environment using theomac.sty which floats around, following a suggestion I received here: how do I refer back to counters? The package I downloaded loads well, but ...
2
votes
0answers
297 views

how do I refer back to counters? [duplicate]

Possible Duplicate: How do I repeat a theorem number? I want to set up a simple macro that would do the following: It would be very similar to \label{XX}, (say, \relabel{XX}) only instead ...
4
votes
1answer
5k views

Setting \setcounter{tocdepth} for an individual chapter

Hiya, Is it possible to set the \setcounter{tocdepth}{..} for one chapter only? The default depth is fine for the entire document, except for the last chapter- I only want the chapter title to appear ...
11
votes
1answer
211 views

How can I do something after the next pagebreak?

I'm writing a document where I say something like "if you look at Figure 1 on the next page, then you will see that blah blah blah". So what I want to do is have latex skip a number when numbering ...
12
votes
2answers
1k views

How to set a marker/counter/label to an arbitrary piece of text?

Is it possible to attach a marker to just a place in text, not to section, sub-section, etc.? This is what I'm trying to achieve: \begin{document} Alex (see~\ref{alex}) is a boy, Jessica ...
10
votes
2answers
2k views

Listings: different counters for different listing environments

How do I create two lstlisting environments that each have its own counter? If I use for example \lstnewenvironment{algorithm}[2]{ \renewcommand\lstlistingname{Algorithm} \lstset{ ... } } ...
5
votes
1answer
178 views

How to output the final value of some counter, like number of figures or tables in the middle of the document?

I need to put some formal statistics on the document itself somewhere in the middle, like "This document contains XXX figures and YYY tables (and may be even ZZZ formulas and PPP theorems)". Is there ...
20
votes
3answers
3k views

footnote counter, would like to restart from '1' each page

I would like the footnote counter to automatically restart from '1' for each page of my document.
12
votes
1answer
1k views

Infinite-depth list

I want to create a command set that allows me to do something like \nestedlist{ \listitem An item \sublist{ \listitem A sub item \listitem Another sub item } } and get An item 1.1 A ...
17
votes
2answers
583 views

Automatically numbering constants

I would like to somehow use LaTeX to automatically number constants. Some background As a mathematician, in my daily work there are a lot of throw-away constants which are not extremely important ...