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

learn more… | top users | synonyms

0
votes
0answers
9 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 ...
4
votes
2answers
72 views

Resuming a list (for nested lists)

I'm trying to resume a list by storing and restoring the counter. This works fine (as described here), but I fail to do it for a nested list. Here's my code: \documentclass{article} ...
1
vote
1answer
22 views

exercise package; how to get counter for a custom exercise type to increment with memoir sections?

Just started learning LaTeX, because I'm trying to write a short math book. I started out using LyX, but ultimately I want more control over the typesetting, so I have to learn LaTeX. Anyway, I want ...
4
votes
2answers
20 views

Creating a new float environment without the numbering but still displaying the float type

So I would like to create a new float environment using the float package (for example) but without a counter: \documentclass{article} \usepackage{float} \floatstyle{ruled} \newfloat{afloat}{t!}{log} ...
4
votes
1answer
113 views

Starting counter from 0

I'm working on a sheet of exercises using LaTeX. I've set up my sections to look like Exercise # | <title>. How can I force the section counter to start from 0, so that I can have an exercise 0 ...
5
votes
1answer
94 views

How to define a new counter independent of section

I am trying to create exercises within a paper, by which the numbering will be as one would expect (1, 2, 3, ...). However, when defining a new counter and theoremstyle: \documentclass{article} ...
6
votes
3answers
108 views

How to mark equation number but not change the reference text?

I would like to mark a few equations as special by adding an asterisk (or some other symbol) to the equation number. I accomplish this as follows: \documentclass{article} \usepackage{amsmath} ...
3
votes
3answers
66 views

Saving counters

Consider the situation: Two authors A,B (in fact, it will be four) inserting comments on a tex file. Each author has his own command \alertA and \alertB to insert comments. Each author should has ...
3
votes
1answer
30 views

edit an enviroment to add to a new extra parameter

I'm trying to define a new \newenviroment but I'm having some problems. I need an enviroment that uses a counter and uses an extra parameter to write some text. I'm working with this enviroment: ...
0
votes
1answer
22 views

Error; bookmark in PDF

I have this problem in LaTeX when I use; \addcontentsline{toc}{section}{Resumen} \section*{\bf Agradecimientos} \addcontentsline{toc}{section}{Agradecimientos} \tableofcontents ...
4
votes
2answers
117 views

Count number of elements in a list

This question is somewhat similar to Count the number of elements of each size in a list. It should actually be simpler but I nevertheless can't figure out how to do it without using the same code as ...
2
votes
1answer
97 views

\label is forcing roman numerals into arabic numbers

I am trying to put a caption and label on a table for a lab report. My professor insists that we use roman numerals for tables e.g. (Table IV). But the \label command is forcing 'IV' into '4' when I ...
1
vote
2answers
86 views

How to set a simple counter in a certain chapter

How can I set the equation counter to behave differently for a certain Chapter? I am writing my phd thesis, and I want to have a simple equation counter for the introduction. In general, ...
3
votes
2answers
143 views

Loop to create new counters

I want to create counters in a loop like this (with the packages multido, totcount) : \newcounter{compteurChi}% first counter \regtotcounter{compteurChi}% define the first counter as a ...
8
votes
3answers
310 views

Counting backwards

The following produces a counter that counts in increasing arabic numerals. \documentclass[12pt]{article} \pagestyle{empty} \begin{document} \newcounter{myCounter} \addtocounter{myCounter}{1} ...
2
votes
1answer
85 views

Get number of each slide and total slides with respect to the whole presentation

I need to get the number of each slide and the total number of slides in order to calculate the progress of my presentation, but I can only do this for frames, as my MWE below shows. Basically I need ...
0
votes
1answer
46 views

Dot before Chapter and Section numbers

My Chapter numbers come out to me Chapter .1 instead of Chapter 1. This problem persists throughout in section as well as ToC. A similar question is answered earlier, Dot before numbering, but it ...
3
votes
1answer
43 views

How change numbering table just in one chapter?

I have set book and numbering a table is 1.1...second chapter 2.1.....and one chapter just in one I need numbering my table just table 1 table 2.... any help ? ...
1
vote
0answers
31 views

Two different counters in chemnum package

Is there any possibility to use two independent counters within the chemnum package? I would like to label (by replacing the tags in my .eps file) substances in reactions and steps in catalytic cycles ...
9
votes
1answer
244 views

How to count the total number of sections within a chapter?

How can one count the total number of sections within each chapter? I am trying to use the totcount package, but it returns the total number of sections of the last chapter, not total number of ...
3
votes
1answer
24 views

one counter for multiple theorems?

I searched the internet for a while now but didn't quite get what i wanted. I want number different theorems with the same counter, which depends on chapter and section. eg Lemma 1.1.1 Example 1.1.2 ...
3
votes
2answers
28 views

Numbering of items in a chapter

I am writing my thesis with book class. All but one of the chapters have subsection. For the particular chapter without a subsection, the first definition number comes as 2.0.1. The 0 is for the ...
3
votes
2answers
43 views

Do a setcounter only for an included file

I have currently the following situation: I am including a Latex-File in my main file. This file already has several \section{}-parts. Now I want to let their counting begin at 1 again, but without ...
4
votes
1answer
43 views

Setting a counter to a value obtained by expansion

I use the glossaries and minitoc packages. Minitocs are generated for all glossaries printed in the table of content, eg with the toc option for the glossaries package. When one prints the glossaries ...
4
votes
2answers
68 views

Add version number to document from file

I have been going crazy looking for a solution. Essentially, I need to add the version number of the document somewhere on the title page. What I want to do is have a file such as version.tex which ...
5
votes
3answers
70 views

Own counter starts at 3 in tabularx environment

the following example shows that the self defined counter in the tabularx environment does not start with "1". Can't figure out how to define the command to always start with "1". Ideas? ...
5
votes
2answers
119 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
98 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
51 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
107 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
209 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
47 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 ...
7
votes
1answer
142 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
56 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
63 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
57 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
115 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
62 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
229 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
48 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
37 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
41 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
144 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
39 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
87 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
14 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
50 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
71 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
49 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 ...