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

learn more… | top users | synonyms

1
vote
0answers
40 views

Reset equation numbering after each section

I would like to reset equation numbering after each section or subsection. Right now I use \setcounter{equation}{0} I saw in another page you could also reset it by adding the following line to the ...
3
votes
1answer
11 views

\stepcounter does not work in \item optional argument

I need a simple enumerate list with a custom label but I can't use the enumitem package. \documentclass{article} \newcounter{mycounter} \setcounter{mycounter}{1} ...
4
votes
1answer
56 views

Enumerating tabular data

How do you enumerate tabular data like this? a) stuff stuff stuff b) stuff stuff stuff c) stuff stuff stuff I considered making a table then using a counter: ...
1
vote
1answer
31 views

Removing the step numbering from cuisine package

I would like to remove the step number from the cuisine package. That is the 1 that appears in the left side of the ingredients in the following code: \documentclass[]{article} ...
4
votes
1answer
28 views

Defining xkeyval keys within a loop

I have a project for which I make extensive use of the great xkeyval package. However, I'm still struggling with some more extravagant things. For example, I want to use enumerated keys (key1 to keyN, ...
0
votes
1answer
32 views

Want page numbers to increase by 2 instead of 1

Does anybody know of a way to change the page number counter so that it increases by 2 instead of 1? I tried writing \newcommand{\anewpage}{\newpage} ...
2
votes
1answer
23 views

array: incrementing in an array with a prescribed rule

From an earlier post, tabular environment: incrementing the headings, I learned some of the basics of incrementing a counter in an array. However, I don't know enough yet to set up a counter for the ...
5
votes
2answers
83 views

Defining special counter

Theorem counters can be set to zero automatically on changes of chapter, section, or subsecion, by the second optional argument of \newtheorem (e.g. \newtheorem{foo}{Foo}[section] produces a theorem ...
2
votes
2answers
110 views

Number of row in a tabular

Is there a simple way to get the number of rows of a given tabular ? More precisely, I have a variable \t@b which contains something like foo & bar \\ foo & bar \\ foo & bar I will ...
3
votes
2answers
22 views

References for asparenum enviroment with counters dependable from section

guys! I'm writing math lectures using my own enviroment for definitions: \newenvironment{mydefs} {\begin{asparaenum}[\P\slshape\thesection.a]} {\end{asparaenum}} So every definition is numbered ...
5
votes
1answer
53 views

How do I feed evaluated references into this sorting routine?

Below is some code I cobbled together from examples found on the net. I would like the sorted list routine to use the results of evaluating \ref rather than using the literal argument of \ref. ...
5
votes
1answer
39 views

Passing current counter value to stack data structure

I'm trying to combine a stack data structure with a \newcounter{} definition so that I can automatically pair together a collection of points scattered throughout my text. Each point is either ...
2
votes
1answer
36 views

How to change \thepage when using alphalph?

The following MWE, in which I'm trying to change \thepage in order to show both the chapter number and the page, does not compile if the alphalph package is loaded. How should it be done? ...
0
votes
0answers
22 views

Figure numbering without section number, problem with subfigure

My requirement is as per the sequence number of the figures a document e.g. 2 (a) 2 (b), but the number is showing 5.3 5.3 9repeated), as it is written in 5th section.
0
votes
1answer
40 views

How to keep increasing counters for content that is (optionally) hidden?

I have a framework for creating exercises, where the content of the solution to each subproblem is fed into a \solution-macro, which only displays its content if a global boolean is set to true. What ...
5
votes
3answers
153 views

New counter that can be referenced

I have created a method \makeExample that creates a new counter called example. Can you tell me how I can modify it, so that I can make references to the example counter? So that I for example can ...
4
votes
1answer
62 views

Pause framenumber

I have some slides in Beamer and I would like to stop the counter of the number of slides at some point: in the example below, instead of getting 1/5, 1/5, 2/5, 3/5, 4/5, 5/5, I would like to have ...
3
votes
1answer
28 views

