我想在课本的乳胶文档中的某一章中添加附录部分。
我不喜欢 subappendices 包的样式,其中每个章节的附录都非常突出显示。我非常喜欢下面 MWE 提供的样式,但我有两个问题:我目前手动将附录部分编号为2.A
。我对此没有意见,但间距不太合适。更重要的是,我不知道如何将引理标记为“2.A.1”。
如果我\renewcommand{\thesection}{2.A}
在附录中的引理之前添加\renewcommand{\thesection}{\arabic{\section}}
(目前在 MWE 中注释掉),那么下一章中的章节将不再在章节内编号(在 MWE 中3.1 Three.One
变为)1 Three.One
\documentclass{book}
\usepackage{amsmath}
\newtheorem{lemma}{Lemma}[section]
\begin{document}
\tableofcontents
\chapter{One}
\section{One.One}
Test One.One
\begin{lemma}
This is numbered as desired.
\end{lemma}
\section{One.Two}
Test One.Two
\chapter{Two}
\section{Two.One}
Test Two.One
\section{One.Two}
Test Two.Two
\section*{2.A Appendix: Pi}
\addcontentsline{toc}{section}{2.A Appendix: Pi}
This section has a little bit too little space between ``2.A'' and ``Appendix: Pi'' (both here and more visibly in the ToC)
%\renewcommand{\thesection}{2.A}
\begin{lemma}
This should be Lemma 2.A.1
\end{lemma}
%\renewcommand{\thesection}{\arabic{section}}
\chapter{Three}
\section{Three.One}
Test Three.One
\begin{lemma}
This should be Lemma 3.1.1
\end{lemma}
\end{document}
答案1
快速而粗略的修复。似乎可以实现您的要求。
\documentclass{book}
\usepackage{amsmath}
\newtheorem{lemma}{Lemma}[section]
\begin{document}
\tableofcontents
\chapter{One}
\section{One.One}
Test One.One
\begin{lemma}
This is numbered as desired.
\end{lemma}
\section{One.Two}
Test One.Two
\chapter{Two}
\section{Two.One}
Test Two.One
\section{One.Two}
Test Two.Two
{\setcounter{section}{0}
\renewcommand{\thesection}{\thechapter.\Alph{section}}
\section{Appendix: Pi}%
This section has a little bit too little space between ``2.A'' and ``Appendix: Pi'' (both here and more visibly in the ToC)
\begin{lemma}
This should be Lemma 2.A.1
\end{lemma}
}
\chapter{Three}
\section{Three.One}
Test Three.One
\begin{lemma}
This should be Lemma 3.1.1
\end{lemma}
\end{document}