0

If I want to indent the first line in the theorem environment I just write \indent. How may I indent several lines - a paragraph - in this environment?

Here is a 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}
5
  • 1
    you shouldn't need to use \indent ever in latex. You give no clue how your theorem environmnt is defined (theorem? amsthm? ntheorem? etc, in most theorem packages the theorem text is set as a list item so its left margin can be specified, as for a list when setting up the environment – David Carlisle Oct 19 '15 at 23:58
  • I use amsthm. In this case I wanted to indent the two lines of the theorem. Is it wrong? – Sapiens Oct 20 '15 at 0:07
  • Do you mean all lines of the theorem or some lines? – Bernard Oct 20 '15 at 0:19
  • All, i.e. both of the lines in this case. – Sapiens Oct 20 '15 at 0:21
  • @Bernard Why does your last suggestion not compile for me? – Sapiens Oct 20 '15 at 2:29
2

Here is a solution, if I've well understood what you want, with ntheorem. I loaded it with option amsthm (compatibility mode). I defined a new theorem style, 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} 

enter image description here

11
  • Thanks. No, I want Theorem (The Carnap-Gödel Diagonal Lemma) leftadjusted and then the content of the theorem indented on lines below Theorem (The Carnap-Gödel Diagonal Lemma) . – Sapiens Oct 20 '15 at 0:47
  • That point wasn't clear. Do you want all the subsequent lines to be indented? – Bernard Oct 20 '15 at 0:53
  • I propose a solution, defining a plainindent theoremstyle. Is it more like what you want? – Bernard Oct 20 '15 at 1:28
  • Yes, I want all the succeeding lines indented. – Sapiens Oct 20 '15 at 1:41
  • Now I am not able to compile ... – Sapiens Oct 20 '15 at 1:44
2

You shouldn't have space commands within the document body, also theorem commands have an optional argument to take the title.

amsthm doesn't directly support an indented style but it is easy enough to include the paragraph settings along with the body font as below.

enter image description here

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.