Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [counters]

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

7
votes
3answers
260 views

Use counters value after it appears in the code

Is there a way to use a counters value at one point in the code, but with the counters state of a line, that comes somewhat after the corresponding use of the counters value? E.g. Define the counter ...
2
votes
1answer
59 views

section with letters automaticaly creates dots after letter

I wanted to change the enumeration of subsections from arabic numbers to roman character, so I used \renewcommand\thesubsection{\thesection.\alph{subsection})} For some reason I can't figure out ...
2
votes
2answers
28 views

Properly setting \thecounter when defining \newcounter{counter}[resetwith]

With \newcounter{counter}[resetwith], I can define a counter to be automatically reset when resetwith changes. However, it seems that \thecounter is defined to just display the value of counter, and ...
2
votes
1answer
48 views

Continue previous page numbering (Roman/Arabic) with two independent counters?

Assumed I want to write a document with abstract, acknowledgements, three chapters, two appendices and a statutory declaration. Hereby... Abstract and acknowledgement should be numbered in Roman ...
0
votes
0answers
20 views

I am trying to include supplemental figures in my chaptered thesis

I am writing a chaptered thesis. I have been using suchow's template (https://github.com/suchow/Dissertate) which has been great. But I want to add supplemental figures at the end of each chapter. The ...
0
votes
1answer
17 views

Counter reset for numbering the figure

In my chapter, I have several sections. How can I reset the counter of figures for each section? i.e. In chapter 1, section 1, My figures should be numbered 1,2,3 (instead of 1.1, 1.2, 1.3). In ...
2
votes
1answer
24 views

Alphabetic Footnote Marks that (automatically) omit the letters 'j' and 'w'

I am trying to duplicate the footnote style from a book where the footnote marks are the letters of the alphabet—but the footnote omits the letters 'j' and 'w'. The kludge I have worked out involves ...
1
vote
1answer
26 views

Alphabetic Footnote Marks to 'roll over' from 'z' to 'a' automatically

How do I make the footnote counter automatically reset to 0 whenever it reaches 25? I am trying to duplicate the footnote style from a book where the footnote marks are the letters of the alphabet--...
1
vote
1answer
35 views

Downcounter in moderncv

