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.3. Verbatims\wrappingon\wrappingoff\verbatimindent\verbatimbreakchar{〈char〉}As noted, whatever is written in a verbatim environment is output just as written, evenif lines are too long to fit on the page. <strong>The</strong> declaration \wrappingon lets the environmentbreak lines so that they do not overflow. <strong>The</strong> declaration \wrappingoff restores thenormal behaviour.<strong>The</strong> following is an example of how a wrapped verbatim line looks. In the source thecontents of the verbatim was written as a single line.This is an example of line wrapping in the verbatim environment. It %is a single line in the source and the \wrappingon %declaration has been used.<strong>The</strong> wrapped portion of verbatim lines are indented from the left margin by the length\verbatimindent. <strong>The</strong> value can be changed by the usual length changing commands.<strong>The</strong> end of each line that has been wrapped is marked with the 〈char〉 character of the\verbatimbreakchar macro. <strong>The</strong> <strong>class</strong> default is \verbatimbreakchar{\char‘\%},so that lines are marked with %. To put a ‘/’ mark at the end of wrapped lines you can do\setverbatimbreak{\char’\/}or similarly if you would like another character. Another possibility is\setverbatimchar{\char’\/\char’\*}which will make ‘/*’ the end marker.15.3.1 Boxed verbatimsVerbatim environments are often used to present program code or, as in this book, La<strong>TeX</strong>code. For such applications it can be useful to put the code in a box, or to number the codelines, or perhaps both.\begin{fboxverbatim} anything \end{fboxverbatim}<strong>The</strong> fboxverbatim environment typesets its contents verbatim and puts a tightly fittingframe around the result; in a sense it is similar to the \fbox command.\begin{boxedverbatim} anything \end{boxedverbatim}\begin{boxedverbatim*} anything \end{boxedverbatim*}<strong>The</strong> boxedverbatim and boxedverbatim* environments are like the verbatim andverbatim* environments except that a box, allowing page breaks, may be put aroundthe verbatim text and the lines of text may be numbered. <strong>The</strong> particular format of theoutput can be controlled as described below.\bvbox \bvtopandtail \bvsides \nobvbox\bvboxsepFour styles of boxes are provided and you can extend these. Following the \bvbox declaration,a box is drawn round the verbatim text, breaking at page boundaries if necessary;this is the default style. Conversely, no boxes are drawn after the \nobvbox declaration.281

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

Saved successfully!

Ooh no, something went wrong!