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

learn more… | top users | synonyms

0
votes
0answers
11 views

Missing number, treated as zero with amsmath and calc

This simple code produces "Missing number, treated as zero" \documentclass{article} \newcounter{test} \newcounter{testtwo} \usepackage{calc} \usepackage{amsmath} \begin{document} ...
1
vote
1answer
76 views

Command already defined (custom command)

When compiling following code, I the compiler tells me that a command is already defined (the name is \c@b...). \documentclass{article} \usepackage{calc} \usepackage{ifthen} \usepackage{tikz} ...
0
votes
1answer
40 views

Ignore numbering of some tables

I have a document with two tables. I want my second table to be Table 1 both in List of Tables and caption. \documentclass{article} \usepackage{tabu} \usepackage{longtable} \begin{document} ...
5
votes
2answers
76 views

Do section counters need to be reset if you reset chapter counter?

The answer to this question How to remove chapter numbering without removing it from tableofcontents was given as: \newcommand{\mychapter}[2]{ \setcounter{chapter}{#1} \setcounter{section}{0} ...
8
votes
2answers
147 views

Start inparaenum-numeration with another letter than “a)”

How can I start \begin{inparaenum} with an arbitrary letter (other than a)) after a break in the inparaenum-environment. I would like to let a new inparaenum-environment be related to the end of the ...
4
votes
1answer
33 views

Counter not incrementing when defining crefname with cleveref and algpseudocode

I am renaming the "line" label for lines in the algorithmic environment, since I am using the default label for lstlisting environment. As soon as I add define \crefname for it, the counter does not ...
6
votes
1answer
86 views

How do counts differ from numexpr

To do basic arithmetic on numbers, one can utilize TeX counts, \newcount\c \c=2 \advance\c 3 \typeout{\the\c} LaTeX counters \newcounter{c} \setcounter{c}{2} \addtocounter{c}{3} \typeout{\thec} ...
1
vote
1answer
45 views

Generate a sequence of dates in LaTeX

In LaTeX, I'd like to generate a sequence of dates, which repeats on Monday and Wednesday every week. The sequence should look like: Mon 3/30 Wed 4/1 Mon 4/6 Wed 4/8 ... I have tried to use the ...
0
votes
0answers
43 views

Beamer: transparency of a picture on section frame depending of section number

I'm a new Beamer user. The following code is there just to explain what I intent to do: Put on the "sectionpage" frames a picture with transparency, the transparency level being function of the ...
1
vote
1answer
53 views

How to set the counter for examples to continue from theorems?

I have the following lines: \documentclass[a4paper, 12pt, twoside]{thesis} \usepackage{verbatim} \usepackage{amssymb,amsmath} \usepackage{amsthm,amsfonts,amscd,amsrefs} ...
4
votes
2answers
100 views

How to get LaTeX to expand at the correct position?

I have a latex document which in the main part lists a number of "tasks" (for students to solve); to each task belongs a "script", however, all scripts are supposed to be printed in an appendix at the ...
5
votes
2answers
47 views

Evaluate \arabic inside \nth (1st, 2nd… in lists)

I'm trying to define the following environment: \newlist{aims}{enumerate}{1} \setlist[aims,1]{ label={~ \textbullet ~ ~ ~ ~ ~\nth{\arabic*} best ~~~ =}, leftmargin=*, align=left, ...
1
vote
3answers
121 views

How to calculate a percentage and use result in progressbar?

With the progressbar package, I want to show bars on pages depending on a counter. Progressbar works like: \progressbar{0.7} I use the calc package anyway, so I thought it should be easy to ...
3
votes
1answer
35 views

Table of Contents labels not directing hyperlinks to correct page

Being only a LaTeX novice I may have introduced a bit of customizing code renewing part formats and adjusting numberings which may have messed up the ability for hyper-references accuracy in heading ...
3
votes
1answer
30 views

Theorem sub-numbering and hyperref

I want to use sub-numbering for certain theorems. I used the solution provided in the question How do I get sub-numbering for theorems (Theorem 1.A., Theorem 1.B., Theorem 2.)?, which does exactly ...
4
votes
1answer
33 views

How create new counter that counts by order of appearance

I want to create a counter (and be able to label each time a new item of it appears) that counts problems and name them in order of their appearance, indifferent to which section they appear in. Such ...
5
votes
2answers
108 views