Hyperref stops zref from picking the appropriate counter

zref's counter module allows one to track which counter was (ref)stepped, similar in functionality to autoref. The property keeping track of this counter is aptly called counter. Consider the ...
5
votes
1answer
85 views

Counters incremented too many times in a beamer presentation with overlays

It seems that a frame with overlays in Beamer needs to be processed multiple times. The problem is that a counter that should only be incremented once is incremented more than expected. How to avoid ...
3
votes
1answer
48 views

How do I reset the footnote cross-referencing counter for each chapter?

I am writing my thesis in the document class scrbook, and have the footnotes counter set to start again from 1 in each chapter. However when I reference a source more than once within a chapter, it ...
5
votes
1answer
63 views

Defining a command that conditionally defines/checks for counters

In order to complete one custom package command I needed an internal macro, I called it \@test@count{❬argument❭}, and should accomplish the following: Internally defines a new counter \❬argument❭ ...
3
votes
1answer
78 views

Use the counter value as an argument

Do you know a simple way to use the current counter value to call the argument in a macro? In myPackage I have this Note: I have the for loop defined as % ...
1
vote
0answers
30 views

ExerciseSelect with counter as key

I would like to use ExcerciseSelect to choose some questions in order to create different assignments. I have more than 140 different questions. Ideally I would like to make something like student 1 ...
5
votes
3answers
94 views

list of newcounter

I've set up a newcounter in a LaTeX document: \newcounter{example}[section] \newenvironment{example}[1][]{\refstepcounter{example}\par\medskip \textbf{Example~\theexample. #1} \rmfamily}{\medskip} ...
3
votes
1answer
75 views

Increment counter only if no page break occurs

I'm trying to create a form that contains a series of test instructions, each of which are represented as minipages and take up between 1/3 - 1/2 of a standard A4 page. What I'd like is to be able to ...
1
vote
2answers
78 views

refstepcounter in tcolorbox option

I want to increment a counter and update the current label in the phantom key of the tcolorbox environment, but it is not working, as can be seen in the example below: \documentclass{article} ...
5
votes
2answers
110 views

Counter inside a tikz tree

I would like to increment and print counter at some node of tikz tree. I am able to do it when the tree grows to bottom, but not when it grows to left. My problem is that couter must be increment ...
1
vote
0answers
61 views

Is there a counter or variable that can be used to store numbers with decimals?

I'm working on an invoice document which has a "Grand Total" at the end of the document after some rows of invoice items. As such, I need to keep a running count of the total for each row. Using the ...
7
votes
2answers
190 views

Associate counters — stepping (many) counters simultaneously

This is (perhaps) not a real question and there maybe already an answer to my proposition/request. The situation There are packages that provide the number of the last page (i.e. lastpage or the ...
0
votes
0answers
13 views

How to add the total marks using probsoln [duplicate]

I am trying to add the total marks at the end of an exam paper using probsoln. All the questions are in a seperate file and I just use \loadallproblems to add them to the exam paper. I add the number ...
0
votes
1answer
44 views

Label counter in loop

I want to label my figures like this: \label{fig:scatterysX} Where is x a number which changes to some kind of step counter (numeric). I tried \newcounter{foo}, \stepcounter{foo} in the loop, and ...
4
votes
2answers
78 views

Change \part counter to text: from I to ONE

I have included the \part command into my dissertation in \documentclass{report} which automatically uses Roman numerals: I, II, etc. as its counter. Is it possible to change these to text/string ...
3
votes
1answer
70 views

Is there a way to know how often latex has already run? [duplicate]

A few days ago, I have seen an example of a latex file, that did conditional \defs on subsequent runs but I can't find that one again. I still remember that it was by looking into the \jobname.aux do ...
4
votes
1answer
29 views

How to have only 1 space between a word and a counter [duplicate]

I am using the following counter: \newcounter{foo} \newcommand\num{ \refstepcounter{foo} \thefoo.} Two (2) spaces are automatically inserted between the preceding word and the counter ...
1
vote
1answer
61 views

\setcounter{} destroyed my file, it does not compile any more

I was doing \paragraph to include a third subsection but my third subsection came out not numbered at all. I got help from someone suggesting me to use setcounter (see my related question: Is there a ...
4
votes
4answers
134 views

Count points per task

We have a cooperate design template for exams. The disadvantage is, that we have to count the point for each task manually. My idea was to this automatically with counters. What I am looking for: ...
4
votes
1answer
69 views

Automatic tabular cell switching

Now I want to automatically switch cols and rows by counting. I have already pinned the issue down to the alignment character &: \newcounter{myRow} \newcounter{myCol}[myRow] \setcounter{myRow}{1} ...
2
votes
1answer
29 views

Printing value of a unique counter outside mdframed

I have defined commands for a unique counter, i can retrieve the values if the counter unique name is not defined inside mdframed, what could be the problem, i cant seem to retrive the value if ...
3
votes
2answers
61 views

Problems with TeX scoping [duplicate]

If I use \global\advance\itemno by 1% \ifnum\itemno=4\the\itemno\fi I get 5. If I use \global\advance\itemno by 1% \itemno=\itemno% \ifnum\itemno=4\the\itemno\fi I get 4 as expected. Why is ...
8
votes
1answer
184 views

Maximum number of counters am I allowed to make/have?

I'm currently working on generating the pentest-reports of the company I work for with tex. I came across the totcounter package which I use for the overview table of the findings. there i'm adding ...
3
votes
2answers
43 views

how to no counting the cover and the abstract pages?

I was vieweing posts but, I can´t find the solution. I have a cover, an post-cover page, and an abstract page. How can I do to starting counting on the next page?
7
votes
1answer
76 views

Generate automatic revision's numbering tabular

Situation I have to make a cover template for a document. At the end of the page, I have to add the revision number with other useful info like this example: \begin{tabular}{lccl} Revision 0 ...
3
votes
1answer
46 views

How to change enumerate style in GSM package

I used GSM LaTeX package of AMS to write a book, in which the enumerate environment gives the result as follows: (1) If blah blah blah. (2) Else blah blah blah. (3) Or blah blah blah.... I want ...
5
votes
2answers
54 views

Corollary counter in SVmono

When using the predefined Theorem and Corollary commands using the Springer template svmono, the theorem and corollary counters are different. How can I make the counters match? The desired effect ...
3
votes
1answer
50 views

How to reset all counters at once?

I have several environments in my .tex file. I'd like to know if there is a way to reset all counters at once? To clarify what I mean, suppose we have environments theorem, proposition, etc., and ...
4
votes
3answers
91 views

Advanced hierarchical counting for theorems

I want to number successive theorems with hierarchical counting (top level counter n, sub level counter m) in a way that I can chose from the following options for each theorem: Theorem n. ...
3
votes
1answer
55 views

Subtheorems with alphabetic number

I would like to create a list of tasks using LaTeX. Therefore I created a theorem called task. For some tasks I would like to create additional subtheorems using alphabetic numbering. Currently my ...
3
votes
1answer
66 views

How do you automate the creation of titles from section titles in beamer?

I want to automate the creation of titles in beamer such that an environment Frame sets the title to this pattern <current-section> (<frame-number>) where <current-section> is the ...
2
votes
2answers
73 views

Automate a running counter through a document

The following minimal example demonstrates my situation: \documentclass{article} \usepackage{calculator} \newcommand{\pts}{0} \begin{document} \ADD{\pts}{3}{\pts}\pts \ADD{\pts}{3}{\pts}\pts ...
3
votes
1answer
30 views

How to make some visible effect on the output file of a document “invisible” or non-effective while fulfilling its “invisible” function?

Are there any commands/packages/environments that can make some code that has a visible effect in the output file as if it were not written but fulfilling its internal function? For example, ...