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.

Well I want to do is when LaTeX writes Theorem at the new line instead of the left side of the page it be a little indented. In other words I want it to start from a little bit to the right.

share|improve this question
    
I don't understand the question. –  IARI Aug 15 '12 at 8:25
    
Can you please accept an given answer or make your question clearer as one comment said? With a high accept rate people answers much more –  Kurt Aug 25 '12 at 20:52
add comment

3 Answers 3

Use the ntheorem package.

\usepackage{ntheorem}
\setlength\theoremindent{\parindent}
\newtheorem{thm}{Theorem}

Now the thm environment will be indented the same amount as a paragraph.

share|improve this answer
add comment

Here's a solution using etoolbox and the addmargin environment of the scrextend package (which is included in KOMA-script):

\documentclass{article}

\newtheorem{theorem}{Theorem}

\usepackage{etoolbox}
\usepackage{scrextend}
\pretocmd{\theorem}{\bigskip\begin{addmargin}[1.5em]{0pt}}{}{}
\apptocmd{\endtheorem}{\end{addmargin}\bigskip}{}{}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\blindtext

\begin{theorem}
\blindtext
\end{theorem}

\blindtext

\end{document}
share|improve this answer
1  
Please add \documentclass[english]{article} \usepackage{babel} to compile without errors. –  Marco Daniel Sep 3 '11 at 12:10
1  
There is also a marginbox environment from the adjustbox package (starting from 2011/08/13), which could also be used here. –  Martin Scharrer Sep 4 '11 at 21:28
add comment

one possible solution here, maybe not the best. If you are happy with it, you may want to control the indentation with the line

\def\theoremframecommand{{\hspace{10pt}}}

minimal exmaple is:

\documentclass[fleqn]{book}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[top=3cm,left=3cm,right=3cm,bottom=2.5cm,a4paper]{geometry}
\usepackage{amsmath}
\usepackage{framed}
\usepackage[amsmath,thmmarks,framed]{ntheorem}
\usepackage{lipsum}

\theoremstyle{plain}
\theorembodyfont{\normalfont}
\setlength\theorempreskipamount{0pt}
\setlength\theorempostskipamount{-3pt}
\def\theoremframecommand{{\hspace{10pt}}}
\newshadedtheorem{Theorem}{Theorem}[chapter]

\begin{document}
\section{chapter 1}
\section{section 1}
\lipsum[5]
\begin{Theorem}[Theorem 1]
\lipsum[5]
\end{Theorem}
\lipsum[5]
\end{document}
share|improve this answer
    
unfortunately, it seems that there is no easy way to remove the automatic indentation of the text coming just after the theorem –  pluton Sep 14 '10 at 11:27
    
Do you looking for something like this: \makeatletter \g@addto@macro\@endtheorem{\@afterheading} \makeatother –  Marco Daniel Sep 3 '11 at 12:17
    
it looks like the indentation is still there after a theorem with your suggestion? –  pluton Sep 4 '11 at 19:50
    
You mean the indention after end{Theorem}. Yes with the code above I get no indention. –  Marco Daniel Sep 4 '11 at 20:27
    
I think I will have to try with a minimal example. On the file I tried, it did not change anything. –  pluton Sep 4 '11 at 20:46
show 2 more comments

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.