[Tex/LaTex] How to manipulate theorem body text indentation (using amsthm package)

amsthmtheorems

I would like to create the following formatting for summing up hypotheses (I am using the report documentclass):

Body text. Body text. Body text. Body text. Body text. Body text. Body text. Body text. 

     Hypothesis 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
     Phasellus iaculis imperdiet blandit. 

Body text. Body text. Body text. Body text. Body text. Body text. Body text. Body text. 

So far this is what I have managed to come up with (I'm trying to do it with the amsthm package):

\documentclass[11pt]{report}
\usepackage[bottom=2cm, top=2cm, left=3cm, right=2cm]{geometry}
\usepackage{lipsum}

\usepackage{amsthm} 
\newtheoremstyle{hypothesis}
    {5pt}
    {5pt}
    {\itshape} 
    {1cm} 
    {\bfseries} 
    {} 
    {.5em}
    {}
\theoremstyle{hypothesis}
\newtheorem{hypo}{Hypothesis}

\begin{document}
\lipsum[1]

\begin{hypo}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus iaculis imperdiet blandit.
\end{hypo}

\lipsum[2]
\end{document}

Which produces the following:

enter image description here

As you can see I'm almost there. The only thing I still need now is that the hypothesis body text has the same indentation as the hypothesis head (i.e. when the hypothesis body continues on a new line, that line has to begin at the same point that the hypothesis head begins).

I feel like it has to be something very simple, but I can't seem to figure it out. Any help would be greatly appreciated.

Best Answer

A modification of https://tex.stackexchange.com/a/106582/4427

\documentclass[a4paper]{scrartcl}
\usepackage{amsthm,thmtools}
\usepackage{etoolbox}
\usepackage{lipsum}
\usepackage{showframe}

\makeatletter
\patchcmd\@thm
  {\trivlist}
  {\list{}{\theoremmargins}}
  {}{}
\newcommand{\xdeclaretheorem}[2][]{%
  \declaretheorem[#1]{#2}%
  \expandafter\patchcmd\csname thmt@original@end#2\endcsname
    {\endtrivlist}{\endlist}{}{}%
}
\newcommand{\theoremmargins}{\leftmargin=0pt}
\newcommand{\theoremindent}{\leftmargin=2.5em\rightmargin=2.5em}

\declaretheoremstyle[
  headfont=\bfseries,
  bodyfont=\itshape,
  headindent=0pt,
]{INDENTthm}

\xdeclaretheorem[
  preheadhook=\let\theoremmargins\theoremindent,
  within=section,
  style=INDENTthm,
  name=Hypothesis
]{hyp}

\declaretheorem[
  style=plain,
  name=Theorem
]{thm}

\begin{document}
\lipsum[1]
\begin{thm}
\lipsum*[2]
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{thm}
\lipsum[2]
\begin{hyp}
\lipsum*[2]
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{hyp}
\end{document}

As usual, showframe is just for showing the text block boundaries.

enter image description here