LyXAppendix theorem numbering

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

Appendix theorem numbering

Post by CSMR »

I have some theorems in an appendix. Say Appendix A. I would like them to be numbered Lemma A1, Lemma A2,....

At the moment they are coming up as Lemma 30, Lemma 31, etc. since the numbering isn't resetting in the appendix.

I am currently using the modules Theorems(AMS) and Theorems(AMS-Extended). If I add "Theorems (Numbered by Section)" then I have the right numbering in the appendix but he wrong numbering in the main text. So I would like to switch to "Theorems (Numbered by Section)" when the appendix starts.

Any advice much appreciated.
Last edited by CSMR on Mon Feb 28, 2011 5:28 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Appendix theorem numbering

Post by 5gon12eder »

Would something like the following be okay for you?

Code: Select all

\documentclass{article}
\usepackage{amsthm}

\newtheorem{lemma}{Lemma}

\begin{document}
  \section{This is a document section}
  \begin{lemma}
    This is a lemma.
  \end{lemma}

  \begin{appendix}
    \section{This is an appendix section}
    \setcounter{lemma}{0}
    \renewcommand{\thelemma}{\Alph{section}\arabic{lemma}}
    \begin{lemma}
      This is another lemma.
    \end{lemma}
  \end{appendix}

\end{document}
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

Appendix theorem numbering

Post by CSMR »

5gon12eder wrote:Would something like the following be okay for you?

Code: Select all

\documentclass{article}
\usepackage{amsthm}

\newtheorem{lemma}{Lemma}

\begin{document}
  \section{This is a document section}
  \begin{lemma}
    This is a lemma.
  \end{lemma}

  \begin{appendix}
    \section{This is an appendix section}
    \setcounter{lemma}{0}
    \renewcommand{\thelemma}{\Alph{section}\arabic{lemma}}
    \begin{lemma}
      This is another lemma.
    \end{lemma}
  \end{appendix}

\end{document}
Thanks for this! Yes, that works. I went in the end with defining a special environment for the appendix:
In preamble:
\newtheorem{appxlem}{Lemma}[section]
In TeX code in the appendix: \begin{appxlem} and \end{appxlem}
Post Reply