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

learn more… | top users | synonyms

0
votes
0answers
56 views

How to unbind counter from its master? [duplicate]

Possible Duplicate: What is the proper method of accessing a counter? Continuous v. per-chapter/section numbering of figures, tables, and other document elements I'm using the book class, ...
7
votes
1answer
956 views

Saving and re-using value of a footnote counter twice - how?

I am trying to put the same footnote on to two different places - saving and re-using the footnote counter. Here is what I want to do (part of a larger doc - a paper out of my dissertation): %Start ...
11
votes
2answers
281 views

Counting the total number of theorems

I have: \usepackage{amsthm} \newtheorem{problem}{Problem} .... \begin{problem}...\end{problem}... ... \begin{problem}...\end{problem}... In the first page of the document, how can I know the number ...
3
votes
1answer
241 views

How can I create copies of a document with a running number?

I am making a questionnaire, to be filled out with pen and paper. I need 40 copies of it, with around 13 pages each. I expect that some participants might take the questionnaire apart, so I have to be ...
5
votes
2answers
686 views

Re-displaying section headings after page-breaks

I'd like to automatically repeat section headings after a page break. My naive attempt at doing this is to check the page counter and print the extra text whenever the counter increments: ...
3
votes
2answers
697 views

usage of \only with counter, pdfcomment and beamer class

I cannot manage to get the following command to work. I have a beamer presentation with several slides on a frame. Then I want to use the pdfcomment package to show some comments on the slides. ...
14
votes
3answers
238 views

How to determine which register a count uses

Suppose there is \newcount\c@mycountera \newcount\c@mycounterb \newcount\c@mycounterc Each \newcount uses \alloc@ and that has \wlog{\string#5=\string#2\the\allocationnumber}. Thus to determine ...
5
votes
1answer
386 views

Is it possible to remove length, counter, dim, etc that have been declared?

Let's see the following screenshot taken from an answer of Efficient ways to anonymize a document and the given comment. Is it possible to remove length, counter, dim, etc, that have been declared ...
4
votes
1answer
3k views

Chngcntr: \counterwithout not working

I need to place the tables section after my appendix. I've used \counterwithin{table}{section} to number appendix tables A.1, A.2, etc. Then I use \counterwithout{table}{section} so that the tables ...
6
votes
1answer
871 views

Trouble with hyperref when resetting the counter for equations (specifically with the align environment)

I am trying to reset a counter to zero; however hyperref tries to reference previous equations. I am using: \setcounter{equation}{0} And if I have labels in say align environments: ...
18
votes
3answers
583 views

Extracting the “parent” counter of a sectional unit

I am interested in finding the "parent" counter of a specific sectional unit. For example, in the following document structure 1. A section 1.1 A subsection 1.1.1 A subsubsection 1.1.2 A ...
1
vote
1answer
186 views

Display counters only if it is used at least two times

In this page, I've found one way to display one counter only if it is used at least two times. The problem with this solution is that it doesn't work with two counters. Is there a way to allow this ...
3
votes
1answer
232 views

Figure refs stop working after I added a new counter

I was using the amspset document class for generating exam practice problems. I had wanted to add some referencing to the problems so I started a new counter like this (adapted from some Tex Exchange ...
12
votes
4answers
355 views

Counting of selected words

I am typesetting a book, which has got more number of plants. While entering the text, I have to record the total number of plants recorded in my book. In fact, I have created an index of all these ...
9
votes
1answer
1k views

Revert (reverse) \numberwithin effect

How can I revert the action of \numberwithin{mycounter}{section} so that mycounter does not reset with a new section? Example: (This is not exactly my case but this is easy to understand.) I would ...
5
votes
4answers
1k views

Problem with a counter inside a \ul command

The following MWE gives a compilation error. If i move the \arabic{count} outside from the \ul command, it works \documentclass{article} \usepackage{soul} \begin{document} \newcounter{count}% ...
2
votes
2answers
442 views

Problems with counters and frame splitting commands and environments in beamer

Using the package gb4e for linguists in the beamer environment in combination with frame splitting commands \pause or environments overprint, I face the following problem: The number are "jumping" ...
6
votes
2answers
2k views

Save current value of counter in a command

I would like to define kind of an own index, that collects certain information and one counter value - in the following small example the \addstuff-command that may get the value of a counter as its ...
9
votes
2answers
1k views

Integer arithmetic in TeX

After many years of being merely a regular TeX (LaTeX lately) I started reading little bit more recently. I wrote a small program (very naive) which is suppose to illustrate doing integer arithmetic ...
13
votes
2answers
1k views

Displaying a later value of a counter

I have a counter which is used throughout my document. At the beginning of each chapter (right after the \chapter command), I want to print the value of the counter which is reached immediately before ...
4
votes
1answer
163 views

How do I determine the name of the counter associated with a theorem-like environment

(A question related to this one and leading up to this one.) Suppose I'm using ntheorem. I would like to have a command which determines the name (not the value) of the counter associated with a ...
5
votes
1answer
909 views

Easy-to-use reference-able environment for restating theorem-like environments?

This question is a development of the same issue as this one; following my own answer and later comment there, I decided it deserves a spin-off. I would like to define an environment for restating ...
10
votes
1answer
1k views

How to count number of lines in PDF document?

I'm using the lineno package to print line numbers (each page starts with number one) in the draft of my document: \usepackage[switch*, pagewise]{lineno} Is there a way to read out the number of ...
11
votes
2answers
274 views

Hiding a counter if it is only displayed only one time

I have two macros on my document. \showcounter increases a counter, then displays it. \resetcounter sets the counter back to "0". \documentclass{article} \newcounter{counterone} ...
13
votes
2answers
267 views

How to refer to a chapter with a word

I would like to refer to my chapters with the notation "First Chapter", "Second Chapter" etc, rather than "Chapter 1", "Chapter 2", etc. How can I do this? \documentclass{scrreprt} ...
13
votes
3answers
2k views

How can I calculate the difference of 2 counters (pageref)?

How can I calculate the difference between 2 counters (like page numbers), so that pdfLateX outputs "3" in the last line of my example? and how could I calculate the difference between the "current" ...
15
votes
2answers
330 views

A new kind of “symbol wrapping”

alphalph defines three methods for continuing a set of symbols if you hit the end. alph continues like so: a,b,c…z,aa,ab,ac… mult continues like so: a,b,c…z,aa,bb,cc… wrap continues like so: ...
10
votes
2answers
1k views

Combine two items in an enumerated list

Is there an easy way to combine two items in an enumerated list? For example: 1. First bullet 2-3. Second bullet 4. Third bullet My current plan involves screwing with \labelenumi and then ...
7
votes
2answers
266 views

Setting a counter for sections

I prepare a document where there are questions as follows and the relevant content \section*{Question 1} ... \section*{Question 2} ... \section*{Question 3} ... ... I want a counter instead of ...
6
votes
1answer
401 views

How can I reset sectional counters in memoir class to avoid breaking ToC cross-referencing in a complex document?

I have already asked a similar question here: Incorrect ToC/Index cross-references when resetting memoir class counters and received a satisfactory answer. Now, I wish to apply the chapter counter ...
6
votes
4answers
1k views

How do I make a counter start with 1?

I defined a counter like this: \newcounter{my_steps}[subsubsection] and I would like to make it start with 1 instead of 0 after each subsubsection. How?
3
votes
1answer
1k views

Defining repeated tabular/array columns using a computed value to specify the number

Background: I just recently saw that one could define multiple columns in a tabular or array using the syntax: *{num}{<align>} So, for example \begin{tabular}{r*{3}{l}r} is the identical to ...
3
votes
2answers
635 views

mdframed and ntheorem counters

In the code below, counters defined by mdframed seem to not be accessible to ntheorem environments which is problematic but ntheorem counters can be read by mdframed. I could not find a work around ...
6
votes
3answers
600 views

Odd interaction of secnumdepth and section-based counters

In the following MWE: \documentclass{book} \newcounter{exnum}[subsection] \begin{document} \chapter*{Chapter} \section*{Section 1} \subsection{Subsection A} \setcounter{exnum}{1} ...
23
votes
1answer
2k views

What are the differences between TeX counts and LaTeX counters?

The title already states the whole question. It has been answered by Joseph Wright at http://www.texdev.net/2009/11/17/tex-counts-and-latex-counters/, but I have not seen the according answer here at ...
27
votes
3answers
2k views

How to display the final value of a counter at the beginning of a document?

At the beginning of my document, I have created a counter using \newcounter. Over the course of the document, this counter is increases using \stepcounter. How can I display the final value of the ...
8
votes
4answers
453 views

Slave duplicate counter

Is it possible to create a counter that is a "slave" to another (master) counter, but also an exact duplicate? The \@addtoreset{<slave>}{<master>} resets <slave> whenever ...
1
vote
1answer
465 views

How to create a new counter for an a new environment that is in sync with subsections

I want to create an example environment with a counter which will be in sync with my subsections. So I'll have: subsection 3.2 lemma 3.2 example 3.2 example 3.3 lemma 3.3 subsection ...
2
votes
1answer
513 views

Should this combination of counters and \ifnum conditions work or does it need modification? Is there a better way?

I'm producing the final product of my thesis with LaTeX. I'm having trouble with the front matter of my thesis, specifically with getting LaTeX to recognize that if the front matter stops at a certain ...
3
votes
3answers
2k views

Table of Contents numbering in decimals?

I have created my first LaTeX document, its very small and have 4 sections. The problem is the numbering is in decimals and looks a little odd, I have searched every where, I'm sure its a simple fix. ...
6
votes
1answer
538 views

Incorrect ToC/Index cross-references when resetting memoir class counters

The quasi-MWE below uses the memoir class and works fine. It produces a document with the following structure: ToC Book Part1 Chapter1 Part2 Chapter2 Index Here, cross-references in the ToC and ...
11
votes
2answers
456 views

Middle age roman numerals formatting

I've recently read about a middle age variation on roman numerals where the last "i" character is replaced by a "j". I was thinking about writing my own \roman and \Roman variations, but hit a stone ...
0
votes
1answer
335 views

Counting letters inside paragraph

I am trying to make a new command \part which is defined such that each time I type \part the output equals \paragraph*(letter) where letter is bold. So, with typing the letter manualy in, the ...
2
votes
2answers
158 views

Cross-referencing to the number of a customized environment with a counter

On the internet I found a possibility to create an example environment that is helpful for linguistic research papers, because it provides all examples with numbers: \newcounter{exa} ...
4
votes
2answers
492 views

Numbering theorems within the innermost sectioning environment present at that point in the document?

Here is what I am trying to achieve: Chapter 1. ... Theorem 1.1. ... Section 1.1. ... Theorem 1.1.1. ... Subsection 1.1.1. ... Theorem 1.1.1.1. Is this even possible? If so, how? ...
2
votes
1answer
561 views

New sectioning level above section

I would like to create a newcounter (lectcount) which will be one level above the "section" in article class, and use its name in the headings (I am using fancyhdr). I don't know how to set the ...
30
votes
5answers
4k views

How to output a counter with leading zeros?

I can output the value of a counter in a LaTeX document via: \setcounter{mycounter}{1} \arabic{mycounter} Which inserts a 1. But how do I format the output by, for example, adding a leading zero if ...
2
votes
1answer
838 views

Refering to the same (alphabetically “numbered”) footnote more than once

Following my previous post concerning the change of numbering in footnote to temporally be alphabetical, I'm trying to merge this with the possibility to refer various time to the same footnote as ...
14
votes
3answers
9k views

Change footnote “numbering” temporarily

I would like to change my footnote "numbering" style temporally to letters (a,b,c ...) the default numbering beeing numbers (1,2,3 ...). This is needed only for specific paragraph, so I can't use the ...
3
votes
2answers
573 views

Increment custom counter with standard sectioning command?

My document is a (scr)book and I'm talking of parts and chapters here, but I think the underlying question is pretty generic. I want tables in the book to be enumerated continuously, in a ...