# [OS X TeX] environment question

Art Werschulz agw at comcast.net
Tue May 19 12:03:31 EDT 2009

Hi.

I have created an environment called "offset", which I use for
material that needs to be offset from the main text flow.  Here is a
small LaTeX file that illustrates its definition and use.

<snip>
\documentclass{article}

\newenvironment{offset}%
{\bigskip\hrule\nopagebreak\bigskip\nopagebreak\noindent%
\textbf{#1}\nopagebreak\par\medskip\nopagebreak\noindent}%
{\nopagebreak\bigskip\hrule\bigskip}

\begin{document}
My first example is
Given two disjoint events, $E_1$ and $E_2$, with associated
probabilities P($E_1$) and P($E_2$), the probability of $E_1$
\emph{or} $E_2$ occurring is equal to
to $P(E_1) + P(E_2)$.  That is,
$P(E_1 \cup E_2) = P(E_1) + P(E_2)$
if $E_1$ and $E_2$ are disjoint.
\end{offset}
As you can see, this looks pretty good.

My second example is:
Given events $E_1$ and $E_2$, with associated
probabilities $P(E_1)$ and $P(E_2)$, the probability of $E_1$
\emph{or} $E_2$ occurring is
$P(E_1\cup E_2) = P(E_1) + P(E_2) - P(E_1 \cap E_2)$
\end{offset}
That extra space between the math display and the horizontal line is
ugly.

\end{document}
</snip>

Note the following:
(1) The comment about the extra (vertical) space.
(2) I need to put a % after the argument, to avoid an extra horizontal
space.
Any ideas how to fix this?  Is there something pre-existing that I can

Thanks.

Art Werschulz
207 Stoughton Avenue, Cranford  NJ 07016-2838
(908) 272-1146