2

I have a number of hypotheses which I included by defining a newtheorem. I want the first line of the hypothesis to be indented, but have been unable to achieve this goal. The text was either not indented or the whole paragraph was it. But I just need the first line including the 'Hypothesis No.X' to be indented.

Here is a MWE:

\documentclass[a4paper, 12pt]{report}

\usepackage[ngerman]{babel}
\usepackage{geometry}
\usepackage{indentfirst}
\usepackage{ntheorem}
\usepackage{lipsum}

\geometry{outer=20mm, inner=25mm, top=20mm, bottom=30mm}

\theorembodyfont{\normalfont}
\theoremseparator{:}

\newtheorem{hyp}{Hypothese}

\begin{document}
\chapter{}
\lipsum
\begin{hyp}
Here should be Hypothesis number one with first line indented and the remaining text normally over the whole page.
\end{hyp}

\begin{hyp}
Here is another Hypothesis with an indented first line and remaining text like in the remaining thesis.
\end{hyp}
\end{document}

2 Answers 2

4

Add the indentation as part of the theorem header font, that is \theoremheaderfont:

enter image description here

\documentclass{report}

\usepackage{indentfirst}
\usepackage{ntheorem}
\usepackage{lipsum}

\theoremheaderfont{\hspace*{\parindent}\bfseries}
\theorembodyfont{\normalfont}
\theoremseparator{:}

\newtheorem{hyp}{Hypothesis}

\begin{document}

\chapter{A chapter}
\lipsum

\begin{hyp}
Here should be Hypothesis number one with first line indented and the remaining text normally over the whole page.
\end{hyp}

\begin{hyp}
Here is another Hypothesis with an indented first line and remaining text like in the remaining thesis.
\end{hyp}

\end{document}
3

I defined a new theorem style, indenthead, with a new dimension, \thmheadindent, which works like \theoremindent:

\documentclass[a4paper, 12pt]{report}

\usepackage[ngerman]{babel}
\usepackage{geometry}
\geometry{outer=20mm, inner=25mm, top=20mm, bottom=30mm}%%
\usepackage{indentfirst}
\usepackage{ntheorem}
\usepackage{lipsum}
\makeatletter
\newdimen{\thmheadindent}
\global\thmheadindent0cm
\newdimen\theorem@indent
\def\thm@headindent
        {\the\thmheadindent}
\newtheoremstyle{indenthead}%
  {\item[\hskip\labelsep\hskip\thm@headindent \theorem@headerfont ##1\ ##2\theorem@separator]}%
  {\item[\hskip\labelsep\hskip\thm@headinden \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]}
\makeatother

\theoremstyle{indenthead}

\theorembodyfont{\normalfont}
\theoremseparator{:}
\thmheadindent \parindent
\newtheorem{hyp}{Hypothese}


\begin{document}

\chapter{}

\lipsum[11]

\begin{hyp}
Here should be Hypothesis number one with first line indented and the remaining text normally over the whole page. T \end{hyp}

\begin{hyp}
Here is another Hypothesis with an indented first line and remaining text like in the remaining thesis.
\end{hyp}

\end{document} 

enter image description here

1
  • Nice implementation...
    – Werner
    Jul 28, 2016 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .