{counters} is about macro writing involving counters. For general questions about numbering document elements, use {numbering}.
13
votes
7answers
246 views
Making calculations using counter
I need to use the counter to make some computations inside loops. For instance,
I want to write a for loop to get the following:
...
18
votes
5answers
229 views
How retrieve items in a list of words by number?
I'm working on a character sheet for the Fate RPG, which rates its skills with a numerical scale that corresponds to an adjective scale. I've been trying to write a macro that will take \skillAdj{4} ...
2
votes
1answer
46 views
Labeling problems with exam class usage when using multiple chapters
Using the exam document class I'm trying to create a questions/answers-sheet for a book. When working on the first chapter, everything worked nicely. When I came to the second chapter, I realized I ...
1
vote
1answer
45 views
Alternative numbering for theorem
I am using thmtools as a front end to amsthm and I have a definition environment as follows.
\declaretheorem[
style=mydefinitionstyle,
name=Definition,
numberwithin=chapter
]{definition}
...
2
votes
2answers
67 views
Lemma numbering by first instance of referencing
My document is long with proofs broken into several lemmas and many of them are in the appendix. However, it seems odd when I am using Lemma 25 (which should ideally be Lemma 1) to prove Lemma 2.
It ...
4
votes
2answers
58 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.
...
3
votes
1answer
65 views
How to find out how many chapters are in a part?
Is there some counter that holds the number of \chapter that are in a \part? Or do I need to define and run my own counter?
2
votes
0answers
46 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}
...
1
vote
1answer
66 views
Completely disable automatic incrementing of section and subsection counters?
I'm using LaTeX as a final build step from a specific legal source (a code of laws) that already has numbering - which is not entirely logical. So, the auto-stepping section & subsection numbering ...
5
votes
2answers
71 views
My own page number from file {counters}
I would like to add my own page number in my publications.
I have file: numerki.tex
zzzero
jEden
dWa
trZy
cztery
...
dwadzIescia
etc......
How I can add counter \counter\cyferki from file. each ...
7
votes
3answers
116 views
Part numbering with suffixes: I, II, IIIa, IIIb, IV,
I would like to have my parts numbered like this:
I, II, IIIa, IIIb, ... , IV, ...
I have written some code which works fine. But when using hyperref, I get this warning:
destination with the same ...
4
votes
1answer
44 views
How to refer to the count value of number of lines in a lstlisting
I need to refer to to the count value of the number of lines in a listing. Is there a way to do that ?
\lstinputlisting[caption={SPARQL query used...},label={lst:sqry}]{codes/sparql_query.sparql}
...
6
votes
3answers
76 views
How to adjust a counter depending on whether or not we are inside a section or subsection
I want to create an exercise environment that can be used in either section, subsection, etc. As an illustration, consider the following:
when in section 1, the third example should be titled as ...
1
vote
1answer
31 views
How to implement two figure counters with proper hyperlinks in hyperref in latex?
I want to typeset a book with a quiz in it. I want to have two types of figures:
text figures: These are indexed i, ii (roman)
quiz figures: These figures are related to the quiz, and should have ...
9
votes
2answers
70 views
Do assignments need to be appended by % to remove the trailing white spaces?
The following shows code snippet taken from multido.tex. I noticed assignments are not ended with %.
See \dimen@=#1\advance\dimen@#2 in
\def\multido@step@d#1#2{%
\dimen@=#1\advance\dimen@#2
...
0
votes
0answers
38 views
TeX, LaTeX capabilities in counting occurrences in text of chars defined in a given list
I am asking this question in part because I am not completely aware of TeX, LaTeX capabilities. Imagine that I want to count the number occurrences of charecters defined in a certain list. The usage ...
4
votes
1answer
64 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 ...
1
vote
1answer
109 views
Adding half points/marks to question counter
I would like to be able to add half marks to my questions, but I don't know how to handle these with\stepcounter. Below is part of my style file, please could you help? I essentially want to say ...
8
votes
2answers
92 views
Defining TeX count in a group
I thought that TeX counts were local definitions, but that is not what I am seeing. I was expecting that if I used \newcount within a group, that the etoolbox \ifdefcounter would say that the counter ...
2
votes
1answer
62 views
Numbering exceeding the 26 letter alphabet
After reading this answer http://tex.stackexchange.com/a/52604/10898 I am unable to employ the alphalph package to replace the counter in either levels. See the code below:
...
7
votes
3answers
125 views
Counting index entries
Is there a way to count the number of entries in an .idx file? Currently I'm using the following to accomplish the job but I'm wondering if there is an all TeX/LaTeX way to accomplish the same thing. ...
4
votes
2answers
99 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 ...
0
votes
0answers
73 views
Counting and Displaying number of views of the pdf file, using pdfLaTeX [closed]
I am looking for a method that can keep track of how many times a PDF file is viewed and display the information in the PDF file itself.
Ex. suppose the file is viewed for the first time (the system ...
1
vote
1answer
65 views
How can I change the counters of tables in the appendices? [duplicate]
I have multiple appendices and in some appendices I have tables. What I want is that each appendix itself has a letter as a number (e.g. Appendix A: title). A second thing that I want to achieve is ...
4
votes
2answers
55 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 ...
1
vote
0answers
20 views
enumitem-shortlabels: How to change the counter of items? [duplicate]
I use the enumitem package with shortlabels.
\usepackage[shortlabels]{enumitem}
Now I've got
\begin{enumerate}[(L 1)]
\item blablabla
\item blablabla
\end{enumerate}
and it goes like ...
6
votes
2answers
91 views
Complex parsing of arguments in new environments
I am trying to build an invoice generation system in LaTeX which will be easy and maintainable. Right now we are using longtable and a preprocessing layer. I would like to change this to a .sty and ...
6
votes
2answers
62 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
81 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
38 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
105 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
131 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
77 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 ...
6
votes
1answer
87 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
70 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
81 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}
...
2
votes
0answers
182 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 ...
10
votes
3answers
196 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
80 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
137 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
243 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 ...
3
votes
1answer
87 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 ...
6
votes
2answers
103 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:
...
20
votes
3answers
312 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
89 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
200 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
115 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 ...
40
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 ...
6
votes
1answer
174 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
133 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 ...



