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

learn more… | top users | synonyms

5
votes
2answers
135 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
328 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
246 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 ...
10
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
180 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
604 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
596 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
460 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
775 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
269 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
176 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
218 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
125 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
140 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
601 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
138 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
408 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
285 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
808 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
84 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
265 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
262 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
153 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
187 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, ...
21
votes
4answers
738 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
230 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
118 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
158 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 ...
1
vote
0answers
125 views

Resetting a macro counter to 0 [closed]

I have a macro that is disabled after one use. The worksheet works fine until I need to clean the entire sheet and reuse it the next week. How do I reset the macro counter to zero so that I can use ...
7
votes
1answer
210 views

Savebox equivalent of \csname?

I would like to define a command which would increment a counter, and create a new savebox whose name is generated from the counter value. Something like: \documentclass{article} ...
7
votes
1answer
626 views

Citing many long URLs (shortening and numbering)

In my thesis I have to quote a lot from a single weblog. The URLs are mostly of this structure: blogname.providername.com/stories/123456 ...
4
votes
1answer
393 views

How to set the number of the first citation?

I am using BibTeX and natbib for my citations. In the bibliography the first entry usually starts with [1]. Now I would like to shift all the numbers in the bibliography and text by a certain offset, ...
1
vote
1answer
149 views

Counter linked to section and subsection [duplicate]

Possible Duplicate: Resetting theorem counters: \sections and (missing) \subsections I create a new counter as follow : \newcounter{question}[section] Thus at each new section ...
6
votes
1answer
192 views

Unique counter for all foot, side and end notes

When used together, as in the MWE, the text might be plagued of identical numbered marks, that is rather confusing. I want to have marks in this MWE ordered from 1 to 9 instead of three ...
3
votes
1answer
136 views

Counter not working as expected in pgfplot

Using pgfplot (for the first time), I try to create a chart with horizontal bars, sort of. See the figure. I know how to do it, but because the code is quite verbose and I have lots of data I've ...
5
votes
1answer
175 views

How can I consecutively number only some pages of a document?

The following code typesets a 12 page document; text only appears on every other page and there's an empty page between two text pages: \documentclass{article} \usepackage{atbegshi} ...
2
votes
2answers
701 views

Problems with theorem/definition/statement numbering

I have theorems, definitions, statements, that look like as follows \section{1} \subsection{1} Theorem 1.1.1 .... Statement 1.1.2 .... Definition 1.1.3.... \subsection{2} Theorem 1.2.1 .... ...
9
votes
3answers
2k views

Count number of references using biblatex

I am creating an annotated bibliography. Is there a way of obtaining a count of the number of references in a bibliography meeting certain criteria and inserting that into a document? For example ...
4
votes
2answers
1k views

Resetting counter

I have created two counters \newcounter{problem}[section] \newcounter{solution}[problem] As expected, problem resets every time section increases. However, solution does not reset when problem ...
6
votes
1answer
87 views

Beamer: suffix equivalent frametitles with a counter or index?

I wonder how to suffix equivalent frametitles with a counter or index. So for example, when I would have two slides with the same \frametitle (e.g. "Marvelous title"), it should result in Marvelous ...
4
votes
1answer
239 views

Counters for use in array/tabular cells

The following practical example \documentclass{article} \usepackage{array}% http://ctan.org/pkg/array \newcounter{tabcol}\newcounter{tabrow} \newcolumntype{C}{>{\stepcounter{tabcol}}c} ...
10
votes
1answer
92 views

How can one dynamically insert the number of subsections of the current section?

In a certain section of my document, I want to reference the number of subsections in this section ("In the following X subsections ..."). Is there any way to do this programmatically?
5
votes
1answer
3k views

No Counter Theorem1 is defined

I got an exception in the following latex code: "No Counter Theorem1 is defined", what is the problem? \documentclass[conference]{IEEEtran} \newtheorem{definition}[theorem1]{Definition} ...
4
votes
1answer
805 views

Creating variables with index (using counters)

Is there a way to add an index to a command? For example: \newcounter{count} \loop<condition> \def\var\Roman{count}{some data} \repeat The \var\Roman{count} should become the variable ...
5
votes
1answer
367 views

Is there something like \renewcounter or \providecounter?

Is there a command that creates a counter or, if it already exists, redefines it? Thing is that I'm working with nested loops. The second loop is however in a command. This means if I want to use a ...