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{\end{minipage}\end{lrbox}\fbox{\usebox{\minibox}}}Question 1. Can you think of any improvements to the definition of the framedminipageenvironment?Question 2. An answer to question 1 is at the end of this chapter. Suggest how it was putthere.15.1 BOXESLa<strong>TeX</strong> provides some commands to put a box round some text. <strong>The</strong> <strong>class</strong> extends theavailable kinds of boxes.\begin{framed} text \end{framed}\begin{shaded} text \end{shaded}\begin{snugshade} text \end{snugshade}<strong>The</strong> framed, shaded, and snugshade environments, which were created by Donald Arseneauas part of his framed package [Ars07], put their contents into boxes that break acrosspages. <strong>The</strong> framed environment delineates the box by drawing a rectangular frame. Ifthere is a pagebreak in the middle of the box, frames are drawn on both pages.<strong>The</strong> shaded environment typesets the box with a shaded or colored background. Thisrequires the use of the color package [Car05], which is one of the required La<strong>TeX</strong> packages,or the xcolor package [Ker07]. <strong>The</strong> shading color is shadecolor, which you have to definebefore using the environment. For example, to have a light gray background:\definecolor{shadecolor}{gray}{0.9}For complete information on this see the documentation for the color or xcolor packages, orone of the La<strong>TeX</strong> books like the Graphics Companion [GM + 07]. In the snugshaded environmentthe box clings more closely to its contents than it does in the shaded environment.Be aware that these boxes are somewhat delicate; they do not work in all circumstances.For example they will not work with the multicol package [Mit98], and any floats or footnotesin the boxes will disappear.\FrameRule \FrameSep \FrameHeightAdjust<strong>The</strong> framed environment puts the text into an ‘\fbox’ with the settings:\setlength{\FrameRule}{\fboxrule}\setlength{\FrameSep}{3\fboxsep}<strong>The</strong> macro \FrameHeightAdjust specifies the height of the top of the frame above thebaseline at the top of a page; its initial definition is:\providecommand*{\FrameHeightAdjust}{0.6em}\MakeFramed{〈settings〉} \endMakeFramed\FrameCommand \FrameRestoreInternally, the environments are specified using the MakeFramed environment. <strong>The</strong>〈setting〉 should contain any adjustments to the text width (applied to \hsize and using274

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

Saved successfully!

Ooh no, something went wrong!