Appending alphanumeric character to chapter numbers

I would like to append a character to the chapter number in some cases but not everywhere. The change should also be reflected in the table of contents. The chapter numbering should look like this: 1 ...
1
vote
1answer
31 views

How to print a past value of a counter [duplicate]

I have this counter which I have defined using \newcounter{myCounter}. Printing the value of myCounter can be easily done via \arabic{myCounter}. How can I print the value of (myCounter - 2)?
6
votes
2answers
69 views

Referring to label and value of counter at that point

I'm putting together a catalogue of artworks. These are given a running Roman number, and divided into groups given letters (so A1, A2, B3, etc.). At the moment I am manually looking to see what group ...
0
votes
0answers
13 views

Indexing chapters/sections/etc with English Number Words [duplicate]

I would like to typeset chapter labels with their respective English number words, for example "Chapter One" (as opposed to the default "Chapter 1"). Here's an incorrect example using \renewcommand ...
3
votes
1answer
46 views

How can I set customized separators for theorem counters?

How can I set customized separators for theorem counters? For example in The chapter, section and number are separated with dot. How can I change these dots to other symbols? For instance how can I ...
3
votes
0answers
28 views

How to get the counter value for a reference? [duplicate]

The command \label{here} defines a label and \ref{here} outputs the corresponding representation in the text. Is it possible to get the correspondig (numeric) counter value for the here reference so ...
3
votes
0answers
57 views

Need index to display custom description environment item name

I am trying to accomplish something like in this question and this question. I have several authors contributing solutions to problems that are numbered using an externally imposed scheme, which I ...
1
vote
1answer
35 views

Keep subsection counter the same for a few frames in Beamer

I have a few frames showing the same picture in the background but adding more pictures on top of it every frame. At each new frame, the subsection counter goes up by a dot. Is it possible to keep the ...
4
votes
2answers
60 views

Setting the enumi counter under parametrized enumitem

This is a variation on two previously asked questions: Setting the enumi counter under custom enumeration with enumitem and Looking for a numbered List, with parameter, custom label and custom ...
9
votes
1answer
44 views

How do define label system with labels given by counter?

I would like to have two commands \makelabel{foo} and \referlabel{foo} to be used as in the example \documentclass{article} \usepackage{amsmath} \begin{document} \[ A \overset{\makelabel{foo}}{=} B ...
2
votes
1answer
27 views

I see unexpected characters after working with \newcount

My code: \documentclass[a4paper,12pt]{scrartcl} \begin{document} \newcount\tmpc \def\modul#1#2{\tmpc=#1 \divide\tmpc by #2 \multiply \tmpc by #2 \multiply \tmpc by -1 \advance \tmpc by #1\relax ...
3
votes
1answer
96 views

How should I handle a counter where the numbers do not have a pattern?

I am working on homework and problems are assigned from several sections of a book. For example, I have to solve problems 1, 7, 24 from section 1 and problems 2, 5, 9 from section 2. I do not care ...
4
votes
2answers
85 views

loop in tabular that uses \the\count to access current line number

I would like to generate an autmatic table using loop. As suggested here before, it is best to first generate the lines in a toks and then pass them to tabular. However, I have problems with accessing ...
2
votes
1answer
46 views

How to adjust the section numbering (as in skipping a couple of section numbers) when using letters instead of numerals for section numbering?

I have changed the section numbering from numerals to letters with the command \renewcommand{\thesection}{\alph{section})} in the preamble. For example, the first \section{} would be printed like ...
2
votes
1answer
44 views

Create a copy of the subsections counter

I'm writing a mathematics paper with \documentclass{amsart}, and I would like my theorems, definitions, propositions, etc., to be numbered "like subsections", i.e., if a given theorem is the fourth in ...
3
votes
2answers
49 views

Revisions of a theorem where numbering goes 2.0, 2.1,2.2

I would like to give different equivalent versions of the same theorem, eventually proving the last version. The first time I state the theorem, I would like it to have the number 2.0. Each successive ...
1
vote
1answer
47 views

Starting the \parts environment with a different counter in exam class

I need to be able to start a parts environment at a later counter. For instance, starting with part (b) instead of (a). \documentclass{exam} \begin{document} \begin{parts} \part this is part a. ...
4
votes
2answers
71 views

