[texhax] custom parbox with fancy border, how?

Meron Brouwer meron.brouwer at gmail.com
Sun Apr 30 12:22:19 CEST 2006

I have stumbled upon I problem I have trouble solving. Hopefully
someone can help me with this.

I'm making a new environment voor exercises in a math-book that needs
to have the following look:
- The width is \textwidth
- It starts width the word "exercise" followed by a number and the
enumerated different      parts of the exercise. (yes, this was the
trivial part)
- From the top left, starting underneath the word "exercise" I want a
gray line stretching to the right side of the paper, using an arch
going straight down. At the bottem of the exercise it needs to use
another arch to go left, where it is terminated.

In ascii, it would look something like this:

Exercise 1.1
---------------------------------------------------------------------------------------------------\
a) blahblah
|
b) blahblah
|

---------------------------/

The problem I can't solve is the height of the box and how to place
the arches.  The horizontal lines are easy, but how do I get the
vertical line the right length? Is there some way I can get the height
of the box from TeX? Or use some rubber length as I'm doing with the
horizontal lines?

With out the vertical line, my code looks like this:

%---------------------
\newenvironment{exercise}{\begin{minipage}{\textwidth}
\renewcommand\theenumi{\alph{enumi}}
\renewcommand\labelenumi{\textbf{\theenumi)}}
\mbox{}\\
\rput(0,-1.5){\psline[linecolor=lightgray,linewidth=\textwidth]{-c}(30,0)}\textbf{exercise
\thechapter .\theopgave}\begin{itemize}\item[]}
{\end{itemize}\rput(\textwidth,\baselineskip){\psline[linecolor=lightgray,linewidth=0.7]{-c}(-30,0)}
\renewcommand\theenumi{\arabic{enumi}}
\end{minipage}}
%-------------------

Is there anyone who can solve this problem?

Thanks,
meron