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

learn more… | top users | synonyms

1
vote
0answers
71 views

No room for a new \count [closed]

I'm compiling an absolutely massive project for the first time on a new computer (using xelatex main.tex). It worked fine on the last computer I built the pdf on, but on this machine, I get the error ...
1
vote
1answer
45 views

hyperref points wrong figure/table with reset counter

I am trying to refer tables (and figures) in the main text with numbering modified and reset as shown in MWE, the numbers are correct in the main text, but hyperref points to wrong table. How to get ...
2
votes
1answer
19 views

Figure counter is not incrementing after use of paracol

I am using one column environment to write text and put figures with their captions. At a certain point I had a longitudinal figure to integrate so I wanted to put its caption laterally by using ...
5
votes
2answers
117 views

compare a value from \newcounter to value from \newcount

I searched for this topic, but I didn't find anything, so I hope this isn't a duplicate. I've got the following code: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[...
4
votes
3answers
80 views

Change counter in \edef

When I try to change a counter in an \edef using \stepcounter, I get a whole lot of error messages ("Missing \endcsname inserted"). When I try to do the same with \addtocoutner I get no error, but the ...
5
votes
3answers
318 views

Is there a reverse \alph?

Is there a command that does the reverse of \alph, i.e. takes a letter and gives me the corresponding number of the letter in the alphabet? If there is, how about \Alph, \roman or \Roman? Context: ...
1
vote
0answers
49 views

Problem in combination of longtable and stepcounter{rowcount}

I am making a longtable consisting of 3 columns: linenumber of the text in the table, column with a short abbreviation and a column with possible a lot of text. Since the third column contains a lot ...
3
votes
1answer
62 views

Increment counter with name based on input

I have different counters, and I want to increment them. After I do not want to increment them separately, I wanted to write a macro which does that for me, depending on the input. I have the ...
2
votes
1answer
17 views

Forcing \alph to latin symbols in a multilingual document

If I use \alph{..} inside a hebrew block in a XeLaTeX document, I get a Hebrew numeral instead of a latin numeral. For example: \documentclass{standalone} \usepackage{polyglossia} \...
3
votes
2answers
60 views

Creating new counter formats on-the-fly with enumitem's \AddEnumerateCounter*

Aesthetic caveat: I am actually using small-caps with hanging figures and not lining. However, in creating a minimal example, I have succumbed to the defaults and created a typographical monstrosity. ...
3
votes
1answer
33 views

How do I have two different chapter numberings going on at once?

I am writing a strange textbook that needs each chapter in Chinese and then one English, all in the same book. I need there to be two chapter ones, two chapter twos, etc. The zhnumber package has all ...
1
vote
0answers
17 views

Change label in align environment [duplicate]

In LaTeX, I'm using the documentclass report with different chapters. Now, when using the align environment for listing formulas with labels, i get labels like (2.1), (2.2), ..., the first number ...
1
vote
0answers
37 views

How to properly use a counter value in zref command

I am trying to expand on the answer to this question in order to automatize the creation of position markers with zref. I guess I am missing some important knowledge about how counters are printed. ...
4
votes
3answers
300 views

How to increment variable by using same variable?

How can I increment variable from the same variable? \pgfmathsetmacro\S{5}; \pgfmathsetmacro\S{\S + 1};% not working How can I work around this? I need counters which I use as line coordinates ...
3
votes
3answers
77 views

Numbering sections, subsection, subsubsections

I'm using the class book and for each chapter, section, subsection, etc. the numbering starts this way: Chapter 1 Section 1.1 Section 1.2 Section 1.3 . . . I would like to have ...
1
vote
0answers
15 views

number the equation without section or chapter [duplicate]

i want to number the equation without the number 2 in the image please \begin{equation}\label{N} (Nu)(x,y)=\mu(x,y)+\frac{1}{\Gamma(r_1)\cdot\Gamma(r_2)}\displaystyle{\int_{1}^{x}}\displaystyle{\...
2
votes
3answers
61 views

includegraphics with leading zero in for loop

I would like to include graphics which have a filename with leading zeros. The filenames are: pic_001_test.png pic_002_test.png . . . pic_028_test.png I'm able to output leading zeros in a \...
2
votes
1answer
27 views

Changing the printing of a counter only in references

I have the following problem : I have a counter (in my case enumi) that I want to use for referencing with a different name than when it is appears first. Is there a tool in Tex/Latex to do this? ...
4
votes
2answers
85 views

Exsheets print subsection counter?

When defining a counter format in exsheets I can use ch for chapter, se for section orqu for question. But how can I reference to the subsection counter? I can do: \SetupExSheets{counter-within={...
0
votes
1answer
83 views

Theorem numbering as subsections and automatic solutions

I have a problem environment where the counter is coupled to the subsection counter. However this doesn't work with automatic solutions. I tried to couple the solutions counter to the subsections as ...
2
votes
1answer
36 views

Cross Reference of Environments

I defined a personalized table environment as follows: \newcounter{Table}[section] \newenvironment{Table}[1][]{ \refstepcounter{Table} \newcommand{\tbtitle}{#1} \begin{center} } { \vspace{0.3cm}\\\...
2
votes
1answer
37 views

Using minutes package, how to change the minutes numbering

To create my minute report, I used following template : http://texdoc.net/texmf-dist/doc/latex/minutes/Sample.tex that I heavily commented because my needs are very basic, but this template is still ...
4
votes
1answer
58 views

Numbering Theorems with section number but not resetting the counter

I want to number theorems in the form "Theorem 1.4.26", such that the first two numbers are the chapter and section numbers and the last one is the number of the theorem in the whole book. That is, ...
1
vote
2answers
39 views

Removing 0 from Table of Contents

I'm trying to create fancy chapter headers using KOMA-Script, and one thing that I've noticed is that the table of contents is always numbered 0 because I'm accessing the chapter counter. Is there a ...
1
vote
1answer
43 views

\addcontentsline{toc}{section} lists incorrect number

Using the report class (no option to change this), I'm trying to accomplish this format: Chapter > Scenario (section) > ScenarioTask (section) where each chapter starts with a Scenario that is a \...
4
votes
1answer
58 views

(is there/how to make) a package/macro like `enumerate` but for whole document sectioning

I just discovered the enumerate package, what excited me because some time ago I was wondering about something similar (options where a stands for \alph{<counter>}, A for \Alph{<counter>}, ...
2
votes
2answers
41 views

Document with a given number of pages

I would like to create a calligraphy practice book filled with dotted lines but with a given number of pages i.e. 16 or 32 or 64. Any suggestions? \documentclass[a4paper]{article} \usepackage{...
3
votes
1answer
90 views

Calculate amount of figures [duplicate]

Is there way to automatically calculate amount of figures, tables and appendices? I found a way to see what pages have figures(Automatically determine numbers of pages with figures ), but how to ...
3
votes
1answer
34 views

Print the value of an \addtocounter as it is added

In the following example, I want the resulting pdf to show the values of 300 and 500, but they do not print. \documentclass{article} \begin{document} \newcounter{fund} \newcommand{\fund}[1]{\...
2
votes
1answer
26 views

per-section figures in un-numbered sections

I'm trying to write a document with un-numbered sections (i.e., \setcounter{secnumdepth}{0}) and numbered figures, with the figures numbered within section. I can't get secnumdepth and chngcntr to ...
2
votes
2answers
63 views

Save value of dynamical counters

I would like to get the following items organization: section A category 1 item 1.1 item 1.2 category 2 item 2.1 section B category 1 item 1.3 item 1.4 category 2 item 2.2 item 2.3 ...
1
vote
2answers
61 views

syllogism package new counter

With \syllogC, from the syllogism package, the user includes an automatic numeration for the syllogism. \syllogC{Every man is mortal} % {Socrates is a man} % {Socrates is mortal} will produce ...
1
vote
1answer
44 views

`\mainmatter` changes counter format to default with `memoir`

Adding \mainmatter in the following code clears the counter format for figures. Is there a way to keep both \mainmatter and the new counter format? \documentclass{memoir} \usepackage{graphicx} \...
2
votes
1answer
52 views

How can I change the appearance of the “figure” counter?

In the following code the figure number is shown as 1.1. How can I change the figure number format to 1-1? \documentclass{book} \usepackage{graphicx} \usepackage{caption} \begin{document} \chapter{...
4
votes
2answers
99 views

Conditional dependence of counters

Consider two counters A and B and the initial value of B is the same as of A. \newcounter{A} \newcounter{B} \setcounter{A}{1} \setcounter{B}{\theA} Consider the commands setA and setB to change ...
5
votes
1answer
241 views

How can I define my own sequence of symbols for a new counter style?

I know I can change a counter style as this: \renewcommand\thechapter{\Roman{chapter}} (The above command will make chapter numbers be written in upper case roman numerals) However, according to ...
1
vote
2answers
61 views

lncs - Changing the counter for a specific environment

I am using the llncs document class and I need to set the counter for the environment 'remark', so that when I use \begin{remark} ... \end{remark} I obtain Remark 1 wherever I am in the document. How ...
2
votes
1answer
27 views

Use arithmetic of counters inside \cline

I have a custom counter \myCounter set to, say 3. I need to produce such a table: The following code does not work: \documentclass{article} \newcounter{myCounter} \setcounter{myCounter}{3} \...
3
votes
2answers
99 views

Number of pages in preamble

I have tried this to use the number of pages as an option to a package: \documentclass{article} \usepackage{lipsum} \usepackage{lastpage} \usepackage{refcount} \newcounter{mylastpage} \...
1
vote
1answer
108 views

Local equation numbering inside proofs

According to the question asked here and a possible suggestion to the problem which equations should be numbered given here I want to ask following question; I find it a good solution to number all ...
1
vote
0answers
73 views

How to solve the error: No counter 'sectionpage' defined [closed]

I'm trying to use this answer from a previous question to get frame numbers in a table of content in a beamer presentation made in RStudio with R Markdown and knitr (see file below; in in_header.tex ...
4
votes
2answers
72 views

Reset counter via macro with \ifcase in Plain

I am not able to reset a counter to zero using a macro in Plain TeX. This code uses \ifcase and the counter animalnum to output one of a list of animal names, incrementing the counter each time it is ...
3
votes
3answers
271 views

How can I test the value of two counters?

I'd like to test the value of counters (preferably as vanilla TeX as it gets). \documentclass{article} \newcounter{counterA} \newcounter{counterB} \setcounter{counterA}{2} \setcounter{counterB}{2} \...
1
vote
1answer
40 views

Change equation number to reset at part

I would like the equation numbers to run through chapters and reset at a new part. I have tried this but it doesn't seem to work. I have tried the following shown below however it still resets with ...
2
votes
1answer
74 views

Roman numbering > setcounter to zero > hyperref confused in pdf bookmarks

I have the following problem: For my Master thesis I want to create some sections with a \Roman numbering (for toc, lof, lot, appendix...) and some with \arabic numbering (for the main text part). My ...
3
votes
1answer
59 views

Global counter on first page [duplicate]

Is it possible to have a global counter that can display its value on the first page? From what I can tell, the only way is to display on the last page after compiling.
5
votes
3answers
224 views

How to reference chapter names that include counter output?

I want to use a counter in some chapter names, this works fine for the TOC and in the chapter names themselves, but references to the chapter name appear to use the counter at the time of the ...
4
votes
2answers
103 views

Hide counter for exsheets solution environment

I am using counter-format=se.qu. for my questions which gives the following output In my case I want to hide the counters from solutions (so that I only get Lösungsvorschlag. there without the 3.1) ...
4
votes
2answers
73 views

Reset counter at beginning of proof

My goal is to get a new claim environment which automatically numbers. This is fine - I can make a counter, define a claim environment and claimproof environment which number automatically, and this ...
1
vote
1answer
69 views

Create macro depending on counter at point of definition

I have a document with various numbered objects, e.g., term rewrite systems with numbered function symbols like this: While I need a numbered output for these symbols (it should illustrate the ...