Reset counter automatically after lstlinputlisting or lstlisting

I have a number of code examples annotated with a number set by a counter, lstNoteCounter and referred to in the text below the code: My markup works, but it isn't convenient for a large document: ...
6
votes
4answers
119 views

Create row tables like for cycle from counter

I have a counter and I want to create a table with as many rows as the counter automatically. Each row should be numbered. Thanks
1
vote
1answer
39 views

Chapter counting set up

I want chapter numbering like: Chapter 1, Chapter 2, Chapter 3, Appendix A, Appendix B. But I am getting like: Chapter 1, Chapter 2, Chapter 3, Appendix D, Appendix E. When appendix chapters are ...
5
votes
1answer
105 views

What's the meaning of the command \number and when to use it? And some confusion about the following code

\setcounter{numofgaps}{\numexpr\number\value{numofboxes}-1} \setlength{\truetextsectionwidth}{\textsectionwidth-\number\value{numofgaps}\gapwidth} The above code is a snippet from the answer of How ...
5
votes
2answers
338 views

Number of Equation: 1, 1a, 1b

Following Problem: I have a PDE and two boundary conditions what i actually want is: PDE (1) BC1 (1a) BC2 (1b) and what i have is: PDE (1) BC1 (2a) BC2 (2b) is there something which provides a ...
4
votes
1answer
67 views

Definition with roman counter value

Is it possible to write a definition with a counter value? I have many definitions with a Roman numeral: \def\abcI{} .. \def\abcII{} .. \def\abcIII{} .. But this is not possible: ...
4
votes
1answer
68 views

I want to reset the question numbering under each section?

I am using exsheets to type questions and answers. When I start a new section, the question number continues from the previous one. How do I reset it it and make it start from number 1 again? Here is ...
1
vote
1answer
121 views

Calculating with different types of variables

Is there any way to calculate the height of a node in a tikz pictures and to divide a length by an another length to get a counter and to round it up? If yes where could i read after the subject of ...
5
votes
2answers
139 views

\stepcounter is not working in subsection heading

I have defined a new counter as: \newcounter{lecCounter} \newcommand{\lecID}{\stepcounter{lecCounter}\thelecCounter} And I wish to use it as: \subsection{Lecture \lecID } But it gives error: ! ...
0
votes
0answers
32 views

Beamer Counter Command [duplicate]

I am wanting to number questions in a Beamer presentation. I created the following counter command: \newcommand{\qcount}{\arabic{QCount}: \addtocounter{QCount}{1}} I have a \pause command on a ...
3
votes
1answer
44 views

running number/counter (e.g. {244}{a}) for a text

To assign a running counter to parts (not paragraphs, not lines) of a document with facing greek text and translation (finally I will use eledpar) I need a command (call it \Steph) which 1a) inserts a ...
3
votes
1answer
101 views

Converting strings to counts

I'm reading in a number (as text) from the aux file and I want to do a numerical test (\ifnum) on it. I can to it using \setcounter and \value, but I really don't want to create a counter just to do ...
2
votes
1answer
84 views

amsmath align* tampering with a counter of mine

\documentclass[a4paper]{report} \usepackage{amsmath,mathtools} \makeatletter \newcount\mw@shortcnt \mw@shortcnt=0 \newcommand{\short}[1]{% \global\advance\mw@shortcnt by +1% ...
2
votes
1answer
34 views

Set theorem counter to be Roman

I wanted to make the counter for a theorem displayed as capital roman numerals (I, II, III), but none of these attempts worked \newtheorem{test}[\Roman{counter}]{Theorem} ...
12
votes
2answers
301 views

How can I get latex to show an error message if there are too many pages?

I have a series of pdf files that I'm combining. I'd like to include as many of them as possible in the finished document, but for logistical reasons I cannot have a total of more than 50 pages. Is ...
2
votes
2answers
48 views

Numbering tables sequentially [duplicate]

I would like to number my table so that I have, e.g. Theorem 1.3 Table 1.4 Lemma 1.5 How can I achieve this result? I am also using cleveref, so ideally \cref{ThatTable} would produce a linked ...
3
votes
1answer
53 views

Manually setting chapter counter overrides TOC

I have parts for each year: \part{2011} ... \part{2012} ... etc. ... I want the chapter number to be the month of that year for stylistic purposes (e.g. like how the chapter number is shown here) ...