# [OS X TeX] collecting solutions to practice problems

Art Werschulz agw at comcast.net
Tue May 25 18:14:19 EDT 2010

Hi all.

I'm part of a team that's writing a textbook.  Each chapter of the book
is in a separate LaTeX file (such as "01-intro.tex").  Each chapter has
practice problems and exercises.  Exercises appear at the end of each
chapter.  Using the answers package, I have set things up so that we can
write

\begin{exercises}

\begin{ex}
The exercise.
\begin{soln}
Its solution.
\end{soln}
\end{ex}

\begin{ex}
Stuff that applies to multi-item exercise.
\begin{problist}
\item First item.
\item Second item.
\end{problist}
\begin{soln}
\begin{solnlist}
\item Solution to first item.
\item Solution to second item.
\end{solnlist}
\end{soln}
\end{ex}

\end{exercises}

All very neat and tidy.

I'm now trying to deal with practice problems.  A practice problem can
appear anywhere in the text.  However, solutions to practice problems
should appear at the end of the chapter, just before the exercises.

A practice problem should appear in the LaTeX file as:

\begin{prac}
Text of the practice problem.
\begin{soln}
Its solution.
\end{soln}
\end{prac}

For a multi-item practice problem, this should be

\begin{prac}
Stuff that applies to multi-item exercise.
\begin{praclist}
\item First item.
\item Second item.
\end{praclist}
\begin{soln}
\begin{solnlist}
\item Solution to first item.
\item Solution to second item.
\end{solnlist}
\end{soln}
\end{prac}

Before playing around with this myself, I thought I would see whether
anybody else had solved the problem (or knows of a quick solution).

Any ideas?  Thanks!
--
Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
Internet: agw STRUDEL comcast.net