3

So I use the following theorem environments, which are resetted in each section.

\newtheorem{definition}{Definition}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]

So I have a counter for each theorem, i.e. for definition, proposition and lemma. But in the appendix, I want that definition, proposition and lemma share a counter, that is they get labeled consecutively.

In other words, after I start

\appendix

I would like to have the following numbering: Lemma A.1 Proposition A.2

instead of Lemma A.1 Proposition A.1

How can this be achieved? I have been trying a lot, but without success.

Thanks in advance!

EDIT: The following document illustrates my problem.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}



\begin{document}

\newtheorem{definition}{Definition}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]


\section{First section}
\begin{definition}
 test
\end{definition}
\begin{definition}
 test2
\end{definition}
\begin{lemma}
 testLemma
\end{lemma}


\appendix
\section{My appendix}
\begin{lemma}
 THIS IS
\end{lemma}
\begin{proposition}
 NOT THE WAY I WANT IT TO BE
\end{proposition}




\end{document}
2
  • Could you post a full, yet minimal, compilable code?
    – Bernard
    Commented Aug 12, 2017 at 14:20
  • Sure, added it!
    – Doc
    Commented Aug 12, 2017 at 15:46

1 Answer 1

1

It is very easy with ntheorem which has a \renewtheorem command and apptools, for its \AtAppendix command:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{ntheorem}

\newtheorem{definition}{Definition}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\usepackage{apptools}
\AtAppendix{\renewtheorem{definition}{Definition}[section]
\renewtheorem{proposition}[definition]{Proposition}
\renewtheorem{lemma}[definition]{Lemma}}

\begin{document}

\section{First section}
\begin{definition}
  test.
\end{definition}
\begin{definition}
  test2.
\end{definition}
\begin{lemma}
  test Lemma.
\end{lemma}

\appendix

\section{My appendix}

\begin{lemma}
  THIS IS
\end{lemma}
\begin{proposition}
  NOT THE WAY I WANT IT TO BE
\end{proposition}

\begin{definition}
  OR IS IT?
\end{definition}

\end{document} 

enter image description here

You must log in to answer this question.

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