[OS X TeX] Special Horizontal Rule

David Arnold dwarnold45 at suddenlink.net
Thu Dec 24 19:17:42 EST 2009

All,
I'd like to adjust my example environment in the code below so that
each example is bracketed between two horizontal rules. The first rule
should be placed above the example, align with the inner edge of the
text and flow to the outer edge of the text, add a couple of spaces in
the outer margin, typeset "You Try It", then continue to flow to
within 1 cm of the page edge.

Similarly, for the rule at the bottom of the example, I'd like to
start it at the inner edge of the text, flow into the outer margin,
then typeset the square that is flush right within 1 cm of the paper
edge.

Can anyone help with an example?

David

\documentclass{memoir}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xcolor}
\usepackage{exerquiz}

\usepackage{xcolor}
\definecolor{shadecolor}{gray}{0.9}
\definecolor{darkgreen}{rgb}{0,0.625,0}
\definecolor{darkred}{rgb}{0.625,0,0}

\newcounter{example}[section]
\renewcommand{\theexample}{\arabic{example}}
\newenvironment{example}%
{\medskip\refstepcounter{example}
\par\noindent\textbf{Example \theexample.}}%
{\flushright{\Large\color{darkgreen}$\square$}\par\medskip}

\begin{document}

\section{Introduction}

Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.

\begin{example}
\marginpar{You Try It!\newline Simplify: $33+28$}
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
\end{example}

Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.
Now is the time for all good men to come to the aid of their country.

\end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20091224/a368b4b5/attachment.html>


More information about the MacOSX-TeX mailing list