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

learn more… | top users | synonyms

5
votes
1answer
191 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
19 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
23 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
44 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} ...
3
votes
2answers
294 views

How can I create copies of a document with a running number?

I am making a questionnaire, to be filled out with pen and paper. I need 40 copies of it, with around 13 pages each. I expect that some participants might take the questionnaire apart, so I have to be ...
1
vote
1answer
42 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 ...
5
votes
3answers
151 views

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

I would like to generate an automatic 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 ...
5
votes
1answer
141 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 ...
5
votes
1answer
139 views

macro for glossaries counter

I want custom my glossaries, and specially I want to have something like My glossary entry, its signification (see p. 1), if this entry mentioned only once or My glossary entry, its signification ...
1
vote
0answers
41 views

How to solve the error: No counter 'sectionpage' defined

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 ...
1
vote
1answer
108 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 ...
4
votes
1answer
61 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
206 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
24 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
42 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 ...
4
votes
1answer
162 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 ...
8
votes
3answers
581 views

Command that changes its definition the nth time it's used

I need a command to behave differently the first time than the next times it's called. Right now I use \newcommand\foo{First\gdef\foo{Next}}, that is, it redefines itself the first time. Moreover, I ...
3
votes
1answer
50 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.
1
vote
1answer
58 views

Is it possible to call/reference sagetex within a latex command?

I'm doing a few projects in which it would be very helpful to get some numbers from a sagetex environment, and then directly using them within latex. I know Latex isn't great at storing ...
1
vote
1answer
100 views

\setcounter{section} numbering not working

Here is what I am working with: \documentclass{amsart} \newcounter{mysection} \let\realsection=\section \renewcommand\section[1]{\refstepcounter{mysection}% \subsection*{\themysection.\space #1} } ...
5
votes
3answers
194 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
57 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) ...
5
votes
2answers
42 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 ...
9
votes
3answers
335 views

How to count cells in tabular (horizontal and vertical)?

Thank Herbert, I have a part of code with list of students and presence at lesson. Now I need counting cells horizontal and vertical in table. And counting rows too. Thank you for helping me. I am ...
1
vote
1answer
60 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
2answers
2k views

Resetting newtheorem counter

This one is probably straightforward, but I'm not missing something with the newtheorem environment and using newcounter. I would like a new environment on its own counter like "Environment M.1", but ...
4
votes
1answer
20 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
24 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} ...
2
votes
1answer
25 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} ...
2
votes
1answer
26 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
20 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
35 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 ...
11
votes
1answer
181 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 ...
1
vote
1answer
38 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
54 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
283 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
66 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: ...
4
votes
1answer
65 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
77 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 ...
24
votes
1answer
3k views

What are the differences between TeX counts and LaTeX counters?

The title already states the whole question. It has been answered by Joseph Wright at http://www.texdev.net/2009/11/17/tex-counts-and-latex-counters/, but I have not seen the according answer here at ...
3
votes
3answers
65 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 ...
6
votes
2answers
192 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
61 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
51 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
32 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
40 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
127 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 ...
3
votes
1answer
76 views

Cross-referencing to included PDF with counter and argument in the label

I would like to use the following code for including PDF documents in my LaTeX document: \documentclass[12pt,a4paper,fleqn,parskip=half]{scrartcl} \usepackage{lscape} \usepackage[latin1]{inputenc} ...
3
votes
1answer
185 views

Number and reference paragraphs

For "law-documents" you often want to enumerate every paragraph and cite them somewhere else in your document. This enumeration shall increase through the whole document and have the possibility to ...
9
votes
2answers
245 views

How to assign TWO parents to LaTeX counter?

I am working on a own LaTeX (using KOMA-Script) class, based on scrartcl. The document structure is supposed to provide sections and subsections, as well as own environments (exercises, solutions, ...