所以我目前正在写我的数学论文。
假设我在论文的“第 5 部分”,并按照 5.1、5.2、5.3 等对引理、命题、定理和推论进行排序。有没有办法对这个枚举进行编码,以便如果我想添加新的 5.2,旧的 5.2 会更改为 5.3,5.3 会更改为 5.4,...等等?
谢谢你的帮助
答案1
希望你已经发现这个问题在 LaTeX 中很容易解决(事实上,它基本上就是设计for),但这里有一个明确的构造供你查看。
尝试编译此文档,包括带引理和不带引理两种情况。(根据您编写文档的方式,每次删除引理时,您可能需要连续运行两次 LaTeX 以使交叉引用解析。许多现代编辑器会自动执行此操作。)
\documentclass{article}
\usepackage{amsthm,amssymb}
\newtheorem{theorem}{Theorem}[section]
% Theorem numbering is Sec#.Thm#
\newtheorem{lemma}[theorem]{Lemma}
% Lemmata are numbered as theorems
\begin{document}
\section{A section with some politically motivated math in it}
The following Lemma is folklore among Business Administration circles of
the \emph{Paradigmatic Shift} school:
\begin{lemma}[Synergy Lemma]
\label{lemma:synergy}
Under the right circumstances, $1 + 1 = 3$.
\end{lemma}
\begin{proof} By adoption of a positive workplace culture. \end{proof}
\noindent
The Synergy Lemma proves quite useful to show the following celbrated result:
\begin{theorem}
\label{thm:2+2=5}
When it suits us, $2 + 2 = 5$.
\end{theorem}
\begin{proof} Exercise for the reader; use good stomping boots. \end{proof}
\noindent
Theorem~\ref{thm:2+2=5} is commonly known as \emph{Orwell's Theorem},
though it is often (and more accurately) called \emph{Vissarionovich's Theorem}
in many eastern European countries.
\end{document}