3
votes
1answer
110 views

Newcommand + Stepcounter

I'm trying to come up with a command which should increase a counter and return a string including the current value of the counter. Have a look at the following minimal example: ...
2
votes
0answers
66 views

Incrementing counters with subsubsection instead of subsection [closed]

I have previously tried to make a document with questions and answers. In a previous question I was shown a great way to do this, using the answer package in combination with hyperref. Adding ...
8
votes
4answers
186 views

How can I reference the current (sub)section number?

I want to create a macro that dynamically returns the current chapter, section, subsection (etc.) I'm in. I've created a macro called \getCurrentSectionNumber that does this, but it lacks the ability ...
6
votes
2answers
623 views

How to reset section counter

This is the barebones of my document: \documentclass[12pt]{article} \begin{document} \begin{center} \textbf{\LARGE{Topic I}} \end{center} \section{Section I} content \section{Section II} ...
5
votes
2answers
137 views

`xr` - temporarily redefine `\label` for exporting section counter to sister document?

The goal My objective is to have continuous page (and possibly section) counters for several independent documents. The purpose is a cumulative dissertation where each paper should retain the ...
7
votes
2answers
193 views

Counting pages of sections

After building a second page counter that is reset for every section, I wonder how to get the number of pages of a section. Every section starts on a new page. How can I calculate the number of ...
1
vote
1answer
110 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 ...
7
votes
3answers
259 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 ...
6
votes
3answers
190 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 ...
2
votes
1answer
182 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 ...
1
vote
1answer
787 views

Define new section

I have this document in the article documentclass. Everything is divided into sections and subsections. Now I'd like to have an example in my chapter two, that is also divided into sections. So I have ...
2
votes
2answers
607 views

Customize \section

I have a document, where I want typical code: "Problem # n" to be printed in every section. I made this code, which is working. How can I get rid of \setcounter{secnumdepth}{1} and ...
4
votes
3answers
267 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 ...
6
votes
1answer
87 views

Beamer: suffix equivalent frametitles with a counter or index?

I wonder how to suffix equivalent frametitles with a counter or index. So for example, when I would have two slides with the same \frametitle (e.g. "Marvelous title"), it should result in Marvelous ...
5
votes
1answer
641 views

Using \thesubsection in header references last instance - not first

I would like to include \thesubsection in my header, referring to the first instance of subsection, and not the last as seems to be the default. The following MWE says it all: ...
6
votes
3answers
7k views

How to reset chapter and section counter with \part

To get the output Toc or pdf bookmark below: Part I Chapter I Chapter II Part II Chapter I Chapter II I need to reset the chapter counter. I google and get one method. ...
1
vote
2answers
167 views

How to make additional paragraph commands that use sectioning counters?

I would like to be able to use the following additional (new) commands: \sparagraph, \ssparagraph, \sssparagraph. All of these will use the \paragraph formatting but, will use different counters. The ...
5
votes
3answers
549 views

Using \total of totcount package in section title

I am keeping track of all the journal papers I review, and of course I'm using LaTeX. There are different journals I review for and I have different tables and counters keeping track of papers. Each ...
5
votes
2answers
472 views

Re-displaying section headings after page-breaks

I'd like to automatically repeat section headings after a page break. My naive attempt at doing this is to check the page counter and print the extra text whenever the counter increments: ...
17
votes
3answers
457 views

Extracting the “parent” counter of a sectional unit

I am interested in finding the "parent" counter of a specific sectional unit. For example, in the following document structure 1. A section 1.1 A subsection 1.1.1 A subsubsection 1.1.2 A ...
6
votes
3answers
433 views

Odd interaction of secnumdepth and section-based counters

In the following MWE: \documentclass{book} \newcounter{exnum}[subsection] \begin{document} \chapter*{Chapter} \section*{Section 1} \subsection{Subsection A} \setcounter{exnum}{1} ...
1
vote
1answer
382 views

How to create a new counter for an a new environment that is in sync with subsections

I want to create an example environment with a counter which will be in sync with my subsections. So I'll have: subsection 3.2 lemma 3.2 example 3.2 example 3.3 lemma 3.3 subsection ...
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. ...
2
votes
1answer
406 views

New sectioning level above section

I would like to create a newcounter (lectcount) which will be one level above the "section" in article class, and use its name in the headings (I am using fancyhdr). I don't know how to set the ...
8
votes
3answers
4k views

Resetting theorem counters: \section and (missing) \subsection

Suppose I define a new theorem "Theorem" and declare that its counter should be reset whenever the subsection counter is incremented or reset: \newtheorem{theorem}{Theorem}[subsection] At some ...
3
votes
1answer
531 views

Why does hyperref bookmark work?

The \appendix command resets the section counter to zero: *\documentclass{article} *\show\appendix (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h ...
8
votes
2answers
296 views

French chapter numbers

This question led to a new feature in a package: impnattypo French typography recommends that chapters be numbered in uppercase roman numbers, except for chapter 1 which should be called ...
5
votes
2answers
330 views

How to decorate a LaTeX command

I've been trying to change the numbering behavior of subsection to use a global counter. I first did: \newcounter{maincount} \renewcommand{\thesubsection}{\stepcounter{maincount}\arabic{maincount}} ...
7
votes
2answers
6k views

How to increase counter for \subsection

How can I make the first subsection under a section start on "d"? I currently have the following code to get a,b,c,d...: \renewcommand{\thesubsection}{\alph{subsection}} and I tried this to make it ...
5
votes
2answers
4k views

Access the chapter/section number and the chapter/section label through variables

Often I find myself in the situation that I'd like to design how chapters and sections look. I know there are packages that help to design such things, but non of them seems to give me the option to ...
6
votes
3answers
535 views

Changing the section number to a fraction

In between two sections that really ought to be numbered 23 and 24, I want to add another section, which I would like to call 23.5. The code \setcounter{section}{23.5} \section{...}, however, results ...