Can someone please tell me how to make definitions, theorems etc. in the appendix look like Definition A1 or Definition 1A (an "A" should be somewhere), if the appendix is "numbered" with A (meaning latex shows A Appendix, if I compile the document). Right now all the definitions, theorems etc.are numbered from 1 to n, where n is the last definition, theorem etc. of my document (sections don't change the numbering), even if this last one is in the appendix.

Equation numbering is ok though; the first numbered equation is "A.1".

The thing is, I'm using LyX, so I would prefer it, if there were some command that I could use to reset the counter and globally change the look of definitions, theorems etc. in the appendix, so that I

1) don't have to remove all the LyX-created environments (like for example the LyX-created definition environment) and replace them by hand-coded ones in order to maybe pass some additional arguments to each them, because that looks horrible in LyX.

2) don't have to use a different way to insert the appendix other then the one LyX provides and that is via \appendix (not via the appendix package).

FYI: I'm using LyX 2; the document class is article; my appendix is situated after several sections (I don't used any other divisioning of my document like subsections etc. - if that makes any difference).

1 Answer 1


Add the following code to the preamble settings of your LyX document:


In the document body, add the following "Evil Red Text" (LaTeX code) immediately after \appendix to effect the desired change for an environment called thm:

% \renewcommand{\thethm}{\thesection\arabic{thm}}% optional

You'll have to check your preamble for the existing theorem-like environments and their names (AFAIK, this depends on the loaded LyX modules) and apply the above code for every environment.

Here's a compilable example:






A theorem.


Another theorem.


% \renewcommand{\thethm}{\thesection\arabic{thm}}% optional


An appendix theorem.


Another appendix theorem.

  • 4
    what if my appendix is called Appendix B, how to let the theorem display as Theorem B.1?
    – KevinKim
    Commented Dec 15, 2016 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .