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

learn more… | top users | synonyms

4
votes
1answer
67 views

Using counters in macros to manage Beamer overlays

I have a very complex Tikz figure that is uncovered piece by piece during my presentation. While tweaking the presentation I decided to change the order of things being uncovered and due to the large ...
4
votes
2answers
101 views

How can make a running example in LaTeX [closed]

I want a continues example where the same number is used for the example in different sections. Is it possible for LaTeX not to increase the counters for the examples? Regards minimum working code: ...
4
votes
2answers
142 views

Reset custom counter in new frame

I'm using a custom counter to cycle bullet point colours in beamer: \documentclass{beamer} \usepackage{graphicx,color} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{marvosym} ...
4
votes
3answers
114 views

Theorem numeration shift

I would like to numerate my theorems not by chapters but by shifted chapters in such a way that the theorems in chapter 2 would read Theorem 1.1, Theorem 1.2 and so on. I need something along the ...
4
votes
2answers
333 views

Write a \setcounter command to a file

I try to write a setcounter command to a file (using the newfile package) by something like the following \addtostream{mystream}{\protect\setcounter{mycounter}{\myvariable}} However, since the ...
4
votes
3answers
58 views

How to get the amount of theorems in a section

How can I get the number (i.e. amount) of theorems that appear in a particular section (or between any user determined beginning and end point) and display it in the document?
4
votes
2answers
58 views

Temporarily resetting figure counters within a chapter

The code below works perfectly in an article (permitting me to put two captions in the same figure and have one of them called Table, picking up the table counter—there’s a sensible reason for doing ...
4
votes
2answers
63 views

Insert newline if this line is the last one before a new page

I have this simple Idea: I want to have LaTeX keep count of the number of text-parts (which already works fine): \newcommand{\newpart}{ \bigskip \begin{center} ...
4
votes
2answers
316 views

Change theorem counter in Springer template

I used Springer template for my book, more concrete I used svmono. Here is a MWE, that is the shortened version of my template file. ...
4
votes
2answers
94 views

How do I create a forward reference to a user-defined counter?

I have created a counter to count enclosures: \newcounter{enclosure}{0} At the bottom of each enclosure I put: \addtocounter{enclosure}{1}\vfill\hfill\Enclosure \arabic{enclosure}\clearpage And ...
4
votes
2answers
2k views

How to get autoref working with different counters for different listing environments?

In my document I want several different custom listing environments. The solution from fraktalek works like a charm, except for one thing: \autoref doesn't work for me. I have tried the following: ...
4
votes
1answer
253 views

How to get a customized counter

I would like to change my equation counter for a specific chapter to a customized one, for example: EQ.1, EQ.2, EQ.3. Does anyone know how to do it?
4
votes
1answer
409 views

Booleans fail in tabular environment

I've got a workaround for this problem, but maybe someone knows a cleaner way to fix it. I'm using the standard packages in TexLive 2009. Here's the code that doesn't work: \documentclass{article} ...
4
votes
1answer
258 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 ...
4
votes
3answers
233 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 ...
4
votes
1answer
676 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 ...
4
votes
1answer
400 views

Reset counter after each item

How to reset the counter of equation numbering after each item in the enumerate environment?
4
votes
2answers
534 views

TikZ: Automatic Numbering of Nodes, \value{counterName}

\documentclass{standalone} \usepackage{tikz} \newcounter{xi} \setcounter{xi}{0} \newcommand{\foo}[0]{ \addtocounter{xi}{1}; \coordinate (x{\value{xi}}) at (1,2); } \begin{document} ...
4
votes
1answer
145 views

How do I determine the name of the counter associated with a theorem-like environment

(A question related to this one and leading up to this one.) Suppose I'm using ntheorem. I would like to have a command which determines the name (not the value) of the counter associated with a ...
4
votes
1answer
231 views

Length needs backslash but counter does not, why?

\documentclass{minimal} \parindent=0sp \newlength{\Length} \setlength{\Length}{1in} \newcounter{Count} \setcounter{Count}{10} \begin{document} \the\Length \theCount \end{document} Length needs ...
4
votes
1answer
166 views

siamltx + amsthm: “LaTeX Error: No counter 'Theorem' defined.”

When using the LaTeX class siamltx (from the SIAM page) together with amsthm (which I need for its theoremstyle command), I'm getting the error message ! LaTeX Error: No counter 'Theorem' defined. ...
4
votes
1answer
148 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} ... ...
4
votes
1answer
2k views

Chngcntr: \counterwithout not working

I need to place the tables section after my appendix. I've used \counterwithin{table}{section} to number appendix tables A.1, A.2, etc. Then I use \counterwithout{table}{section} so that the tables ...
4
votes
1answer
329 views

Command to find current enum depth?

I was wondering if there was a command to find what at what depth of the enum counter (i.e. enumi, enumii, etc.) a command was at compile time. I'm attempting to create a \question command. What I ...
4
votes
1answer
68 views

Enumerate every row, excluding the first one in a table

I want to numerate every row, excluding the first one, in a tabularx environment. In my MWE the first line, headline, is also numerated. How can I turn this off? \documentclass{article} ...
4
votes
1answer
64 views

Create new counter and give it a specific value

Consider the following: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{fancyhdr} \usepackage{caption} \usepackage{subcaption} \usepackage{expl3} \usepackage{pst-eucl} ...
4
votes
2answers
107 views

The package zhnumber without xeCJK

I need to use the function zhdigits from the package zhnumber to typeset a counter the way I want, i.e. convert 235 to 二三五. This package requires the package xeCJK to work properly, but xeCJK messes ...
4
votes
1answer
122 views

How to incorporate counter in list label [duplicate]

I want to label my enumeration like SOMETEXT01, SOMETEXT02, ..., SOMETEXT10, etc. I read through a couple of questions and know how to create a counter that adds in leading zeros. ...
4
votes
1answer
194 views

Cross-refencing a custom counter in \Alph style?

I made a 'hypothesis' custom counter in order to let LaTeX handle my hypothesis reference. My code is \newcounter{hypothese} \refstepcounter{hypothese}\label{hypo:lenght_of_words} ...
4
votes
1answer
197 views

Resume option similar to enumitem package for paralist package

I would like to know if it is possible to generate a resume option similar to that in the enumitem package for the paralist package. Note that it is not possible to add something like [resume] or ...
4
votes
1answer
337 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, ...
4
votes
1answer
148 views

How to count the number of authors of a document?

I need to make a change to a Latex style (.sty) which contains the following line: {\large {\boldCondensed\color{corporate3Color}\raggedright AUTHORS: \MakeUppercase \@author\par}} The problem is ...
4
votes
1answer
131 views

How to customize cross-reference numbering of custom environments?

Context: I have several environments with custom counters. As usual, I'm referencing them along to my document but I get only the corresponding counter value as reference. Example: ...
4
votes
1answer
207 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} ...
4
votes
1answer
674 views

Don't skip framenumbers in beamer in handout mode

Consider the following beamer example below. Is it possible to adjust this, that Frame 4 has framenumber 3 on the handout (and not 4 in my example). In other words the numbering in the handout should ...
4
votes
1answer
737 views

Easy-to-use reference-able environment for restating theorem-like environments?

This question is a development of the same issue as this one; following my own answer and later comment there, I decided it deserves a spin-off. I would like to define an environment for restating ...
4
votes
1answer
41 views

Shared counter (between description environments) results in “undefined control sequence” [closed]

The objective is to share the counter SharedCTR1 across the description environments. The following code works with only one description environment, but not with both. \documentclass{report} ...
3
votes
2answers
423 views

Increment custom counter with standard sectioning command?

My document is a (scr)book and I'm talking of parts and chapters here, but I think the underlying question is pretty generic. I want tables in the book to be enumerated continuously, in a ...
3
votes
2answers
543 views

mdframed and ntheorem counters

In the code below, counters defined by mdframed seem to not be accessible to ntheorem environments which is problematic but ntheorem counters can be read by mdframed. I could not find a work around ...
3
votes
1answer
4k views

Setting \setcounter{tocdepth} for an individual chapter

Hiya, Is it possible to set the \setcounter{tocdepth}{..} for one chapter only? The default depth is fine for the entire document, except for the last chapter- I only want the chapter title to appear ...
3
votes
2answers
144 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 ...
3
votes
2answers
477 views

Unexpected tikz/counter behaviour

What I've been trying to do, futilely, is to use the foreach[counter=\xi] x in {1,2,3} statement in tikz/pgf with LaTeX. This fails, every time. Whatever. So I moved on to trying to use a counter, ...
3
votes
2answers
65 views

Determining spacing by a number that is a multiple of a counter

I have \hspace and I have a stepcounter xyz \documentclass[12pt]{article} \usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry} \usepackage[T1]{fontenc} ...
3
votes
3answers
338 views

Beamer overlays and counters: compiling loop

I tried to compile \documentclass{beamer} \usepackage[english]{babel} \newcounter{xxslide} \begin{document} \begin{frame} \addtocounter{xxslide}{2} \visible<\value{xxslide}>{blabla} ...
3
votes
1answer
162 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 ...
3
votes
3answers
1k views

Table of Contents numbering in decimals?

I have created my first LaTeX document, its very small and have 4 sections. The problem is the numbering is in decimals and looks a little odd, I have searched every where, I'm sure its a simple fix. ...
3
votes
2answers
1k 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 ...
3
votes
2answers
58 views

How can I have references to several counters in a formatted way with \ref{}?

I have two counters in my document, counterA and counterB. I would like the references \ref{} in my document to be printed as 1.a) or 2., etc. where the digit refers to counterA and the letter to ...
3
votes
2answers
52 views

Count items later in the document [duplicate]

The question is simple enough: How can I make the following output of my counter (\themycounter) say 6? \documentclass{article} \newcounter{mycounter} \newcommand{\myitem}{\refstepcounter{mycounter}} ...
3
votes
1answer
129 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 ...