TeX - LaTeX Asked by Peter Franek on November 5, 2020
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}
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}
Correct answer by Bernard on November 5, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP