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.

CONTENTSSNIPLET C.2 (REMOVE PAGENUMBER IF ONLY ONE PAGE)Memoir counts all the pages used. You can use this information in various ways. Forexample, say you are preparing a setup to write small assignments in, these may or maynot be just one page. How do we remove the footer automatically if there is only one page?Easy, place the following in the preamble (compile at least twice):\AtEndDocument{\ifnum\value{lastsheet}=1\thispagestyle{empty}\fi}SNIPLET C.3 (A KIND OF DRAFT NOTE)Bastiaan Veelo has kindly provided example code for another form of a side note, as follows.%% A new command that allows you to note down ideas or annotations in%% the margin of the draft. If you are printing on a stock that is wider%% than the final page width, we will go to some length to utilise the%% paper that would otherwise be trimmed away, assuming you will not be%% trimming the draft. <strong>The</strong>se notes will not be printed when we are not%% in draft mode.\makeatletter\ifdraftdoc\newlength{\draftnotewidth}\newlength{\draftnotesignwidth}\newcommand{\draftnote}[1]{\@bsphack%{%% do not interfere with settings for other marginal notes\strictpagecheck%\checkoddpage%\setlength{\draftnotewidth}{\foremargin}%\addtolength{\draftnotewidth}{\trimedge}%\addtolength{\draftnotewidth}{-3\marginparsep}%\ifoddpage\setlength{\marginparwidth}{\draftnotewidth}%\marginpar{\flushleft\textbf{\textit{\HUGE !\ }}\small #1}%\else\settowidth{\draftnotesignwidth}{\textbf{\textit{\HUGE\ !}}}%\addtolength{\draftnotewidth}{-\draftnotesignwidth}%\marginpar{\raggedleft\makebox[0pt][r]{%% hack around402}%\fi}\@esphack}\parbox[t]{\draftnotewidth}{%%%%%%%%%\raggedleft\small\hspace{0pt}#1%}}\textbf{\textit{\HUGE\ !}}%funny behaviour

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

Saved successfully!

Ooh no, something went wrong!