答案1
\documentclass{article}
\usepackage{lipsum}
\newcommand*\theorem[1]{\begin{list}{Theorem:}{\itemindent-2.125em\leftmargin4.67em}\item#1\end{list}}
\begin{document}
\lipsum
\theorem{If $(X,T)$ is $T_{2}$-space and $\langle{x_n}\rangle$ is convergent sequence, then $\langle{x_n}\rangle$ has a unique a limit.}
\lipsum
\end{document}
答案2
假设您正在使用amsthm
theorem 包,您可以按照以下代码所示进行操作。它通过以下方式创建自动悬挂缩进:(a) 定义一个合适的宏(称为\hangit
),该宏设置参数的值\hangindent
; (b) 安排在每个环境\hangafter
开始时执行此宏。theorem
如果只有一个实例需要悬挂缩进,您仍然可以“动态”设置参数,如下所示\hangindent
。\hangafter
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\usepackage{etoolbox}
\newcommand{\hangit}{%
\settowidth{\hangindent}{\textbf{Theorem \thetheorem.}\hspace{0.5em}}%
\hangafter=1}
\AtBeginEnvironment{theorem}{\hangit}
\begin{document}
\begin{theorem}
If $(X,T)$ is $T_{2}$-space and $\langle{x_n}\rangle$ is a
convergent sequence, then~$\langle{x_n}\rangle$ has a unique a limit.
\end{theorem}
\noindent
\settowidth{\hangindent}{Theorem: }\hangafter=1
Theorem: If $(X,T)$ is $T_{2}$-space and $\langle{x_n}\rangle$ is a convergent sequence, then $\langle{x_n}\rangle$ has a unique a limit.
\end{document}