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.3. Verbatims\newcommand{\nobvbox}{%\bvperpagefalse\renewcommand{\bvtoprulehook}{}%\renewcommand{\bvleftsidehook}{}%\renewcommand{\bvrightsidehook}{}%\renewcommand{\bvendrulehook}{}%\renewcommand{\bvtopmidhook}{\rule{0pt}{2\fboxsep} \hss}%}<strong>The</strong> definitions of the other styles, \bvtopandtail and \bvsides, are intermediate between\bvbox and \nobvbox in the obvious manner.\linenumberfrequency{〈nth〉}\resetbvlinenumber\setbvlinenums{〈first〉}{〈startat〉}\linenumberfont{〈font declaration〉}<strong>The</strong> command \linenumberfrequency controls the numbering of lines in aboxedverbatim — every 〈nth〉 line will be numbered. If 〈nth〉 is 0 or less, then no lines arenumbered, if 〈nth〉 is 1 then each line is numbered, and if 〈nth〉 is n, where n is 2 or more,then only every nth line is numbered. Line numbering is continuous from one instance ofthe boxedverbatim environment to the next. Outside the environment the line numberscan be reset at any time by the command \resetbvlinenumber.<strong>The</strong> \setbvlinenums macro can be used to specify that the number of the first line ofthe following boxedverbatim shall be 〈first〉 and the first printed number shall be 〈startat〉.<strong>The</strong> \linenumberfont declaration sets 〈font declaration〉 as the font for the line numbers.<strong>The</strong> default specification for this is:\linenumberfont{\footnotesize\rmfamily}Line numbers are always set at the left of the lines because there is no telling how long aline might be and it might clash with a line number set at the right.\bvnumbersinside\bvnumbersoutsideLine numbers are typeset inside the box after the declaration \bvnumberinside and aretypeset outside the box after the declaration \bvnumbersoutside. <strong>The</strong> default is to printthe numbers inside the box.Verbatim tabbing, but not wrapping, applies to the boxedverbatim environment.15.3.2 New verbatims<strong>The</strong> <strong>class</strong> implementation of verbatims lets you define your own kind of verbatim environment.Unfortunately this is not quite as simple as saying\newverbatim{myverbatim}{...}{...}as you can for defining normal environments. Instead, the general scheme is\newenvironment{myverbatim}%{ \verbatim }%{\endverbatim}In particular, you cannot use either the \begin or \end macros inside the definition of thenew verbatim environment. For example, the following code will not work283

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

Saved successfully!

Ooh no, something went wrong!