How to Reset Theorem Numbering at Each Subsubsection in LyX?

  • Thread starter HJ Farnsworth
  • Start date
In summary, the user is trying to get the theorem numbering to reset at each subsubsection in their document. They have tried using the \@addtoreset command in the preamble, but it only works for subsections and higher. They have also tried changing the secnumdepth value, but it did not work. The user is looking for a solution to get the theorem numbering to reset at each subsubsection.
  • #1
HJ Farnsworth
128
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
  • #2
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.
 
  • #3
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.
 
  • #4
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.
 
  • #5


Hello HJ Farnsworth,

Thank you for sharing your experience with using the \@addtoreset command in LyX. It is a useful tool for resetting numbering in different sections of a document. However, it is important to note that there may be limitations to its functionality, as you have experienced.

One possible limitation could be the structure of your document. The \@addtoreset command may not work if there are conflicts with other numbering systems or if the subsubsection level is not recognized by LyX. It may also depend on the specific settings and packages you are using in your document.

I would suggest checking the LyX documentation or reaching out to their support team for more specific guidance on how to get the \@addtoreset command working for subsubsections in your document. Alternatively, you could try using a different command or approach for resetting theorem numbering in subsubsections.

I hope this helps and good luck with your work in LyX!

Best,
 

1. What is the purpose of \@addtoreset limitations?

The \@addtoreset command is used to reset the counter for a specific element, such as a section or equation, so that it is dependent on another counter. This is useful for situations where you want the numbering of certain elements to be dependent on the numbering of another element.

2. How do I use the \@addtoreset command?

The syntax for using the \@addtoreset command is: \@addtoreset{element}{counter}. For example, if you want the subsection counter to be reset every time a new section is started, you would use the command \@addtoreset{subsection}{section}. This will cause the subsection counter to reset every time a new section is started.

3. Can I use multiple \@addtoreset commands in the same document?

Yes, you can use multiple \@addtoreset commands in the same document. However, it is important to note that the order in which the commands are used matters. Make sure to use the \@addtoreset commands in the correct order to avoid any conflicts or unexpected results.

4. Are there any limitations to using the \@addtoreset command?

Yes, there are a few limitations to using the \@addtoreset command. First, it only works with counters that are defined by \newcounter. Additionally, it does not work with counters that are defined by \newtheorem. Lastly, it does not work with counters that are defined by \newenvironment.

5. How does \@addtoreset differ from \@addtoreset*?

The main difference between \@addtoreset and \@addtoreset* is that the latter does not increase the main counter. This means that the counter for the element being reset will not be incremented when the main counter is incremented. This can be useful for situations where you want the numbering of certain elements to be independent of the main counter.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
Replies
4
Views
1K
Replies
5
Views
997
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
27K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • General Math
Replies
22
Views
3K
Back
Top