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

learn more… | top users | synonyms

8
votes
2answers
142 views

Counter increase with new page

How can I increase my counter with every new page and reset to 0 again when it comes to a new chapter? I know that I can link my counter to a chapter so that it can be reset on every new chapter by: ...
3
votes
1answer
257 views

Manual exercise question numbering

I am using exercise package to list exercises/questions. I am defining exercise list like this: \begin{ExerciseList} \Exercise{Exercise title} \ExeText Some exercise introduction ...
0
votes
0answers
55 views

Figure counter and figure label issues [duplicate]

i ve got an issue with Figure counting and, i think, labeling. Though I set the counter for figures at 0, my first figure, that I d like to have counted as 'Fig.1' and that is labeled as ...
7
votes
4answers
195 views

How to refer to number of items in a list before the list appears in the .tex file?

I would like LaTeX to "know" how many items there are in a certain list. I want this number to be stored in a variable. In such a way I hope that this variable is sampled during the first compilation ...
6
votes
1answer
899 views

Referencing equation counter value in custom float caption

I have used the float package to create an equation float, eqfloat, so I can add captions to equations. Within the eqfloat I used the equation environment to typeset the math. I want to keep the ...
5
votes
1answer
116 views

Date and time macros in Chinese

Is there a way to get time and date stamps, or other standard counters, to appear in Chinese? I am using xeCJK. Package babel (with \selectlanguage{french} etc. in context) makes it simple for the ...
8
votes
1answer
297 views

Output two sided, but only on recto page — occasional images on verso

I am preparing a thesis. In order to reduce the number of physical sheets of paper, I need to print certain figures/tables on the verso side. However the university regs state that, while figs/tables ...
2
votes
1answer
193 views

How to use a counter to set section or chapter or subsection based on counter value?

Suppose I have my own counter as in \newcounter{x} \setcounter{x}{0} and now I want to start a new "section" based on the value of x. For example, if x==-1 I want \part, and if x==0 then it will ...
7
votes
2answers
194 views

How I manage two counters for a page

I need to number the pages of an article from 1 to n inside the article (named here artpage), but also the pages included in a volume. \newcounter{artpage} \setcounter{artpage}{1} ...
3
votes
1answer
306 views

Using psfrag with LaTeX counters (insert counter number directly in eps figure)?

I am writing an organic chemistry dissertation using (pdf)LaTeX. The content of the thesis contains a large amount of numbered chemical structures. The chemical structure drawings were generated using ...
13
votes
3answers
1k views

How to set a counter to double the value of another counter?

The title says it. Lets have to counters: \newcounter{myCount} \newcounter{anotherCount} I set myCount to some value for example 10 \setcounter{myCount}{10} How do I set counter anotherCount to ...
6
votes
1answer
147 views

Caption number increases by two for every inclusion

I am trying to typeset my captions in margin using marginpar and captionof. Here is what I get by the MWE. Note the wrong caption numbers. The first caption is included using macro \fixedmarginpar ...
3
votes
1answer
354 views

Latex: Running table number

There are several tables in my paper, out of which one table is very long and need to be place on landscape page. This is my Table.4 and I want to put it on the last page. For that I used \setcounter ...
11
votes
3answers
441 views

No room for a new \count with datatool

This question led to a new feature in a package: datatool Update: 2013-1-19 The MWE worked fines with the new (v2.13) version of the datatool package using \DTLnewdbonloadfalse. But in my ...
4
votes
1answer
201 views

Poorly formatted newlistof with memoir

I am having trouble adding a newlistof to a memoir file. My example follows the memoir answer example very closely, but I get an ugly "List of Comments" -- spacing across the page and returns are ...
7
votes
2answers
508 views

Defining shared counters for theorem environments *after* environments are defined

I am trying to use the same numbering for theorems, propositions, definitions, etc. This is normally easily be solved by using amsmath and defining these environments and using the same counter: ...
26
votes
3answers
862 views

@tempdima, reserved@a, @tempcnta, what else?

I'm aware that some "temporary" LaTeX dimensions etc. exist. I would, however, like to know all of them. I know \reserved@a (macro), \@tempdima (dimension) and \@tempcnta (counter).
5
votes
2answers
139 views

How to reference the most recently used multiply-defined label

I want to be able to do something like the following: \incmycounter{abc} %% counter value initialized to 0; associated with label 'abc' \incmycounter{def} %% counter value initialized to 0; ...
5
votes
2answers
347 views

Splitting examples in gb4e

I would like to split examples in the \usepackage{gb4e} to get explanatory remarks as close to the explained item as possible. Usually, my typeset examples are looking like this: (1) blabla (2) a. ...
6
votes
1answer
273 views

Standalone document with chapter

When compiling large documents (with chapters) it is often useful to put different parts in separate files. I do this with the standalone-documentclass for all my tikzpictures. That way I can compile ...
44
votes
3answers
1k views

How to suppress page 13?

A lot of buildings have no 13th floor, some planes have no 13th row etc. How do I set up a document that automatically suppresses page 13, figure 13, chapter 13 and so on, say, by jumping the ...
11
votes
1answer
3k views

Start theorem counter from specific number

