How to Reset Theorem Numbering at Each Subsubsection in LyX?

  • Thread starter Thread starter HJ Farnsworth
  • Start date Start date
Click For Summary
The discussion centers on the use of the \@addtoreset command in LyX for resetting theorem numbering at different section levels. The user successfully resets the theorem counter at sections and subsections but encounters issues with subsubsections, where the command appears to be ignored. A key point raised is that the \@addtoreset command functions when the corresponding section counter is incremented, which only occurs if the section is numbered. By default, subsubsections are not numbered unless the secnumdepth counter is adjusted. Although the user confirms that subsubsections are numbered in their document, the desired reset of the theorem counter at this level remains unresolved. Further troubleshooting is suggested, including providing a minimal working example to identify the issue more effectively.
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
7K
  • · Replies 1 ·
Replies
1
Views
28K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 22 ·
Replies
22
Views
4K