10

I'm preparing a paper using the Lipics style and have a long appendix: each appendix Section is headed by capital letters A,B,C... I would like to have the numbering of Lemmas in the appendix such as Lemma A.1 (if it is in appendix A), resp. Lemma B.1, B.2,... (in appendix B) etc. Any hint? I tried to redefine the \thetheorem variable and played with it for a while, but was not succesful, I'm not very strong at LaTeX.

Thanks for possible hint! Here is a minimal working code:

\documentclass[a4paper, USenglish, numberwithinsect]{lipics}
\theoremstyle{plain}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{problem}[theorem]{Problem}

\title{Title}
\author[1]{Peter Franek}
\affil[1]{Affil}

\begin{document}
\maketitle

\begin{abstract}
abstract
\end{abstract}

\section{Introduction}
\label{s:intro}
\begin{theorem}
Theorem 1
\end{theorem}
\begin{lemma}
First Lemma
\end{lemma}

\appendix
\section{first appendix chapter}
Some text..
\begin{lemma}
I don't want Lemma 1.1 but either Lemma A.1 or Lemma A.1.1
\end{lemma}

\end{document}

1 Answers1

10

It's easy with the apptools and chngcntr packages:

Edit (8/1/2020): changcntr is no more necessary since \counterwithin is now part of the LaTeX kernel.

\documentclass[11pt,a4paper,titlepage,oneside]{article}%
\usepackage[utf8]{inputenc}
\usepackage{chngcntr}
\usepackage{apptools}
\AtAppendix{\counterwithin{lemma}{section}}

\newtheorem{lemma}{Lemma}

\begin{document} \section{A First Section}

\begin{lemma} A first lemma. \end{lemma}

\appendix \section{An appendix section}

\begin{lemma} A lemma in appendix. \end{lemma}

\end{document}

enter image description here

Bernard
  • 271,350
  • +1: For answers that achieve this without the use of special packages see https://tex.stackexchange.com/questions/573078/adding-letters-to-theorem-labels-to-specify-the-theorem-is-in-the-appendix-with. – WetlabStudent Jan 02 '21 at 01:11