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

learn more… | top users | synonyms

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
36 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
56 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
38 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
38 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
56 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
81 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
33 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
25 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
60 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
60 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
98 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
233 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
53 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
26 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
94 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
91 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
70 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
1answer
70 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
258 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
37 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
70 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
58 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
222 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
92 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
64 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
68 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 ...
4
votes
1answer
26 views

Setting a counter to the value of a reference

I have a use case description, something along the lines of: \begin{enumerate} \item User does X. \item User does Y. \label{y} \item User does Z. \label{z} \end{enumerate} Then there is ...
2
votes
1answer
28 views

How to manually append a character after chapter counter?

book does not have \addtodef{\afterchapternum}{課}{} that is available in memoir. As a result, I have to manually append it. But how? I don't want to use memoir. MWE \documentclass{book} \usepackage{...
2
votes
1answer
32 views

numberstringnum{counter}: “Missing number” error

I'm experiencing problems to use fmtcount. The code bellow return "Missing number, treated as zero" error. \numberstringnum{count} \usepackage{fmtcount} \usepackage[brazil]{babel} \newcounter{count}...
2
votes
1answer
28 views

Counter always equal to other counter (at all times)

I know that \newcounter{newctr}[oldctr] will reset newctr to 0 whenever oldctr is incremented. How can I have newctr to have exactly the same value as oldctr at all times? In other words, how can I ...
2
votes
1answer
26 views

Restart footnote counter with apa6

I would like to reset the footnote counter to 1 after using some footnotes in the title page. I though the solution would be to simply \setcounter{footnote}{0} but it does not work. MWE below. \...
2
votes
1answer
39 views

On demand ad hoc counters

Is it possible to define a command \mycounter{<par>} in LaTeX which does the following: if a counter with name <par> exists then increment the value of that counter and print the counter'...
11
votes
1answer
218 views

What does the prefix “\c@” mean in build log?

I just follow the LaTeX tutorial to create the first "Hello World!" .tex file, and translate it to PDF file. Then I go through the .log file and see the following, ("C:\Program Files\MikTeX\tex\...
1
vote
1answer
131 views

How to define a new counter in the tasks package?

I want to use the tasks package, and I want to use mynum (my alphabet enumerate) to enumerate tasks. \documentclass{report} \usepackage{amsmath,tasks} \makeatletter \def\@mynum#1{\ifcase#1\or آ\or ...
3
votes
1answer
63 views

\xdef and \fnsymbol problem under TeX Live 2015/MacPorts 2015_6

I'm writing a paper using a cls file provided by the journal (which I cannot modify). They are using some tricky code for creating table notes under tables. Problem is that this code crashes under my ...
4
votes
2answers
305 views

How do I convert a character into ascii code?

I have a custom enumerator: \newenvironment{subp}{% \begin{enumerate}[label={\textsc{\alph*.}}] }{\end{enumerate}} In the environment sometimes I need to skip to specific labels, I will do it ...
4
votes
1answer
91 views

Begin equation numbering with specific number

I would like to start my equations numbering with (8.67), so I used \setcounter{chapter}{7} but using \setcounter{equation}{66} does not help. How can I start equations numbering within chapter from ...
4
votes
1answer
70 views

Problem with counters

I want to make a presentation with certain tasks, but since there are certain problems with using enumitem with beamer, I decided to make it myself, so I have this example code: \documentclass{beamer}...
3
votes
3answers
91 views

Getting the `\pageref` out from under `hyperref`

I thought I was pretty cool when I modified \ref to also print a page number when the referenced float was more than a few pages back. But I really want it to be a nice link using the hyperref package ...
4
votes
1answer
103 views

get the value of the current counter

I'd like to recover the value of the current environment counter and store it for my own uses, e.g. in the example below I'd like to store (not print) the number 1. With \@currenvir I can get the ...
6
votes
2answers
210 views

What's the way to change the size of a math symbol in plain TeX?

I find that \diamondsuit in ntxsy is too small, so I want to define a macro that will enlarge it and take into account the current font size being used. To illustrate below, I have a partial attempted ...
2
votes
1answer
101 views

Counter name of inline lists with enumitem

I am using the enumitem package and need to access the counter values after the end of the environment. With a standard \newlist{Example}{enumerate}{2} for instance, the counter value is simply ...
1
vote
1answer
64 views

Expand command in a spreadtab formula

Long story short: I'm trying to come up with a system to generate a LaTeX table dynamically from a YAML file through Pandoc and do some calculations using the spreadtab package. So far so good, the ...
2
votes
1answer
38 views

Command \alph{counter} compile error

I am trying to write a template for writing tests and homework for math classes in the familar format: 1) Given . . . a) question . . . b) question . . . Here is what I have tried: \...
2
votes
1answer
53 views

Why does my custom sectioning command crash on second run when using etoc?

Finally I have narrowed down the problem to a custom definition of a sectioning command using titlesec in explicit mode. I suspect it has something to do with me not providing an adequate counter for ...
4
votes
1answer
178 views

How to draw the clock cycle number to the rising edge?

I want to display the number of every clock cycle at the rising edge. I tried to setting a counter but it gives me this error: Package pgfkeys Error: I do not know the key '/tikz/timing/counter/new',...