可以使定理数表现得像乳胶中的小节数吗?

发布于 2024-08-18 21:08:43 字数 460 浏览 3 评论 0原文

我想问两个关于 Latex 中编号方案的问题,我无法找到任何精确的参考。如果有人能帮助我解决这个问题,我将非常高兴。

问题 1) 是否可以对定理和小节进行一致编号,如下所示:


2 第二节

2.1 小节

2.1.1 小节

定理 2.1.2 :请注意,定理编号的行为类似于小节编号。

2.1.3 下小节

定理 2.1.4 下定理。

2.2 下一小节

所以基本上我希望我的定理编号遵循与小节相同的编号。


问题2) 是否可以使所有章节和定理编号都遵循一个段落编号,如下所示:


58 一个段落

定理58.1。第 58 段中的定理。

59 下一段

定理 59.1。下一个定理。

I would like to ask two questions about the numbering schemes in Latex for which I am unable to find any precise reference. I will be very happy if somebody could help me out on this.

Question 1) Is it possible to number theorems and subsubsections consistently as follows:


2 Section two

2.1 A subsection

2.1.1 A subsubsection

Theorem 2.1.2 : Note that theorem number is behaving like the subsubsection number.

2.1.3 Next subsubsection

Theorem 2.1.4 Next theorem.

2.2 Next subsection

So basically I want my Theorem numbers to follow the same numbering as a subsubsection.


Question 2) Is it possible to make all the section and theorem numbers follow a paragraph number as shown below:


58 A paragraph

Theorem 58.1. A theorem in para 58.

59 Next paragraph

Theorem 59.1. Next theorem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

染墨丶若流云 2024-08-25 21:08:43

第一个问题:

是的,这是可能的,使用 AMS \newtheorem 命令。有两种使用方法:

\newtheorem{<name>}{<caption>}[<numbers within>]
\newtheorem{<name>}[<numbers like>]{<caption>}

参数 namecaption 不言而喻。可选参数应该是计数器。当使用 numbers inside 时,会创建一个新的计数器(称为 name),只要 name 被步进,该计数器就会重置。第二种类型的调用,使用numbers like不会创建新的计数器,而是指定应该使用哪个计数器来对此类定理进行编号。当然,当插入定理时,这个计数器也是阶梯式的。

在你的情况下,你可能应该做类似的事情,

\newtheorem{myTheorem}[subsubsection]{Theorem}

特别是注意——与宏不同——调用计数器时不带反斜杠。

第二个问题:

LaTeX 中的内置计数器通常带有一个获取计数器值的宏,格式为。对于计数器 foo,该宏将为 \thefoo。更改计数器的外观可以这样完成:

\renewcommand{\thefoo}{\arabic{foo}}

将导致使用阿拉伯数字排版该值。还有 \alph、\Alph、\roman 和 \Roman 分别表示数字、大写字母、小写罗马数字和大写罗马数字。也许,不同的软件包提供了更多这样的宏。

我不太确定你到底需要什么,但尝试一下类似

\renewcommand{\thetheorem}{\theparagraph.\arabic{theorem}}

定理是否有自己的计数器。如果您使用另一个计数器来计算定理(如 Q1 中),请修改该计数器的格式宏。

最终注释

使用

\newtheorem{myTheorem}[subsubsection]{Theorem}

会将定理编号的格式自动设置为您期望的格式:\thesubsubsection.\arabic{theorem}

First question:

Yes, this is possible, using the AMS \newtheorem command. There are two ways of using it:

\newtheorem{<name>}{<caption>}[<numbers within>]
\newtheorem{<name>}[<numbers like>]{<caption>}

The arguments name and caption speak for themselves. The optional arguments should be counters. When using the numbers within, a new counter (called name) is created, which is reset whenever the name is stepped. The second type of call, using numbers like does not create a new counter, but specifies which counter should be used to number this kind of theorem. Of course, when a theorem is inserted, this counter is also stepped.

In your situation, you should probably do something like

\newtheorem{myTheorem}[subsubsection]{Theorem}

Note in particular that --unlike macros-- counters are called without a backslash.

Second question:

Built-in counters in LaTeX usually come with a macro that takes the counter value, and formats is. For the counter foo, this macro would be \thefoo. Changing the appearance of the counter can be done like this:

\renewcommand{\thefoo}{\arabic{foo}}

will result in the value being typeset using arabic numerals. Ther's also \alph, \Alph, \roman and \Roman for numbers, capitals, lowercase Roman numerals and uppercase Roman numerals, respectively. Probably, different packages provide many more of such macros.

I'm not exactly sure what you need precisely, but try something like

\renewcommand{\thetheorem}{\theparagraph.\arabic{theorem}}

if theorems have their own counter. If you use another counter for theorems (like in Q1), modify the format macro for that counter instead.

Final comment

using

\newtheorem{myTheorem}[subsubsection]{Theorem}

will set the formatting of theorem numbers to what you would expect automatically: \thesubsubsection.\arabic{theorem}.

梦明 2024-08-25 21:08:43

您需要使用

\newtheorem{theorem}[subsubsection]{Theorem} 

\newtheorem{theorem}[paragraph]{Theorem} 

查看:

You need to use

\newtheorem{theorem}[subsubsection]{Theorem} 

or

\newtheorem{theorem}[paragraph]{Theorem} 

See:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文