12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

15. BOXES, VERBATIMS AND FILES<strong>The</strong> advantage of using the \label and \ref mechanism is that a question and itsanswer need not be adjacent in the source; I think that you have seen some of the disadvantages.Another disadvantage is that it is difficult to use, although not impossible, if youwant the answers in a separate document.<strong>The</strong> real answer to all the problems is force an answer to come immediately after thequestion in the source and to use the question counter directly, as in the endnotes example.In the traditional manner, this is left as an exercise for the reader.15.5 ANSWERSQuestion 1. As a convenience, the argument to the environment could be made optional,defaulting, say, to the current line width. If the default width is used the frame will bewider than the line width, so we really ought to make the width argument specify thewidth of the frame instead of the minipage. This means calculating a reduced width forthe minipage based on the values of \fboxsep and \fboxrule.\newsavebox{\minibox}\newlength{\minilength}\newenvironment{framedminipage}[1][\linewidth]{%\setlength{\minilength}{#1}\addtolength{\minilength}{-2\fboxsep}\addtolength{\minilength}{-2\fboxrule}\begin{lrbox}{\minibox}\begin{minipage}{\minilength}}%{\end{minipage}\end{lrbox}\fbox{\usebox{\minibox}}}Question 2. <strong>The</strong>re are at least three reasonable answers. In increasing or decreasing orderof probability (your choice) they are:• I took Sherlock Holmes’ advice and followed the methods outlined in the chapter;• I used a package, such as the answer package which is designed for the purpose;• I just wrote the answers here.294

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!