答案1
这个包有这样一种可能性thmtools
:我定义一个袖珍的定理风格。
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}
\declaretheoremstyle[%
spaceabove=4pt, spacebelow=4pt,%
headfont=\normalfont\bfseries,%
notefont=\mdseries\itshape, notebraces={\textup{(}}\textup{)},%
bodyfont=\normalfont\itshape,%
postheadspace=0.5em]{compact}
%
\declaretheorem[style=compact, preheadhook={\abovedisplayskip=2pt\belowdisplayskip=0pt}]{axiom}%{Axiom}%
\begin{document}
\lipsum[10]
\begin{axiom}[Axiom of Transitivity]
\[
P(x, y) \land P(y, z) \rightarrow P(x, z)
\]
\end{axiom}
\lipsum[11]
\end{document}
答案2
我通过 documentclass 添加了另一种可能性amsart
。
\documentclass[12pt]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[theoremfont]{newtxtext}
\usepackage{newtxmath}
\theoremstyle{plain}
\newtheorem{ax}{Axiom}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\setcounter{ax}{16}
\begin{ax}{Axiom of Transitivity}
\[
P(x, y) \land P(y, z) \rightarrow P(x, z)
\]
\end{ax}
\lipsum[1]
\end{document}
答案3
“紧致方程”的通用设置
\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{lipsum} % for mock text
\newtheorem{axiom}{Axiom}
\newenvironment{compactequation}
{\compactequations\begin{equation}}
{\end{equation}\ignorespacesafterend}
\newenvironment{compactequation*}
{\compactequations\begin{equation*}}
{\end{equation*}\ignorespacesafterend}
\newcommand{\compactequations}{%
\setlength{\abovedisplayskip}{3pt plus 1pt minus 1pt}%
\setlength{\belowdisplayskip}{3pt plus 1pt minus 1pt}%
\setlength{\abovedisplayshortskip}{0pt plus 1pt}%
\setlength{\belowdisplayshortskip}{0pt plus 1pt}%
}
\begin{document}
\setcounter{axiom}{16} % just to reproduce your picture
\lipsum[1][1-5]
\begin{axiom}
Axiom of transitivity
\begin{compactequation*}
P(x, y) \land P(y, z) \rightarrow P(x, z)
\end{compactequation*}
\end{axiom}
\lipsum[2][1-5]
\end{document}
如果您的公理具有相同的结构,即某些文本只有一个公式而没有其他内容,那么您可以用不同的方式来执行。
\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{lipsum} % for mock text
\newtheorem{axiominner}{Axiom}
\newenvironment{axiom}
{%
\setlength{\abovedisplayskip}{3pt plus 1pt minus 1pt}%
\setlength{\belowdisplayskip}{3pt plus 1pt minus 1pt}%
\setlength{\abovedisplayshortskip}{0pt plus 1pt}%
\setlength{\belowdisplayshortskip}{0pt plus 1pt}%
\axiominner
}
{\endaxiominner}
\begin{document}
\setcounter{axiominner}{16} % just to reproduce your picture
\lipsum[1][1-5]
\begin{axiom}
Axiom of transitivity
\[
P(x, y) \land P(y, z) \rightarrow P(x, z)
\]
\end{axiom}
\lipsum[2][1-5]
\end{document}
输出与上面相同。