我正在尝试定义一个未编号的引理和子引理,如下所示:
\documentclass[12pt]{article}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\newtheorem{theorem}{Theorem}
\newtheorem*{theorem*}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem*{lemma*}[theorem]{Lemma}
\newtheorem{sublemma}{Lemma}[section]
\newtheorem*{sublemma*}{Lemma}[section]
\begin{document}
\section{1}
\begin{lemma*}
text
\end{lemma*}
\end{document}
但是当我这样做时,我收到一条错误消息,指出我定义 lemma* 和 sublemma* 的行缺少 \begin{document}。为什么它只对这些定义执行此操作,而不对其他定义执行此操作?
答案1
未编号定理环境不需要依赖计数器,因此可以删除它们。
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem*{theorem*}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem*{lemma*}{Lemma}
\newtheorem{sublemma}{Lemma}[section]
\newtheorem*{sublemma*}{Lemma}
\begin{document}
\section{A section}
\begin{theorem}
A theorem.
\end{theorem}
\begin{theorem*}
An unnumbered theorem.
\end{theorem*}
\begin{lemma}
A lemma.
\end{lemma}
\begin{lemma*}
An unnumbered lemma.
\end{lemma*}
\begin{sublemma}
A sublemma.
\end{sublemma}
\begin{sublemma*}
An unnumbered sublemma.
\end{sublemma*}
\end{document}