Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

theorem-like environment: hanging indent

18 views
Skip to first unread message

hzb...@gmail.com

unread,
Nov 12, 2008, 2:00:28 PM11/12/08
to
Hello,

I am trying to create a theorem-like environment that delivers a
theorem to be indented except for the first line, ie hanging indent:

Example 1.1. Bla bla
Bla bla
Bla bla

Is there something I could modify the following code to make it work?

\theoremstyle{definition}
\newtheorem{example}{Example}[section]


Alternatively, I tried with ntheorem (see below). However, I cannot
make the first line to be not indented.

\documentclass{article}
\usepackage{ntheorem}
\theoremstyle{plain} \theorembodyfont{\normalfont}
\theoremheaderfont{\bfseries} \theoremseparator{.}
\setlength\theoremindent{2cm}
\newtheorem{example}{Example}[section]

\begin{document}
\begin{example} bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla
\end{example}
\end{document}


Any suggestion is appreciated.

Thanks in advance,
Herman

Alan Munn

unread,
Nov 13, 2008, 12:32:38 AM11/13/08
to
In article
<128fd5b4-78e2-49b8...@n1g2000prb.googlegroups.com>,
hzb...@gmail.com wrote:

> Hello,
>
> I am trying to create a theorem-like environment that delivers a
> theorem to be indented except for the first line, ie hanging indent:
>
> Example 1.1. Bla bla
> Bla bla
> Bla bla

How about the following:

\documentclass{article}
\usepackage{hanging, tocloft, lipsum}
\newcommand{\listexname}{List of Examples}
\newlistof[section]{example}{lox}{\listexname}
\newenvironment{example}{\refstepcounter{example}\bigskip\noindent\textbf
{Example \theexample.}\hspace{1em}\hangpara{.25in}{1}}{\bigskip}
\begin{document}
\section{}
\begin{example} \lipsum[1]
\end{example}
\lipsum[3]
\begin{example}\lipsum[2]
\end{example}
\end{document}

One caveat: this will only work with a single paragraph in the example.
Maybe there's a simpler way to do this.

Alan

hzb...@gmail.com

unread,
Nov 13, 2008, 7:49:06 AM11/13/08
to
On Nov 13, 12:32 am, Alan Munn <am...@msu.edu> wrote:
> In article
> <128fd5b4-78e2-49b8-9350-bd9bfb473...@n1g2000prb.googlegroups.com>,

Thanks Alan. Actually, I have more than one paragraph in the example,
and as you said, the solution above allows for only one.
Herman

Alan Munn

unread,
Nov 13, 2008, 9:00:56 AM11/13/08
to
In article
<8f08440e-193e-4c88...@a29g2000pra.googlegroups.com>,
hzb...@gmail.com wrote:

Not pretty, but this can be fixed if you are willing to separate
paragraphs within the example by a separate command rather than just a
blank line.

\documentclass{article}
\usepackage{hanging, tocloft, lipsum}
\newcommand{\listexname}{List of Examples}
\newlistof[section]{example}{lox}{\listexname}

\newenvironment{example}{\refstepcounter{example}\bigskip\begin{hangparas
}{.25in}{1}\noindent\textbf{Example
\theexample.}\hspace{1em}}{\end{hangparas}\par\bigskip}
\newcommand{\hpar}{\hspace{.5in}}


\begin{document}
\section{}
\begin{example}

\lipsum[1]\hpar
\lipsum[2]\hpar
\lipsum[3]
\end{example}
\end{document}

Alan

0 new messages