问题描述
我想问两个关于Latex编号方案的问题,我找不到确切的参考文献.如果有人可以帮助我,我将非常高兴.
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.
问题1):是否可以一致地对定理和子部分进行编号,如下所示:
Question 1) Is it possible to number theorems and subsubsections consistently as follows:
2第二部分
2.1 A小节
2.1.1一个小节
定理2.1.2:请注意,定理编号的行为与小节编号相同.
Theorem 2.1.2 : Note that theorem number is behaving like the subsubsection number.
2.1.3下一个小节
2.1.3 Next subsubsection
定理2.1.4下一个定理.
Theorem 2.1.4 Next theorem.
2.2下一个小节
因此,基本上,我希望我的定理编号与小节的编号相同.
So basically I want my Theorem numbers to follow the same numbering as a subsubsection.
问题2)是否可以使所有节和定理编号都遵循如下所示的段落编号:
Question 2) Is it possible to make all the section and theorem numbers follow a paragraph number as shown below:
58个段落
定理58.1.第58段中的一个定理.
Theorem 58.1. A theorem in para 58.
59下一段
定理59.1.下一个定理.
Theorem 59.1. Next theorem.
推荐答案
第一个问题:
是的,可以使用AMS \ newtheorem命令.有两种使用方式:
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>}
自变量name
和caption
可以代表自己.可选参数应为计数器.使用numbers within
时,会创建一个新的计数器(称为name
),只要踩下name
就会重置该计数器.使用numbers like
的第二种调用不会创建新的计数器,而是指定应使用哪个计数器对这种定理进行编号.当然,当插入一个定理时,该计数器也将步进.
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.
第二个问题:
LaTeX中的内置计数器通常带有一个采用计数器值的宏,格式为.对于计数器foo
,此宏将为\thefoo
.可以通过以下方式更改计数器的外观:
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}}
将导致使用阿拉伯数字对值进行排版.还有分别用于数字,大写字母,小写罗马数字和大写罗马数字的\ alph,\ Alph,\ roman和\ Roman.可能是不同的程序包提供了更多这样的宏.
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}}
如果定理有它们自己的计数器.如果您对定理使用另一个计数器(例如在Q1中),请改为修改该计数器的格式宏.
if theorems have their own counter. If you use another counter for theorems (like in Q1), modify the format macro for that counter instead.
最终评论
使用
\newtheorem{myTheorem}[subsubsection]{Theorem}
会将定理数字的格式设置为您自动期望的格式:\thesubsubsection.\arabic{theorem}
.
will set the formatting of theorem numbers to what you would expect automatically: \thesubsubsection.\arabic{theorem}
.
这篇关于可以使定理编号表现得像乳胶中的小节编号吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!