在LaTex中需要有关定理、公理、命题、引理、定义等时,常用如下命令
- \newtheorem{定理环境名}{标题}[主计数器名]
- \newtheorem{theorem}{Theorem}[Chapter]
意思就是定义一个以Theorem为标题的theorem环境,计数以章节数为主.
\begin{theorem}[均值不等式]
设\(A,B\)是两个实数, 则\(2AB\leq 2 A^2+B^2\).
\end{theorem}
如果需要输出中文,使用定义theorem如下
\newtheorem{theorem}{\hspace{2em}定理}[chaptet]
另外在{\hspace{2em}定理}中还可以输入更改字体的命令来改变定理的字体
其他中文模式:
- \newtheorem{Definition}{\hspace{2em}定义}[chapter]
- \newtheorem{theorem}{\hspace{2em}定理}[chapter]
- \newtheorem{lemma}{\hspace{2em}引理}[chapter]
- \newtheorem{Proof}{证明}[chapter]
前面提到的定理、公理、命题、引理、定义的一套命令可以用这个
% Theorem style
- \newtheoremstyle{mystyle}{3pt}{3pt}{\kaishu}{0cm}{\heiti2 }{}{1em}{} \theoremstyle{mystyle}
- \newtheorem{definition}{\hspace{2em}定义}[chapter] %
- 没有章, 只有节, 把上面的[chapter]改成[section]
文章中可以直接使用的范例:
\newtheorem{theorem}[definition]{\hspace{2em}定理}
\newtheorem{axiom}[definition]{\hspace{2em}公理}
\newtheorem{lemma}[definition]{\hspace{2em}引理}
\newtheorem{proposition}[definition]{\hspace{2em}命题}
\newtheorem{corollary}[definition]{\hspace{2em}推论}
\newtheorem{remark}{\hspace{2em}注}[chapter]
Latex-定理定义的排版
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}{Proposition}[section]
以上定理和命题分别计数,如果命题也用定理的计数器,可以这样定义:
\newtheorem{prop}[thm]{Proposition}
引用:
\begin{thm}[附加标题,如定理名称,作者]
文本
\end{thm}
较短的证明可以用
\begin{proof}[标题]
证明内容。
\end{proof}
如果有[标题]选项,则显示这个标题(斜体),否则自动打印斜体的Proof,并在证明结束时自动生成证毕符号口。
如果使用\proof命令,则需要在结束时手动加上结束命令\qed。
当然你可以重定义证毕符号,例如:
\renewcommand*{\qedsymbol}{[证毕]}
\begin{proof}[证:]
证明正文。
\end{proof}
注意:
\begin{proof}...\end{proof}" role="presentation" style="margin: 0px; padding: 0px; display: inline; font-weight: normal; line-height: normal; font-size: 14px; text-align: left; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">
\begin{proof}...\end{proof}
环境需要\usepackage{amsthm}宏包的支持
首先你要先使用宏包 ntheorem
\usepackage[amsmath,thmmarks]{ntheorem}
% 定理类环境宏包,其中 amsmath 选项
% 用来兼容 AMS LaTeX 的宏包
%=== 配合上面的ntheorem宏包产生各种定理结构,重定义一些
%正文相关标题 ===
\theoremstyle{plain}
\theoremheaderfont{\normalfont\rmfamily\CJKfamily{hei}}
\theorembodyfont{\normalfont\rm\CJKfamily{kai}} \theoremindent0em
\theoremseparator{\hspace{1em}} \theoremnumbering{arabic}
%\theoremsymbol{} %定理结束时自动添加的标志
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
......
\begin{theorem}
......
\end{theorem}
......
\begin{corollary}
......
\end{corollary}
这样的输出结果就是各自编号的定理和推论了,定义、命题等等也类似可以这么使用。如果你希望定理和推论一起编号,前面可以改为这样(意思是corollary也使用theorem的编号):
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
最后,如果你希望使用Theorem 1.4.2这样的编号,可以这么使用:
\newtheorem{theorem}{Theorem}[subsection] \newtheorem{corollary}[theorem]{Corollary}
前面的subsection改为section将输出Theorem 4.2这样的编号。
\newtheorem{theorem}{Theorem}[subsection] \newtheorem{corollary}[theorem]{Corollary}
前面的subsection改为section将输出Theorem 4.2这样的编号。
如何让定理,推理等用同一计数器:
\newtheorem{thm}{Theorem}[section] %如果不采用章节号做前缀,则不用[section]
\newtheorem{defn}[thm]{Definition} %这句定义使得defn环境和thm共享编号
\newtheorem{lem}[thm]{Lemma} %这句定义使得lem环境和thm共享编号
本文由 CubeTian
创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: 2019-09-17T08:56:59+08:00