I have defined a new theorem and I would like it to start from a specific number(let's say 3). At first I thought of using \addtocounter{\theexe}{3}(where exe is the new theorem) but I get an error ...
10
votes
3answers
187 views

\expandafter and counters not playing nicely

My google-fu has finally failed me... I'm trying to write a package that will allow you say \addauthor{name, email} several times and have the title page properly formatted. Here is a minimal example ...
16
votes
3answers
660 views

square root of number in counter

I would like to get the square root of a number which I have stored into a counter. I have been using the calc package for summation and multiplication operations, but I cannot find anything like ...
6
votes
4answers
2k views

Beamer: uncovering itemize so the first slide shows no items at all

How can I achieve in beamer that the first slide of each frame is void (that is, only displays the frametitle)? Suppose I have the following frame: \frame{\frametitle{Title} \begin{itemize} ...
13
votes
4answers
706 views

Dividing dimensions to get a count

Is there a way to divide two dimens and get a count? For example, if I have a box that doesn't fit on a single page, and I want to know the number of pages I'd need for the box (i.e., \heightofbox / ...
2
votes
2answers
512 views

Customized 'list of…'

I am using the covington package to manage my examples. I would now like to create my list of examples, right after my list of figures and tables. Is there any way to do it? example of an example: ...
4
votes
2answers
2k views

How to create new counter of equation

How to create a new counter of equation. The new equation is matriz and use other sequence number. \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \begin{document} ...
1
vote
1answer
873 views

Define new section

I have this document in the article documentclass. Everything is divided into sections and subsections. Now I'd like to have an example in my chapter two, that is also divided into sections. So I have ...
13
votes
3answers
274 views

Using counters within \index{…}

When trying to use a counter value within \index an odd behavior occurs. It seem as if the value would be evaluated at the end of the document, when the counter has already been changed. Therefore all ...
16
votes
1answer
177 views

Greatest hits? Can I find the most \ref'd part of my document?

I now have a 200 page document and have used \ref and \label very frequently. I was wondering if it is possible to use LaTeX to create a table at the start of the document with the "top ten" most ...
2
votes
1answer
282 views

Automatically increasing date in table cell

I'd like to have an automatic date in a table. Automatic date means I'd like to specify a start date which is shown in the first row of the table and every additional row shows appropriate next day. ...
6
votes
1answer
130 views

count the newlines in title

I am trying to automatically adjust the title page to get a pleasing result independent of the title size. This means that I have to count the number of line breaks in an argument. My MWE (not very ...
1
vote
1answer
148 views

Creating and using commands/counters which name depends on other counter

I would like to know how can I use a counter for defining other new counters. Something like this: \newcounter{foo} \stepcounter{foo} %% Perhaps more increments, this depends of the user. %% And ...
2
votes
2answers
620 views

Customize \section

I have a document, where I want typical code: "Problem # n" to be printed in every section. I made this code, which is working. How can I get rid of \setcounter{secnumdepth}{1} and ...
12
votes
1answer
140 views

Custom “counter” as page number substitute

I'm trying to typeset a book, covering a world trip. Instead of standard page numbers, I want each page to correspond with a digit representing driven kilometers. Of course I can't manually set that ...
2
votes
0answers
438 views

Lyx incorrect figure numbering [closed]

Just a quick question. I am currently working on writing my thesis. I have many figures and I want the numbering to be something like 4.1 or 5.3. Where the first number is my section number and the ...
1
vote
0answers
44 views

Counter too large if number of alphabet chapters is more that 26 [duplicate]

Possible Duplicate: Error: Counter too large! with \alph{cntr} and cntr>26 I need Alphabetic numeration of my chapters. But if they are more than 26 LaTeX gives an error message. How I ...
4
votes
1answer
309 views

How can I have Beamer number slides in a frame title?

More or less what it says on the tin: I want something like: \frame{\somecounterforpagenumbers : My Title} I assume there is a built in counter that I can reference here, but I'm not sure what it ...
0
votes
1answer
4k views

How can I set the table counter?

I've got my little examples env with \newlist{examples}{enumerate}{1} \setlist[examples]{label=(\arabic*), ref=\arabic*, resume} How do I use the same counter for the ...
10
votes
1answer
850 views

What is the purpose of putting \newenvironment, \newcounter in a document class?

In exam.cls, I saw the following codes which I don't understand how do they function in the document class (exam): \newcounter{question} \newcounter{partno} \newcounter{subpart} ...
3
votes
1answer
90 views

How to reference a point in a document with a counter and descriptive text?

This is a follow-up question to the previous questions: How to label a word inside a paragraph? How to refer back to a point in the document with custom counters? The code below ...
4
votes
3answers
286 views

Reset the counter back to one in every chapter

I have the following code to get a beautiful concept boxes with optional header for every new concept discussed. The code changes the concept number using the counter but I also need to reset it to 1 ...
8
votes
2answers
270 views

How to refer back to a point in the document with custom counters?

The easiest way to explain what I would like to have is to show the desired output and I would like to get this by writing something like: \begin{document} Draw point B \STEP{drawb}. Connect A and ...
4
votes
1answer
157 views

Use float counter in a section title

I defined a new float environment for examples \usepackage{float \newfloat{example}{htp}{example} \floatname{example}{Example} that I the use throughout the document \begin{example} ... ...
3
votes
1answer
204 views

How to create counters that display and increment dates in ConTeXt?

I need to create a document that has section titles named "October 1, 2012", "October 2, 2012", etc., like this: \section{October 1, 2012} This is text for the first day. \section{October 2, ...
22
votes
4answers
824 views

Count and use the number of items in advance

When writing LaTeX code, I often successively make changes like adding or removing items. I'd like to have TeX count and update the number of items in the list automatically, as in There are ...
12
votes
1answer
245 views

Counters and their “partners”

A counter created via \newcounter{<counter>} is stored internally as \c@<counter>, just like a reference made using \label{<label>} is stored internally using \r@<label>. ...
3
votes
1answer
120 views

Automatically count of glossary entries

I want to count all glossary entries of a document globally and automatically. Can I expand the macro \glossaryentry to do that and in such a way that I don't introduce a newly defined macro? I have ...
3
votes
2answers
167 views

How to create counters with index?

I need to create counters with names like mycounter1, mycounter2,... Basically this should be a counter-valued data array. The code like \newcounter{index} \newcounter{\csname ...