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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15. BOXES, VERBATIMS AND FILES<strong>The</strong> \MakeShortVerb and \DeleteShortVerb macros come from the shortvrb packagewhich is part of the La<strong>TeX</strong> base system, but I have found them so convenient that Iadded them to the <strong>class</strong>.\setverbatimfont{〈font-declaration〉}<strong>The</strong> default font for verbatims is the normal sized monospaced font. <strong>The</strong> declaration\setverbatimfont can be used to specify a different font. <strong>The</strong> <strong>class</strong> default is\setverbatimfont{\normalfont\ttfamily}To use a smaller version simply say\setverbatimfont{\normalfont\ttfamily\small}A monospaced font is normally chosen as verbatim text is often used to present programcode or typewritten text. If you want a more exotic font, try this\setverbatimfont{\fontencoding{T1}\fontfamily{cmss}\selectfont}and your verbatim text will then look likeWe are no longer using the boring old typewriter fontfor verbatim text. We used the T1 encodingto make sure that characters that are often ligatureslike ‘‘, or ’’, or ---, or , print as expected.After this we will switch back to the default verbatim font via\setverbatimfont{\normalfont\ttfamily}In the normal way of things with an OT1 fontencoding, typesetting the ligatures mentionedabove in the sans font produces: ligatures like “, or ”, or —, or ¡, or ¿, which is notwhat happens in the \verbatim environment.\begin{verbatim} anything \end{verbatim}\begin{verbatim*} anything \end{verbatim*}In the verbatim environment 3 you can write anything you want (except\end{verbatim}), and it will be typeset exactly as written. <strong>The</strong> verbatim* environmentis similar except, like with \verb*, spaces will be indicated with a mark.\tabson[〈number〉]\tabsoff<strong>The</strong> standard verbatim environment ignores any TAB characters; with the <strong>class</strong>’s environmentafter calling the \tabson declaration the environment will handle TAB characters.By default 4 spaces are used to represent a TAB; the optional 〈number〉 argument to thedeclaration will set the number of spaces for a TAB to be 〈number〉. Some folk like to use 8spaces for a TAB, in which case they would need to declare \tabson[8]. Unremarkably,the declaration \tabsoff switches off TABs. <strong>The</strong> <strong>class</strong> default is \tabsoff.3 This version of the verbatim environment is heavily based on the verbatim package [SRR99] but does providesome extensions.280

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

Saved successfully!

Ooh no, something went wrong!