如果我想在theorem
环境中缩进第一行,我只需写\indent
。我如何在这个环境中缩进几行 - 一个段落?
以下是 MWE:
\documentclass[fleqn]{scrartcl}
\usepackage[greek,english]{babel}
\usepackage{amssymb}
\usepackage{amsthm}
\newbox\gnBoxA
\newdimen\gnCornerHgt
\setbox\gnBoxA=\hbox{$\ulcorner$}
\global\gnCornerHgt=\ht\gnBoxA
\newdimen\gnArgHgt
\def\Godelnum #1{%
\setbox\gnBoxA=\hbox{$#1$}%
\gnArgHgt=\ht\gnBoxA%
\ifnum \gnArgHgt<\gnCornerHgt \gnArgHgt=0pt%
\else \advance \gnArgHgt by -\gnCornerHgt%
\fi \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA %
\raise\gnArgHgt\hbox{$\urcorner$}}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}(The Carnap-G\"{o}del Diagonal Lemma)\vspace{4pt}\\
If $\Psi(x)$ is a formula with the variable $x$ free then there is a formula $\Phi$ such that all desistances of $\vdash(\Phi\leftrightarrow\Psi\Godelnum{\Phi})$ hold.
\end{theorem}
\end{document}
答案1
如果我很好地理解了你想要什么,这里有一个解决方案,使用ntheorem
。我用选项amsthm
(兼容模式)加载了它。我定义了一种新的定理样式,plainindent
。
\documentclass[fleqn]{scrartcl}
\usepackage[greek,english]{babel}
\usepackage{amssymb}
\newbox\gnBoxA
\newdimen\gnCornerHgt
\setbox\gnBoxA=\hbox{$\ulcorner$}
\global\gnCornerHgt=\ht\gnBoxA
\newdimen\gnArgHgt
\def\Godelnum #1{%
\setbox\gnBoxA=\hbox{$#1$}%
\gnArgHgt=\ht\gnBoxA%
\ifnum \gnArgHgt<\gnCornerHgt \gnArgHgt=0pt%
\else \advance \gnArgHgt by -\gnCornerHgt%
\fi \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA %
\raise\gnArgHgt\hbox{$\urcorner$}}
\usepackage[amsthm]{ntheorem}
\theoremindent1em
\makeatletter
\newtheoremstyle{plainindent}%
{\item[\hskip-\theoremindent\hskip\labelsep\relax\theorem@headerfont##1\ ##2\theorem@separator]}%
{\item[\hskip-\theoremindent\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{plainindent}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}
\usepackage{lipsum}
\begin{document}
\lipsum[11]
\begin{theorem}(The Carnap-G\"{o}del Diagonal Lemma)\vspace{4pt}\ If $\Psi(x)$ is a formula with the variable $x$ free then there is a formula $\Phi$ such that all desistances of $\vdash(\Phi\leftrightarrow\Psi\Godelnum{\Phi})$ hold.
\end{theorem}
\end{document}
答案2
文档主体内不应该有空格命令,而且定理命令有一个可选参数来获取标题。
amsthm
不直接支持缩进样式,但可以很容易地将段落设置与正文字体一起包含在内,如下所示。
\documentclass[fleqn]{scrartcl}
\usepackage[greek,english]{babel}
\usepackage{amssymb}
\usepackage{amsthm}
\newbox\gnBoxA
\newdimen\gnCornerHgt
\setbox\gnBoxA=\hbox{$\ulcorner$}
\global\gnCornerHgt=\ht\gnBoxA
\newdimen\gnArgHgt
\def\Godelnum #1{%
\setbox\gnBoxA=\hbox{$#1$}%
% no % needed on following line
\gnArgHgt=\ht\gnBoxA
% Space needed (in general) after pt so there should
% not be a % on following line (or leave space before %)
\ifnum \gnArgHgt<\gnCornerHgt \gnArgHgt=0pt
% no % needed on following line
\else \advance \gnArgHgt by -\gnCornerHgt
% no % needed on following line
\fi \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA
\raise\gnArgHgt\hbox{$\urcorner$}}
\makeatletter
\newtheoremstyle{zz}% name
{3pt}% Space above
{3pt}% Space below
{\addtolength\leftskip{\parindent}%
\addtolength\@totalleftmargin{\parindent}%
\addtolength\linewidth{-\parindent}%
\itshape}% Body font
{-\parindent}% Indent amount
{\bfseries}% Theorem head font
{}% Punctuation after theorem head
{\newline}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning `normal' )
\makeatother
\theoremstyle{zz}
\newtheorem{theorem}{Theorem}
\begin{document}
\noindent X\dotfill X
\begin{theorem}[The Carnap-G\"{o}del Diagonal Lemma]
If $\Psi(x)$ is a formula with the variable $x$ free then there is a formula $\Phi$ such that all desistances of $\vdash(\Phi\leftrightarrow\Psi\Godelnum{\Phi})$ hold.
\end{theorem}
\end{document}