Questions tagged [counters]

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

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
256 views

Why is not there any \refcounter command in LaTeX?

We have the \stepcounter command in LaTeX where \stepcounter{counter} adds one to the counter and resets all subsidiary counters. We also have the \refstepcounter command where \refstepcounter{...
4
votes
0answers
109 views

How can one count the number of cited bibtex entries of a given type?

How does one print the number of cited entries of type "@inproceedings", of type "@article", etc. E.g., There are \ref{articlecounter} Journal articles.
4
votes
0answers
174 views

Reproduce the beamer miniframes environment

I would like to reproduce the miniframes features of beamer, with the bullets per section even though it would concern the chapters per part. I need a counter counting the total number of chapters in ...
3
votes
0answers
1k views

Reset question numbering in exam class without affecting grade table

Purpose: I need to create a document that contains multiple individual exams. I have already applied heavy customisations to the exam class so I wish to continue using it rather than having to start ...
2
votes
0answers
72 views

ConTeXt equivalent of LaTeX's \label and \refstepcounter?

In LaTeX I can label anything provided that it is numbered with a referenceable counter. Moreover, references are automatically numbered with \refstepcounter. For instance, I write the following: \...
2
votes
0answers
50 views

Numbering counter out of order - reledmac / reledpar

TL;DR In a parallel type setting environment using reledmac / reledpar, the footnote numbering is out of order. I am currently creating a Latex document in a twoside class which contains a bilingual ...
2
votes
0answers
93 views

Counting number of references using environment or special bib-entry field

Suppose, that we write a survey. Somehow we need to count a number of reviewed papers. The simplest way is to create a counter, say, refsRev and add 1 at each \cite. I created newcommand \rcite, ...
2
votes
0answers
100 views

XeLaTeX: Counters not working correctly with expex

I'm using expex for glossing translations of foreign languages. I want to label certain words in the gloss which I want to explain later with numbers in superscripts. Then I plan to use enumerate to ...
2
votes
0answers
188 views

Two different counters in chemnum package

Is there any possibility to use two independent counters within the chemnum package? I would like to label (by replacing the tags in my .eps file) substances in reactions and steps in catalytic cycles ...
1
vote
0answers
15 views

beamer - overlays and counter

I have a macro with counters in it and overlays (class beamer). Every time I use overlays it increases the counters although it should not. Macro: \def\test{\thesection\stepcounter{section}} Main ...
1
vote
1answer
49 views

number question

I'm trying to figure out how I can make numbers in my index sort in ascending order, right now 11 is sorting between 1 and 2, i'm trying to make it come after 9 and 10. I could add a 0 before the ...
1
vote
0answers
77 views

How to count section pages in LaTeX and display them in a progress bar?

I am currently writing a student work in latex as a scrartcl. I would like to make an overview in my document of how many pages I still have to write in each section. So like an actual/target ...
1
vote
0answers
72 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
0answers
87 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 ...
1
vote
0answers
568 views

Print character count

Background inspiration and code: \documentclass{article} \usepackage{bashful} \pagestyle{empty} \bash texcount -sum -1 tmp.tex \END \begin{document} %here is a front page and a table of contents %...
1
vote
0answers
86 views

Bar graph with elements from the document

In my document, I define some elements which all have a number (from 1 for the first to n for the last one) and a level (1, 2 or 3). At the end of the document, I'd like to create a bar-graph with ...
1
vote
0answers
160 views

How to change imakeidx section title without breaking the .ind file creation?

I'm using a macro that messed around with the \section command, breaking \printindex in the process when using imakeidx. I'm pretty sure the problem lies about lines 252-253 in imakeidx.sty: \def\...
0
votes
0answers
43 views

How to solve \begin{poem} -— \end{poem} undefined control sequence error, and reset counter with each poem environment

the MWE is here; % SAMPLE: https://imgur.com/a/5ZEN5jG \documentclass[twoside,a5paper,10pt]{book} \usepackage[T1]{fontenc} \usepackage{helvet} \usepackage{palatino} \usepackage{lipsum} \usepackage{...
0
votes
0answers
41 views

How do I reset group index counter

Sometimes I want labels of numbered lists like: Exercise 2.2 (a) (b) For others, I want to display like: Theorem 2.3 (i) (ii) For this end, I add \begingroup and \endgroup and \...
0
votes
0answers
14 views

What is the subequations counter named?

If I want to change the equation numbering I can use \addtocounter{equation}{n}. How do I change the subequation numbering? E.g. if I want to label a subequation by 1.7?
0
votes
0answers
18 views

How to fix page numbering/selection of page side with two abstracts (doublepage, twoside report)

I try to include two different abstract pages as for example here: Abstracts in different languages on the same page - all different solutions I found were tested. The Problem becomes obvious when you ...
0
votes
0answers
19 views

How can I reset a counter when calling two different environments?

I defined my own counter which resets every time I call the environment ``environment1''. It works as expected. \newcounter{ado}[environment1] I wanted it to be reseted as well when I call the ...
0
votes
0answers
20 views

How to make cross-reference two different books in one book?

MWE \documentclass[a4paper,11pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \begin{document} % Start pages of Volume I VOLUME I: MATH BOOK %\...
0
votes
0answers
19 views

Unprotect and remove commands inside \nameref and TOC

How do I make my commands context aware, or in particular, how do I remove commands when I refer to them within \nameref or TOC? See an example below, where a counter is incremented when I refer to a ...
0
votes
1answer
26 views

Countinuations of examples

In the accepted answer of the following question: Continuing an earlier theorem-like environment with amsthm & thmtools, two methods are described for continuation of examples. I would like to ...
0
votes
0answers
27 views

create a newcounter with starting value and increment the counter on every page

create a new counter with starting value and increment the counter on every page, below code is working in texlive17 but I am using texlive15 so i getting the error, is it any alternative solution. \...
0
votes
0answers
25 views

Set up an environment with multiple counters

I am writing solutions for a textbook and the exercises are labelled as [chapter].[section].[exercise] (ex: 6.4.32 would be exercise 32 from section 4 of chapter 6). How do I create a theorem ...
0
votes
1answer
46 views

Track changes in LaTeX counters' values

I would like to execute a macro whenever a specific counter changes value. For example: \newcommand{\process}[1]{do something with argument} % ??? (What should I write here?) \stepcounter{somecounter}...
0
votes
0answers
19 views

reset exo numbering and its add-ons

I would appreciate your guidance in resolving this issue: I want to reset to zero the exercise number and the indication of the exercise and its correction: \documentclass[11pt,draft]{book} \...
0
votes
0answers
34 views

Figure numbering after sections

I'm writing my thesis and it has chapters, section, subsections and subsubsections. In the TOC only up until the subsections are present shown below: My figures are usually under a subsection but I ...
0
votes
0answers
15 views

Can't simultaneously have superscripted footnotes in text and footnote counter not cycling back to 1 with each chapter

I want my footnotes superscripted in the text and numbered continuously in the text of my book from 1 to n, without restarting at 1 with each chapter. In the MWE below, if I comment out the \chngcntr ...
0
votes
0answers
32 views

How can I number examples in the previous section?

How can I number the examples like the picture I attached?
0
votes
0answers
41 views

How to add custom numbering to sections or subsections?

I would like to have subsections with "parts" like the following code but possibly managed automatically. \documentclass{article} \begin{document} \section{Lorem} \subsection{Ipsum part 1: Foo} \...
0
votes
0answers
30 views

One latex source producing several pdf files with continuing counters

I am looking for a way of splitting a textbook into lecturenotes for individual lectures. That is, I have a latex file textbook.tex and I would like to produce pdfs lecture1.pdf, lecture2.pdf. The ...
0
votes
0answers
61 views

Can Even Pages Be Right Pages?

SETCOUNTER in BOOK changes page numbers as well as directions—odd pages are right pages and vice versa. This is an example. \documentclass{book} \title{TEXT} \author{TEXT} \date{TEXT} \begin{document}...
0
votes
0answers
51 views

How do I reset the setcounter for a custom lstlistingname in latex?

I am fairly new to the world of LaTeX and am currently working on a report. Throughout the report there are several tables, figures and commands. For the figures and tables I found the working code ...
0
votes
0answers
56 views

Custom counter for oddside and evenside margins

When using the twoside in the article class, resetting the page counter creates an issue in regards to the odd and even side margins. Is it possible to declare a custom counter that article considers ...
0
votes
2answers
91 views

beamer: finding out if there is content in the appendix

I am trying to determine if there are pages in the appendix. If there are I want to show a separation page/frame as indicator but in the handout mode only. In my current setup (due to some ...
0
votes
0answers
70 views

Non-integer valued counter increment for h2020proposal.cls

The question I have has already been answered here: Nice looking invoices. However, the code I have to modify using this answer is not easy for me to interpret. I could probably figure it out ...