<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12px; "><div id="inbdy">All, <br><p>I'd like to adjust my example environment in the code below so that <br>each example is bracketed between two horizontal rules. The first rule <br>should be placed above the example, align with the inner edge of the <br>text and flow to the outer edge of the text, add a couple of spaces in <br>the outer margin, typeset "You Try It", then continue to flow to <br>within 1 cm of the page edge. <br></p><p>Similarly, for the rule at the bottom of the example, I'd like to <br>start it at the inner edge of the text, flow into the outer margin, <br>then typeset the square that is flush right within 1 cm of the paper <br>edge. <br></p><p>Can anyone help with an example? <br></p><p>David <br></p><p>\documentclass{memoir} <br>\usepackage{amsmath} <br>\usepackage{amssymb} <br></p><p>\usepackage{xcolor} <br>\usepackage{exerquiz} <br></p><p>\usepackage{xcolor} <br>\definecolor{shadecolor}{gray}{0.9} <br>\definecolor{darkgreen}{rgb}{0,0.625,0} <br>\definecolor{darkred}{rgb}{0.625,0,0} <br></p><p>\newcounter{example}[section] <br>\renewcommand{\theexample}{\arabic{example}} <br>\newenvironment{example}% <br>{\medskip\refstepcounter{example} <br>  \par\noindent\textbf{Example \theexample.}}% <br>{\flushright{\Large\color{darkgreen}$\square$}\par\medskip} <br></p><p>\begin{document} <br></p><p>\section{Introduction} <br></p><p>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br></p><p>\begin{example} <br>\marginpar{You Try It!\newline Simplify: $33+28$} <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>\end{example} <br></p><p>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br>Now is the time for all good men to come to the aid of their country. <br></p><p>\end{document} <br></p><div><br></div></div></span></body></html>