Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Considering this post theorem environment with hanging indentation and Stefan's answer, I'd be interested in the same approach with ntheorem. I've been through the .sty file but I have hard time finding where the beginning and the end of the theorem environments are defined.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You can use the predefined commands of ntheorem to manipulate the style. In the example I uses \theoremstyle{break} do set the global style.

\theoremindent is used to set the indention of the whole environment.

theoremheaderfont is used befor every header. So I use this command to "reindent" the \theoremindent

\documentclass{article}
\usepackage{ntheorem}
\theoremstyle{break}
\theoremindent=2cm
\theoremheaderfont{\kern-1cm\normalfont\bfseries} 

\newtheorem{defi}{Definition}

\usepackage{showframe,lipsum}
\begin{document}
\begin{defi}
\lipsum[1]
\end{defi}
\end{document}
share|improve this answer
    
I was just going to give this same solution ;-) –  Gonzalo Medina Nov 12 '11 at 20:06
    
@GonzaloMedina: The first time I am faster as you ;-) –  Marco Daniel Nov 12 '11 at 20:07
    
indecently smart! –  pluton Nov 12 '11 at 20:26
add comment

Here we define a theorem style quote, which is similar to the break style but uses a quote environment in addition. As example, I took the theorem example from your link.

\documentclass{article}
\usepackage{ntheorem}
\makeatletter
\newtheoremstyle{quote}%
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
          ##1\ ##2\theorem@separator}\hbox{\strut}}}]\quote}%
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
          ##1\ ##2\ (##3)\theorem@separator}\hbox{\strut}}}]\quote}
\makeatother
\theorempostwork{\endquote}
\theoremstyle{quote}
\newtheorem{thm}{Theorem}
\begin{document}
\section*{The Theorem of Pythagoras}
Text body. Text body. Text body.
\begin{thm}%[Pythagoras]
    Let $a,b,c$ the sides of a rectangular triangle.
    Without loss of generality, we assume that  $a<b<c$ .
    Then, the following equality holds:
          \[a^2 + b^2 = c^2\]
\end{thm}
\noindent More text. And even more text.
\end{document}

Theorem with indentation

share|improve this answer
    
Thanks. I already modified this portion of the code for other purposes but I could not guess it was possible to embed the quote environment here. –  pluton Nov 12 '11 at 20:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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