我有乳胶切片编号的问题.我想从标题和内容中删除部分编号,但我希望数字存在于lemmas,定理等等.我希望它看起来像:
Section Whatever
Some unimportant text.
Section Whatever else
Another unimportant text.
Lemma 2.1
Theorem 2.2
Section Whatever again
Theorem 3.1
Run Code Online (Sandbox Code Playgroud)
我该怎么做?我试过了
\renewcommand\thesection{}
Run Code Online (Sandbox Code Playgroud)
但它甚至从引理和定理中删除了数字.非常感谢你 :)
Wer*_*ner 13
在默认article
类下,我们只需通过添加删除应用于节计数器的格式
\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother
Run Code Online (Sandbox Code Playgroud)
到序言.这将删除所有分段标题编号(\section
s,\subsection
s,\subsubsection
s,...),但将它们保留在引用的位置或\thesection
使用时.
\documentclass{article}
\newtheorem{theorem}{Theorem}[section]% Theorems numbered by section
\newtheorem{lemma}[theorem]{Lemma}% Lemma uses theorem's counter
\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother
\begin{document}
\section{Section whatever}
Some uninportant text.
\section{Section whatever else}
Another uninportant text.
\begin{lemma}
Some lemma.
\end{lemma}
\begin{theorem}
Some theorem.
\end{theorem}
\section{Section whatever again}
\begin{theorem}
Another theorem.
\end{theorem}
\end{document}
Run Code Online (Sandbox Code Playgroud)