How to Reset Theorem Numbering at Each Subsubsection in LyX?

  • Thread starter Thread starter HJ Farnsworth
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers on the issue of resetting theorem numbering in LyX at the subsubsection level. Participants explore the use of the \@addtoreset command and its behavior in relation to section numbering, specifically focusing on how to achieve the desired theorem numbering reset at each subsubsection.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • HJ Farnsworth describes successfully resetting theorem numbering at the section and subsection levels using \@addtoreset but encounters issues when attempting to do so at the subsubsection level.
  • One participant questions whether subsubsections are actually numbered in the document, noting that \@addtoreset only functions when the corresponding section counter is incremented.
  • This participant suggests that the secnumdepth counter may need to be adjusted to ensure subsubsections are numbered, indicating that the default value does not include subsubsections.
  • HJ Farnsworth responds that subsubsections are already numbered and that the secnumdepth adjustment did not resolve the issue, reiterating the need for the theorem counter to reset at the subsubsection level.
  • Another participant requests the .tex code for a complete document to better understand the issue, implying that the current information may not be sufficient for debugging.

Areas of Agreement / Disagreement

Participants express differing views on the functionality of the \@addtoreset command at the subsubsection level, with no consensus reached on a solution to the problem presented.

Contextual Notes

There is an indication that the behavior of the \@addtoreset command may depend on the specific document setup, including whether subsubsections are numbered and how the secnumdepth is configured.

HJ Farnsworth
Messages
126
Reaction score
1
Greetings,

I am using LyX. When I type

\@addtoreset{thm}{section},

in the preamble, the theorem numbering is reset at each section, as desired. Similarly, when I type

\@addtoreset{thm}{subsection},

in the preamble, the theorem numbering is reset at each subsection, as desired. However, when I type

\@addtoreset{thm}{subsubsection},

in the preamble, the command is ignored entirely. Does anyone know how to get it working, i.e., how to get the theorem numbering reset at each subsubsection?

Thanks very much for any help that you can give.

-HJ Farnsworth
 
Physics news on Phys.org
Are your subsubsections actually numbered in your document?

The \@addtoreset command doesn't do its thing when a \section command, etc is executed. It does its thing when the counter named "section" is incremented, inside the \section command. That only happens if the section is numbered.

If you make an unnumbered section with

\section*{the heading}

that will not reset the thm counter either.

By default, everything down to \subsection is numbered but \subsubsection (and lower levels) are not. You can change that be setting the counter secnumdepth. The default value is 2, so

\setcounter{secnumdepth}{3}

in your preamble will give you subsubsection numbers.
 
Hi, thanks for the response AlephZero.

So I just tried the secnumdepth thing you suggested, but it didn't work. The subsubsections are already numbered in the document, with or without secnumdepth. However, what I need is for the theorem counter to reset each time a new subsubsection is started. \@addtoreset does this correctly for anything higher than a subsubsection, but doesn't work for a subsubsection.

Does anyone know how to get \@addtoreset working for things lower than subsection?

Thanks again.
 
Can you attach the .tex code for a complete (short) document that doesn't work?

The fact that
The subsubsections are already numbered in the document, with or without secnumdepth.
is probably sigmificant, but playing 20 questions to guess why it's significant is probably not a good way to debug the problem.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 1 ·
Replies
1
Views
28K
  • · Replies 4 ·
Replies
4
Views
7K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K