\ProvidesPackage{answer}[1996/11/10 answer boxes that allow solutions]
% Written by Nick Urbanik,

% $Header$

% $Log$

\RequirePackage{ifthen}

\@ifundefined{s}{\global\def\s#1{}}

\newlength{\answerBoxWidth}%
\newcommand{\answerbox}[2][.3\columnwidth]%
{%
  \settowidth{\answerBoxWidth}{\s{#2}}%
  \addtolength{\answerBoxWidth}{2\fboxsep}%
  \ifthenelse{\lengthtest{#1 > \answerBoxWidth}}%
    {\setlength{\answerBoxWidth}{#1}}%
  %else
    {}
  \nolinebreak[1]\mbox{}\dotfill%
  \nolinebreak\hspace{2ex}\nolinebreak%
  \ifthenelse{\lengthtest{\answerBoxWidth > \linewidth}}%
  {%
    \setlength{\answerBoxWidth}{\linewidth}%
    \addtolength{\answerBoxWidth}{-2\fboxsep}%
    \par\noindent%
    \framebox{\parbox{\answerBoxWidth}{\s{#2}}}%
  }%
  %else
    {\framebox[\answerBoxWidth]{\rule{0pt}{\baselineskip}\s{#2}}\sloppypar}%
%  \sloppypar%
}

