TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
up vote 10 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.