I use my counter in moderncv.cls as \documentclass{moderncv} \newcommand{\NbOfJournalPub}{10} \newcounter{MyCounter} \setcounter{MyCounter}{-1} \newcommand*{\myJlistitem}{\stepcounter{MyCounter}[J\...
0
votes
0answers
20 views

Counters in the LyX

Please tell me whether it is possible in the window LyX display the values for these counters by using, for example, some mathematical mode? For example, if I ever see in the window LyX the current ...
1
vote
1answer
26 views

How to ref the counter in the command AlgHeader?

First, a counter AlgCounter is defined. Second, a new command \AlgNo is defined and the counter AlgCounter is used in the definition of \AlgNo. Third, in order to draw three lines of an algorithm, a ...
4
votes
3answers
137 views

How to resume enumi in a question of exsheets?

I can resume by adding \setcounter{enumi}{\thetemp} before the first item \setcounter{temp}{\theenumi} after the last item where temp is my new counter. However this approach does not look elegant. I ...
1
vote
1answer
54 views

Using the same numbering in two different {chapter*}

I'm currently writting my thesis and I have to record two introductions (environment \chapter*) : one in French and one in English. Since the informations and equations are exactly the same, I would ...
2
votes
2answers
46 views

How to get to total number of lines in an environment

While trying to figure a complete answer to this post, I was wondering how I could get the total amount of lines in the algorithmic environment. Of course this question can be relevant for other ...
0
votes
1answer
42 views

Special section names and counter in memoir with cleveref

I'm trying to have separately numbered "Resource" sections in a memoir document, but have produced clevereferences that refer to the "current" Resource counter value instead of the referenced Resource'...
3
votes
1answer
37 views

Calculations in pstricks swallows the spaces after a command [duplicate]

The following MWE works fine when plotting a square using pstricks with xelatex. \documentclass{article} \usepackage{pstricks} \begin{document} \def\x{0 } % Notice that there MUST be a white ...
2
votes
1answer
106 views

Total number of frames in subsubsection?

I would like to know if there is an easy way to get the total number of frames within a subsubsection in Beamer ? I already managed to get the frame count in each subsubsection, as can be seen in the ...
1
vote
2answers
29 views

Show chapter number along with Total Chapter Count in Chapter title - Memoir document class

How to show chapterNo/TotalChapterCount in the Chapter title of memoir document. \documentclass{memoir} \usepackage{lipsum} \begin{document} \tableofcontents \chapter{First} \lipsum ...
1
vote
1answer
36 views

Use counter value from given label

I have defined two new counters and two macros. The first macro \requirement simply increases the counter requirement. The second macro \subrequirement is basically doing the same but using requriment ...
3
votes
3answers
42 views

Execute condition in “last” environment typeset of it's type

I am trying to write some code that will clean up some future notes for me. In essence I want to be able to "turn on" or "turn off" an environment (proofs of results) via a simple command. I managed ...
3
votes
3answers
72 views

A command for arbitrary constants

When proving theorem, I sometimes define arbitrary constants that I then reference. These constants are not really important and they do not need to be memorable beyond the proof. This is why I ...
2
votes
1answer
31 views

How do I add graphicname like figurename?

MWE \documentclass[a4paper,11pt]{book} \usepackage{caption} \usepackage{tikz} \usepackage{graphicx} \usepackage{float} \newfloat{Grafik}{htbp}{loa} \begin{document} \chapter{A} \section{B} \begin{...
1
vote
1answer
22 views

Labelling a custom counter inside align env

I created a new counter and new commands to label and refer to this counter (the latter looks redundant here because I stripped away some formatting I have in it) according to this answer. As the ...
1
vote
2answers
60 views

Fractions and counters in a \foreach list of pairs

I'm trying to create a macro that will take a list of pairs as an argument in order to draw a pie chart. I'm trying to make it so that portions of the pie are specified as a fraction less than 1. Here'...
7
votes
3answers
917 views

Creating a nice-looking box without using minipage

I would like to create the following box and title without using minipage With : small box before Title Title with counter \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...
5
votes
4answers
295 views

\ref takes reader to incorrect section

Context In the document I'm writing, I have redefined each environment and have included a new counter, called counter, to help with the numbering of the environments. My intention is for each ...
1
vote
1answer
35 views

Custom Counter Longtable

I would like to create a custom counter for the following table such that it appears "Table 6.1: Sample Statistics: Swiss Model". In other words, I would like to manually input the counter settings. ...
1
vote
0answers
33 views

How to Create a Counter for the Number of Builds

I just finished writing my Master's thesis using Latex. When I was executing my last builds, I was thinking that it would have been quite interesting to count the total number of builds it had taken ...
2
votes
1answer
172 views

Reset equation numbering after each problem

I started using the ShareLateX Basic Homework Template: https://www.sharelatex.com/templates/examples/basic-homework-template in which are defined the 'problem' and 'solution' environments, defined ...
2
votes
1answer
43 views

Questions about Counter

I am new to TeX and I am using a template to type something. And I want to do the following change of the format: I want to use the same counter for all the Theorem, Propostion, Corollary, etc. I ...
2
votes
1answer
26 views

Two pages “1” with package hyperref

When compiling a LaTeX document, I get two pages numbered at "1": the front page and the first of the table of contents. Here's a MWE: \documentclass[12pt,a4paper]{report} \usepackage[english]{babel} ...
3
votes
1answer
30 views

Labelling and Referencing Multiple Custom Counters Together

This is what I have. \documentclass[12pt,a4paper]{article} \newcounter{theorem}[section] \newcommand\theorem{\stepcounter{theorem}\framebox{\textbf{Theorem \thesection.\thetheorem}}} \begin{document}...
0
votes
0answers
20 views

Labelling and Referencing Multiple Custom Counters [duplicate]

I'm trying to label the custom counters at the end so I can refer to them later on in the document. \newcounter{theorem}[section] \newcommand\theorem{\stepcounter{theorem}\framebox{\textbf{Theorem \...
1
vote
2answers
64 views

How to define reference label and caption name in 'duplicated' environment?

I want to define a new environment that is very similar to the longtable environment, therefore I tried the following: \documentclass{report} \usepackage{caption} \usepackage{longtable} \usepackage{...
1
vote
0answers
48 views

Counter for version of document

I am trying to create a version counter of the document, to indicate which version the user is reading. Based on this answer: Add version number to document from file I managed to create this counter....
1
vote
1answer
26 views

Auto-completion of \ref doesn't work for my counter

I defined a counter and a command that defines examples and labels them. Unfortunately, when I use these definitions the \ref is not autocompleted by the texmaker or sharelatex. What should I add in ...
0
votes
1answer
27 views

Circumvent missing dot in hierarchical listing numbering

I'm trying to deal with the same problem as described here. But the accepted answer does not really help in my case since the problem occurs when I try to add hierarchical numbering to listings and I ...
1
vote
2answers
80 views

Reference to a counter [duplicate]

Certainly a stupid question. I have a newcounter defined normaly, that is \newcounter{sharc} How can I call a specific value of this counter with a command like label/ref ? Exemple blabla `\...
0
votes
1answer
27 views

Changing the numbering in Chemnum

How do can you change the numbering in the chemnum package? I would like to start from 100 rather than 1 for chapter 1. Then start from 200 for chapter 2 etc.
3
votes
1answer
91 views

How can I prevent \ifnum to be ignored?

So I have the following code: \newcount\x\x\i \ifnum\x<3 \advance\x1 \fi \the\x \bye which I call from the command line with pdftex '\def\i{9}\input test.tex' This puts out 10 (or \i + 1), ...
0
votes
0answers
35 views

How to set counter to appendix

I need to have both appendix and anexx in my document, so I did the following on my main: \appendix \include{appendix1} %%\include{appendix2} \include{appendix3} \renewcommand{\appendixname}{Annex} ...
3
votes
3answers
230 views

Strange combined behavior of newcounter and newcommand

I have very simple document, where I declare a counter and wand to add bold text for each list item as follow: \documentclass[11pt]{article} \usepackage{vmargin} \usepackage{graphicx} \usepackage{...
2
votes
1answer
32 views

pageref to part gives wrong page number

I have a \pageref pointing to a label for a \part (\label{part:publications}), but the number, that pageref spits out is off-by-one. If I have the following: Page: \pageref{part:publications} ... \...
2
votes
2answers
44 views

How to use `refcount` for chapter-wise counters?

I'm using the refcount package to set some counters to the same values as counters from another .tex file. The labels from the other .tex file are imported with the zref-xr package. This method fails ...
0
votes
0answers
59 views

Latest MacTex install will not compile old 'tex' files that used to work? [duplicate]

Now Using MacTeX-2018 Getting this error: ! LaTeX Error: Command \counterwithout already defined. Or name \end... illegal, see p.192 of the manual. Found this solution, on stack ...
3
votes
1answer
27 views

Using different counter for Index (makeidx)

I have a question similar to this question: I'm using makeidx and I want the index to use a different counter than \thepage. My code looks like this: \documentclass{scrbook} \usepackage{makeidx} \...
1
vote
1answer
18 views

Claim counter, destination with same identifier

I am getting warnings regarding my claims and claim proofs along the lines of: pdfTeX warning (ext4): destination with the same identifier (name{claimcount.1}) has been already use d, ...
2
votes
1answer
41 views

Change how lemmas are counted in the appendix using `newcommand`

I use the following command to count Lemmas in my paper. \newcounter{lcount} \newcommand{\lem}[2]{\refstepcounter{lcount}\label{#1}\vspace*{0.5cm}\noindent \textbf{Lemma \thelcount.}\ \ {#2}\vspace*{...
1
vote
1answer
104 views

How can expand a counter of auxiliary file and save in list with xparse?

I am using the modification of a macro to save to lists using expl3 and xparse. I have managed to create a small interface type [key = val] and using the environ package I have been able to achieve my ...
1
vote
0answers
40 views

counters, newcount and pgfcalendar, macros

I am trying to use the pdfcalendar library, but I think I'm confused by the definitions. My Question: What kind of LaTeX counter/macro/variable can I use with pgfcalendar functions? Do I have to ...