附录中的引理编号

附录中的引理编号

我正在准备一篇使用 Lipics 风格的论文,并且有一个很长的附录:每个附录部分都以大写字母 A、B、C 开头...我希望在附录中对引理进行编号,例如引理 A.1(如果它在附录 A 中),引理 B.1、B.2、...(在附录 B 中)等。有什么提示吗?我尝试重新定义 \thetheorem 变量并尝试了一段时间,但没有成功,我不擅长 LaTeX。

感谢您的提示!以下是最小的工作代码:

\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

apptools使用和包很容易chngcntr

编辑(2020 年 8 月 1 日):changcntr不再需要,因为\counterwithin它现在是 LaTeX 内核的一部分。

\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}

在此处输入图片描述

相关内容