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.

6.7. Fancy anonymous breaksI used \fancybreak as I’m not sure where the break will come on the page and the simple\pfbreak macro might just have produced a couple of blank lines instead of the fancydisplay.<strong>The</strong> paragraph following \pfbreak is not indented. If you want it indented use the\pfbreak* starred version.❧ ❧ ❧<strong>The</strong> fancy break using fleurons just before this paragraph was produced by:\renewcommand{\pfbreakdisplay}{%\ding{167}\quad\ding{167}\quad\ding{167}}\fancybreak{\pfbreakdisplay}where the \ding command is from the pifont package.⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄⋄<strong>The</strong> fancy break made with fleurons was simple to specify. <strong>The</strong>re are many other symbolsthat you can use in La<strong>TeX</strong> and these can be combined in potentially attractive ways toproduce a fancy break like the one just above.<strong>The</strong> following idea was originally suggested by Christina Thiele [Thi98], and can beused to string together mathematical symbols. It works following the same principles asthe dot leaders in the Table of Contents.Define a macro called with the syntax \motif{〈shape〉}, where 〈shape〉 is a symbol orother shape to be repeated in a chain,\newcommand{\motif}[1]{\cleaders\hbox{#1}\hfil}<strong>The</strong> definition of \motif is basically taken from <strong>TeX</strong>, and is part of the code for makingthings like dot leaders. \hbox{〈stuff 〉} puts 〈stuff 〉 into a horizontal box, and\cleaders〈box〉 fills a specified amount of space using whatever number of copies ofthe 〈box〉 as is needed; if there is too much space to be filled by a whole number of boxes,the spare space is spread around equally. \hfil is stretchy space. <strong>The</strong> \motif macroessentially says, fill up a space with with copies of 〈shape〉.We also need another macro, \chain{〈shape〉}{〈length〉}, where {〈shape〉} is a shape tobe repeated as many times as it takes to fill up a distance 〈length〉.\newcommand{\chain}[2]{\leavevmode\hbox to #2{\motif{#1}}}<strong>The</strong> \leavevmode makes sure that we are typesetting horizontally, and \hbox to{stuff} puts 〈stuff 〉 into a horizontal box with the fixed length of 〈length〉.Roughly, what \chain and \motif do together is typeset enough copies of 〈shape〉 tomake up a distance 〈length〉.That is what we have been aiming for. All that remains is to decide on what shape wemight want to use. Here is one consisting of diamonds.\makeatletter\newcommand{\diamonds}{\m@th$\mkern-.6mu \diamond \mkern-.6mu$}\makeatother<strong>The</strong> \diamond symbol can only be used in math mode, hence it is surrounded by theshorthand $...$. <strong>TeX</strong> usually leaves a little space around maths but the \m@th commandstops that. \mkern adjusts space in math mode, and in this case we are eliminating thespaces 16 that would normally be on either side of the diamond symbol. <strong>The</strong> whole effectgives us a diamond symbol with zero space around it.16 It is usually a matter for experiment to find the right values for the kerning.99

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

Saved successfully!

Ooh no, something went wrong!