gpt4 book ai didi

latex - 删除 latex 的段号

转载 作者:行者123 更新时间:2023-12-04 10:23:54 29 4
gpt4 key购买 nike

我对 latex 中的节编号有疑问。我想从标题和内容中删除节号,但我希望其中的数字可以用于引理,定理等。我希望它看起来像:

 Section Whatever
Some unimportant text.

Section Whatever else
Another unimportant text.
Lemma 2.1
Theorem 2.2

Section Whatever again
Theorem 3.1

我该怎么做?我试过了
 \renewcommand\thesection{}

但是它甚至从引理和定理中也删除了这些数字。非常感谢你 :)

最佳答案

在默认的article类下,我们只能通过添加以下内容来删除应用于部分计数器的格式:

\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother

序言。这将删除所有部分标题编号( \section\subsection\subsubsection,...),但仍将其保留在引用位置或使用 \thesection的位置。

enter image description here
\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}

关于latex - 删除 latex 的段号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38292590/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com