Skip to main content

Questions tagged [counters]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
28 views

Problem using \ref with a specific counter in a new environment

I have created a new environment for definitions and theorems (with a leftbar style) and a specific counter (\thesection.\thecounter), to have (for instance) the following numbering: Definition 1.2.1, ...
J-P's user avatar
  • 11
2 votes
1 answer
54 views

Connected counters

The basic idea is that I am going to have examples of english sentences and then alternative formalizations of them. I want an arabic counter (‘eg’ in MWE) for the english sentences and an ...
Ainsley Pullen's user avatar
1 vote
1 answer
33 views

Theorems display error with hyperref

I have a problem with display theorem counter (see below) and I cant just update everything because of corporate policies, so I am trying to find exact simple solution. I've already found that problem ...
kissmemiau's user avatar
0 votes
1 answer
29 views

Incompatibility of the '\onslide' environment with environments that have a running counter [duplicate]

I'm using the following custom environment for theorems: \documentclass[xcolor=dvipsnames]{beamer} \usepackage{mdframed} \setbeamercovered{transparent} \newcounter{boxedthmcounter} \newenvironment{...
Saleh's user avatar
  • 113
1 vote
0 answers
25 views

Adjust enumitem labelwidth dynamically to match widest label [duplicate]

I'm trying to typeset a set of ingredient lists using enumitem where I have ingredient amounts as labels and ingredients as the items. I would like each list to have labelindent=10pt and a labelsep=...
corndog's user avatar
  • 97
1 vote
1 answer
27 views

Theorem Enviroment Counter

I define theorem environment counter based on section and subsection as following: \newtheorem{test}{Test}[subsection]% Counter `test` depends on `subsection` … \counterwithin*{test}{section}% … and ...
kissmemiau's user avatar
0 votes
1 answer
56 views

Chapter Formant: CHAPTER 1 -> CHAPTER ONE

The new requirement of my school is CHAPTER 1 -> CHAPTER ONE. I check the .cls file, may I know how to adjust this? I appreciate your help % Chapter formatting in TOC \renewcommand{\cftchapindent}{...
amzra10's user avatar
0 votes
1 answer
29 views

hyperlink does not appear in index when different counter is used

I am trying to create a bibliographical document which contents several entries and an index at the end. I wanted my index to refer entry-numbers instead of page-number, which I could manage to do. ...
Sushant's user avatar
  • 117
2 votes
2 answers
48 views

question about how to use custom counter for row numbers of tables

I put \newcounter macro to use for adding row numbers in a table. The test document is as follows: \documentclass{memoir} \usepackage{tabularray} \newcounter{mycounter}[table] \NewDocumentCommand\...
Seong's user avatar
  • 237
3 votes
2 answers
67 views

Add "identifiers" to questions for printing

So, I have this code that lets me number questions/ exercises according to chapters ("Exercise 1.1", etc). I have one count to "identify" the question and one count to display the ...
Vebjorn's user avatar
  • 1,884
0 votes
1 answer
45 views

Numbering exercises by chapter and printing solutions by chapter in appendix

So, I have a basic tcolorbox that I want to write my exercises in. I want the exercises to be numbered by chapter, i.e. Exercise 1.1 is exercise 1 in chapter 1 (and still be able to print the answers ...
Vebjorn's user avatar
  • 1,884
1 vote
1 answer
16 views

Figures and equations numbering in \only - Beamer

While using figures and equation in \only in beamer, they appear to have the same number, and that no increment is done. I tried the solution provided in figure different numbering \only - beamer, ie ...
jeirual's user avatar
  • 13
0 votes
0 answers
21 views

Customizing numbering on environment with optional argument

I am not sure if this is considered bad practice so please let me know if it is. I have an environment I use form homework problems \newtheoremstyle{mystyle} {\topsep}{\topsep}{\normalfont}{}{\...
4u9ust's user avatar
  • 23
0 votes
3 answers
31 views

Identifying definition and theorem counters halfway through document

I am currently creating a latex article for a large-scale assignment for a class. In it, the numbering system for the definitions and theorems needs to change halfway through the document. In one ...
Stephen Cook's user avatar
2 votes
2 answers
85 views

Make equation counter follows customized counter

Objective Hi. I define a counter, say, no for my customized commands, such as \newcounter{no} \counterwithin{no}{chapter} \newcommand{\no}{\refstepcounter{no}% \theno} \newcommand{\df}...
HRC's user avatar
  • 23
1 vote
2 answers
65 views

How to cross-reference captions with different counters?

I want to define a flexible manner in which to include pieces of source code and/or figures to a group that acts as a floating figure environment. The idea is to be able to select the counter with the ...
onlycparra's user avatar
0 votes
0 answers
42 views

Questions about counters

I need help. I want to show like "Example 5.1.1"(Means Chapter 5, Section 1 the first example", but when I rewrite code I got a problem. Here's my code: % Counter Reset \pgfkeys{ /...
ToadetteK's user avatar
2 votes
1 answer
103 views

Create new count with \def

I have the following macro/command: \def\definenewcounter#1{\newcount \csname#1\endcsname} It is supposed to create a new count with it's name being whatever argument 1 is, but it is throwing errors. ...
fsr_j's user avatar
  • 75
0 votes
0 answers
31 views

Generate sequential padded barcodes with qrcode

How can I create a padded sequence of qrcodes with the qrcode package? The following code throws an error: \documentclass{article} \usepackage{qrcode} \usepackage{fmtcount} \newcounter{asn} \...
Uwe Ziegenhagen's user avatar
0 votes
2 answers
45 views

Customized output when referencing autonumbered paragraph

I have a customized paragraph that I use to define skills and autonumber them. When referencing the paragraphs, the output should be custom text plus counter number (e.g., S1, S2 etc). But currently, ...
mike's user avatar
  • 335
2 votes
2 answers
70 views

Putting an enumerated list on an equation counter

I would like to put certain enumerated lists on the same counter as my displayed equations. Can anyone suggest how I can do this? Close to minimal working example below. \documentclass{amsart} \...
A.M.'s user avatar
  • 23
0 votes
1 answer
38 views

Bigfoot and alphalph

I am currently typesetting a critical scholarly edition that features multiple footnote apparatus. One of them is numbered with letters. The footnote counters are not resetted per page, but per ...
Christian Sonder's user avatar
1 vote
1 answer
29 views

How can I have common number (i.e., share a counter) between a tcolorbox theorem environment and a standard theorem environment?

I have a document where I want to have theorems formatted using the tcolorbox package, and propositions formatted using the default formatting from the amsthm package. However, I'd also like to have ...
Naysh's user avatar
  • 187
1 vote
2 answers
42 views

Why does managing a counter and label in an environment make \ref obtain the wrong value?

With the following code, I prepare my own custom counter and use it in a command, where I also create a label. Then I use my command several types, and use \ref using the label created in each command ...
Gwendal's user avatar
  • 11
3 votes
3 answers
87 views

How break page numbering and restart it by the last automatically?

When I write a document it is usual I divide it into more part: so, I am usual to not number part page as into the example put below where I put a document with three parts, like Overture, Part I and ...
Antonio Maria Di Mauro's user avatar
0 votes
3 answers
24 views

Customize numbering figures 1, 2.1, 2.2, 3, 4 with AMS and hyperref

Ordinarily I use amsart and hyperref and number figures 1, 2, 3, 4. In some situations, I need to split a figure into multiple parts so the parts can each fit on a page, and then I want to sub-number ...
Dale's user avatar
  • 299
3 votes
2 answers
89 views

Vertical leaders with changing line numbers

I'm currently using a command (adapted from https://tex.stackexchange.com/a/241139) to make horizontal lines repeat for my exams, and I am having trouble adding incrementing numbers to each line. I ...
Alexandre Simard's user avatar
1 vote
1 answer
88 views

Problem with continued use of FPeval

I want to create a template to standardise the question papers in my institution. I had previously asked this question but did not receive any answer. Recently, I tried the way as shown in the MWE ...
Subhajit Paul's user avatar
0 votes
1 answer
22 views

Custom heading with prefix and counter in KOMA class

I would like to introduce a new heading in a KOMA-Script class on the subsection level that has a prefix and a separate counter, eg. GP1, GP2, etc. Otherwise, the style should be the same as \...
user21101711's user avatar
0 votes
0 answers
17 views

Preserve equation/section counters of the previous version with latexdiff

I am using latexdiff to generate a PDF diff of two versions of a document. I am using overleaf with latexdiff according to this answer. I.e., with a latexmkrc file containing $pdflatex = "...
Cameron's user avatar
  • 123
1 vote
1 answer
28 views

Using label in enumerate to get value of previous item

I have a list of conditions in a definition like the following: \begin{enumerate} \item \( \recfnl{j}{X \Tplus 0^{\pair{n}{0} - 1}\concat[0]}{}\diverge \) \item \( \recfnl{j}{X \Tplus 0^{\pair{n}{0} -...
Peter Gerdes's user avatar
1 vote
1 answer
31 views

exercise package: Cannot change first question number

I know I can change a question number with \setcounter{Question}: \begin{Exercise}[title={Title}, label=opg] \Question Exercise 1 \setcounter{Question}{10} \Question Exercise 11 ...
Duon's user avatar
  • 13
0 votes
1 answer
31 views

Contents pages and counters

I'm trying to create a document that has two different types of headings within each section. The first heading needs to go in a contents page and is of the form Block #1 -- #2 (3 Sessions) where #1 ...
Wendy Taylor's user avatar
0 votes
0 answers
55 views

Count characters in piece of text, ignoring latex code

I want to control the size of a piece of text in my Latex document (for an application for research funding), and ignore the latex code. I want to count also the whitespaces. I really want to measure ...
the world is not flat's user avatar
0 votes
0 answers
28 views

Printing counter options [duplicate]

I want to use \Alph{mycounter} to have my theorems labelled by capital roman letters and a short search led me to conclude that all I need to write is \newcounter{mycounter} \Alph{mycounter} \...
Lorenzo Riva's user avatar
1 vote
1 answer
56 views

Using small caps in counters with `amsthm`?

I want to use lowercase small caps for all section titles. I also want to use old style figures, and in this case I'm using mathpazo. Now, suppose I add an appendix to a document and number theorems ...
apc's user avatar
  • 848
1 vote
1 answer
52 views

Detect use of display math: \everydisplaymath{}

I would like to be able to detect if a display math environment was used: So, looking for a \everydisplaymath{} hook. Am not bothered if something like $\displaystyle \frac{}{} is counted or not. In ...
Peter Grill's user avatar
0 votes
0 answers
12 views

How to prevent section slide from being counted as a slide in Beamer Frankfurt? [duplicate]

I am using Beamer with the Frankfurt theme to create a slideshow. I used Frankfurt because I like how it handles the frame numbering - with non-intrusive dots in the upper part of the slide. The ...
Julian_P's user avatar
  • 101
1 vote
1 answer
38 views

How to change the numbering system of figures in LaTeX?

This is probabily a very simple issue but I only have used templates of LaTeX so far and I am not used to the coding itself. I have a template that uses the numbering of figures as for example Figure ...
Victor's user avatar
  • 11
0 votes
0 answers
42 views

How to get correct exhibit number when referenced [duplicate]

I have the following tex code: % Define a counter for exhibits \newcounter{exhibitcounter} % Define the exhibit command \newcommand{\exhibit}[2]{% \clearpage \refstepcounter{exhibitcounter} \...
9f241e21's user avatar
  • 101
2 votes
1 answer
31 views

Align: Numbering with an own counter

I have a document where I use chapters and sections. E.g. there is >>Definition 4.1.13<<. Now I want to use a counter for align-environments. But when I use it, I get Definition 4.1.13: We ...
Lereu's user avatar
  • 471
1 vote
0 answers
41 views

"Merge" subsequent counter-based commands

I'm trying to implement two simple paragraph numbering commands \verse and \subverse. When a \verse command is followed by a \subverse (irrespective of spaces and new lines), only the subverse counter ...
P. Price's user avatar
1 vote
1 answer
20 views

No numbering solution environment when ams style is enabled (beamer)

I would like still using numeration for theorem, definition except only for `solution when ams style is enabled. Please any hint. \documentclass{beamer} \setbeamertemplate{theorems}[ams style] \begin{...
Oromion's user avatar
  • 394
1 vote
1 answer
45 views

LaTex table, how to make a table sequel to not be counted and labeled as a new table?

I'm new to LaTex and I'm having some trouble dealing with issue related to tables. I have two tables -- let's say, table 1 and table 2. LaTex compiler is treating these as different tables, so it ...
Fabio Phillip's user avatar
2 votes
4 answers
77 views

How to turn string read from (CSV) file into counter

I have a csv file with tags and (page) nrs, as follows: tag,nr t1,1 t2,5 t3,9 The nr-column refers to page numbers in a pdf file. Each page has a corresponding tag. Given a tag, I want to show the ...
avandeursen's user avatar
0 votes
2 answers
56 views

Counter is incremented inside \if, even condition is not met

I have defined three counters which I'm going to increment within a condition. This should lead to the result that functional requirements are prefixed with FA (and a subsequent number) and non ...
MarvinMcFly's user avatar
1 vote
1 answer
58 views

Labels such as Lemma 1B5 instead of Lemma 1.2.5. (avoiding all punctuation)

I wonder whether it is possible for LaTeX (or the amsthm package) to change the style of numbering of a Theorem, Lemma, Corollary, Definition, ... to something like Lemma 1B5 instead of Lemma 1.2.5. (...
Glasby's user avatar
  • 721
0 votes
0 answers
31 views

\ref gets section number instead of theorem number using tcolorbox [duplicate]

I found a nice template for my notes but I'm having trouble getting it to reference definitions and theorems correctly, as \ref displays the section number instead of the definition number. \...
Rucy's user avatar
  • 1
1 vote
1 answer
47 views

Issue using `totcount` to create a score counter per-exam question

On the cover sheet of an exam, I want to generate a tabulation of the questions and their point totals. (This is part of a package I'm writing. I am aware of exam.sty, but it doesn't suit me.) I have ...
Timtro's user avatar
  • 1,430
0 votes
1 answer
35 views

mdthereom shared counters, cleverref, and nested theorems

I am having trouble trying to set up mdframed so that it is compatible with cleverref all mdframed boxes share the same counter does not break when mdframed environments are nested Demo file. ...
Qqqq123123's user avatar

1
2 3 4 5
30