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

learn more… | top users | synonyms

1
vote
1answer
21 views

Delete counter for some items?

Now I have the counter which generates number sign and 2 numbers like 1.1 (for the first problem in 1st section): \newcounter{zzadacha}[section] \newcommand{\zz}{\addtocounter{zzadacha}{1}% \textbf{\...
0
votes
1answer
42 views

Counting choices in Exam

MWE \documentclass[11pt,paper=a4,answers]{exam} \usepackage{environ} \newtoks\allanswers \NewEnviron{answer} {% \edef\temp{% \the\allanswers % the previous ones \thequestion) \thechoice \...
0
votes
1answer
25 views

Counter problem for individualised appendix sectioning (Destination with same identifier)

I tried to individualise the sectioning of my appendix. I would love to have it sectioned like this: Appendix A.1 First A.2 Second A.3 Third B.1 Fourth B.2 Fifth B....
0
votes
0answers
18 views

How to use counter with \newbreakabletheorem with xeboiboites

I am using Xeboiboites to frame my theorem and proposition contents. I want theorem to continue to next page as xeboiboites allows it. I am using the following code, but only problem I have that i don'...
3
votes
1answer
24 views

Variable defined according to entire document contents

I would like to define and use a variable in my title page. This variable depends on the contents of the entire document. For illustration purposes, the variable could be a counter that is incremented ...
3
votes
2answers
152 views

Making the dot in the Theorem normal, but not as like bf

Here is MWE \documentclass{article} \usepackage{amsthm} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \begin{document} \setcounter{section}{3} \begin{lemma}[something] ...
4
votes
3answers
121 views

Different counter for equations inside environment

Let's say I have a tcolorbox environment called note. Is there a way for equations that appear inside this environment to automatically assume a different counter from those outside? With ...
2
votes
1answer
24 views

Changing numbering by chapters to continous numbering

I’m writing my PhD thesis using this template. The template offers two ways of enumerating figures, tables, and equations, namely, continuous numbering and by chapters. According to the comments ...
1
vote
1answer
12 views

Use of forloop-counter inside beamer \only

I'm using LaTeX beamer and the forloop-package to create a for loop, and I want to use the counter inside an \only-command. Here is a MWE (or more like non-working example): \documentclass[12pt]{...
2
votes
2answers
67 views

Trigger \addtocounter every frame (not slide!)

I am trying to have Beamer automatically add to the notes the total time my presentation has been running. However, the counter seems to be triggered every slide, not every frame. \documentclass[14pt]...
6
votes
1answer
161 views

Increment Counter as part of TikZ Style

I would like to increment a counter every time a particular style is applied. The MWE below compiles just fine, but the counter is not incremented. I would like to have the counter value be 3 ...
6
votes
2answers
68 views

Setting marks automatically when a counter is incremented

I want to create a dictionary-like header, where on the top left of the even page and the top right of the odd page equation numbers will be shown: on the top left is the equation number of the first ...
3
votes
2answers
36 views

Figure/Tables/Equations… counters

I'm currently trying to create a template of my own to unifiy all the documents (article class) I write for school and I'd like to change the functioning of the counters for the equations, figures and ...
5
votes
1answer
90 views

LaTeX-internal definition of \thesection

I am using a redefinition of the equation-numbering as in the MWE below. \documentclass{scrreprt} \usepackage{chngcntr} \renewcommand{\theequation}{\thesection.\arabic{equation}} \counterwithin*{...
1
vote
2answers
38 views

Reset equation counters with unnumbered sections

I would like use: \counterwithin*{equation}{section} \counterwithin*{equation}{subsection} with \section*{} because if the section is not numbered \counterwithin*{equation}{section} doesn't work ...
1
vote
1answer
35 views

Combining environment with if - statement leads to errors

I have the following MWE: \documentclass{article} \RequirePackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{lettrine} \usepackage{blindtext} \usepackage{gtrcrd} \newcounter{Cnt} \setcounter{Cnt}...
1
vote
0answers
28 views

reset counter with thmtools

I am using thmtools to display theorems in a document. The theorems are numbered within a counter that is called 'entry' (this counter is defined within a command that is called 'entry' as well). So ...
3
votes
1answer
32 views

Total pages number warning and miscalculated

The question is a follow-up to this answer. I think that the document is suppsed to display 9 instead of 8 ? also the current position of \AddAssociatedCounters{chapter}{appendixchapters} (instead of ...
10
votes
4answers
192 views

Refer to the current page number, but not \thepage, but the real absolute

I want to get the real page number. If I use \thepage, I get problems, when I change the pagenumbering. For pagenumbering gobble, it disappears, if I change from arabic to roman, it resets the counter....
1
vote
0answers
33 views

Reset question numbering in exam class without affecting grade table

Purpose: I need to create a document that contains multiple individual exams. I have already applied heavy customisations to the exam class so I wish to continue using it rather than having to start ...
0
votes
0answers
18 views

Theorem does not work after MikTeX update; no counter defined [duplicate]

The following stopped working after I updated MikTeX today: \documentclass{article} \usepackage{amsthm} \usepackage{hyperref} \usepackage{cleveref} \newtheorem{definition_}[equation]{...
1
vote
1answer
39 views

Use \nopagebreak (or similar) in supertabular

I'm trying to add multipages tabulars with counters in tabular tail. I first tried longtable but as it generates head and tail before the table content I can't use counters. So I used supertable who ...
2
votes
2answers
94 views

List of Unused \newbox, \newcount, \newdimen, \newskip, etc

Want a appropriate command to list out unused Box, Counter, Dimension, Skip from the CLS/STY file.
1
vote
0answers
44 views

Tex Live 2016 bug: “! LaTeX Error: No counter 'd' defined.” [duplicate]

I have a file which compiles fine with TeX Live 2015, but which bugs on TeX Live 2016. When compiling with TeX Live 2016, (after I clean up all the non-source files) I get the following error: ! ...
1
vote
1answer
27 views

Reset footnote counter by section with footmisc [duplicate]

I would like to reset my footnote counter for every section in my article, and I am using the footmisc package. I have seen the perpage option, and similarly there are questions on how to achieve this ...
4
votes
1answer
42 views

Using regular theorem environments along with tcolorbox theorems

I am using tcolorbox to draw coloured boxes for my theorems, however for things like a remark, or an example, I would like to have the usual amsthm kind of environment, without any colored boxes. If ...
1
vote
1answer
67 views

Using counter in csdef

I'm trying to implement a map: counter => string + another_counter: 1 => eq1 2 => eq2 3 => ineq1 ... I use \csdef like this: \csdef{probName\thecntProblem}{\csuse{filePrefix}\arabic{...
1
vote
0answers
35 views

How to make the footnote starting from \dag? [duplicate]

The default sequence of symbol footnote is *,\dag,\ddag,... How can I make the footnote starting from \dag, i.e., the sequence \dag,\ddag,...? Thanks in advance. (I have the package \usepackage[...
1
vote
2answers
42 views

Counter in section title, table of contents increases it

I'm trying to add a counter to subsection titles. For example: Design tests 1.1 Test 1. A test 1.2 Test 2. Another test Functional tests 2.1 Test 3. Yet another test The problem is, since the ...
0
votes
1answer
33 views

How can I add a counter for my own command that is also printed?

I use the following code to draw a box with a warning sign, the word warning and the content text. The task is now to numerate the warnings. How can I print this? For example if my warning appears in ...
2
votes
1answer
36 views

Count up number of items in each section

I have a numbers of sections and subsections that have continuous enumeration (i.e. if the first section stops at 4, the second section starts counting at 5). As given by the following: \section{...
3
votes
1answer
23 views

Testing value of current footnote number

How can I test the value of a counter? For instance, can I do something like \ifnum\counter{footnote}=1 (which doesn't work)?
2
votes
0answers
51 views

Bar graph with elements from the document

In my document, I define some elements which all have a number (from 1 for the first to n for the last one) and a level (1, 2 or 3). At the end of the document, I'd like to create a bar-graph with ...
3
votes
2answers
64 views

Subequation: Counter too large

I have several parent equations each with more than 30 subequations. When I write it normally with subequation command, I receive "counter too large" error. I found out that there is a package named "...
3
votes
1answer
36 views

Use temporary length \dimen255, temporary count \count255

This Question is mainly important for package writing: I read in the TeX-Book that \count255 and \dimen255 are traditionally used for temporary. Now the number of registers has risen (see this ...
7
votes
3answers
100 views

Extract correct counter value of a reference

Somewhere in my document there is a theorem labelled theoremA that has the number 2.21. Later, I want to set another counter to that specific number 21. First, I tried \setcounterref{newcounter}{...
4
votes
1answer
50 views

Hyperref referring to the wrong label

I have this code in LaTeX and I am dealing with some dynamic work with labels and references. This code works - first reference references to the first text and second to the second but I want to ...
0
votes
0answers
15 views

How can I avoid a longtable to be counted? [duplicate]

I use longtables to add Notes to my document. These notes shall not be counted. Can I tell longtable this (similar to \chapter* instead of \chapter)?
2
votes
2answers
31 views

Programmatic Table Building Error

I am trying to build a variable size table programmatically. All the logic works separate from the table commands, and the table commands work separate from the programmatic logic, but somehow when I ...
0
votes
2answers
33 views

If condition controlled with a loop variable

I want to print some images according to a variable being changed in a loop: if variable group is 1, then the image should not be printed. But if the value of group is 2, then the image should be ...
1
vote
1answer
44 views

Cross-referencing between different files with counter [closed]

I have the same problem in this question: Cross-referencing between different files The solution is ok, but in my label i have a counter and the compiler return thats: ! Missing number, treated ...
2
votes
1answer
35 views

Title with counter for Listings

I am trying to add a title with counter to my Listings. This is what I have so far: \usepackage{listings} \usepackage[many]{tcolorbox} \tcbuselibrary{listings} \newtcblisting[auto counter,number ...
2
votes
1answer
102 views

How to count the total number of subsections within a section? [closed]

How can I count the total number of subsection within each section. Actually, both section within each chapter, and subsections within each section for the article class. Based on this post I have ...
3
votes
1answer
92 views

In CONTEXT, how can I get the total number of chapters?

For total number of pages, one can use \lastcounter[userpage] to get the total number of pages in the document. Actually it gives the number on the last page (which is more interesting). Similar ...
6
votes
2answers
76 views

counter in TOC fails when using xparse command instead of LaTeX2e command

Here I define a custom sectioning command, \Unit, which prints a numbered subject heading and adds it to the table of contents. If I use \newcommand for the command that creates the numbered label, ...
3
votes
2answers
28 views

Can I reference a number relative to a counter without changing the counter?

I have a counter called LCount, which I want to use in some text, and i would like to be able to reference numbers that are relative to that counter. for example, I would like this LaTeX code: For ...
2
votes
4answers
86 views

Setting a counter value based on a conditional statement?

I've been trying to google and this seems like a silly thing that should be obvious, but everywhere I look is answering how to use counter values inside a conditional statement, which I can do fine. ...
1
vote
1answer
63 views

How to reference a chapter after using the \setcounter{chapter}{0} [closed]

I'm trying to create a reference the appendix. The appendix package is resetting the chapter and section exectly like I do and I started to notice this bug while using it... So I use the \setcounter ...
2
votes
1answer
51 views

Problem Splitting Very Long Algorithm on two or pages

In the example below, I have a very long algorithm, probably spanning 3 pages. I tried manually splitting the code up, but each time, a new algorithm number is generated. How do you maintain the ...
2
votes
1answer
53 views

Number formatting, addtocounter and calc package

I have been having troubles with the following issue: I am making an invoice template in LaTeX. I use \addtocounter to calculate values like subtotal, tax and total. This works fine, until the value ...