About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Latest news 2019-12-05: new blog post "RSS Feeds and Other Notifications."


10.3 The leaflet Class

The leaflet class manual [64] is accessed using

texdoc leaflet-manual

If you just do

texdoc leaflet

you'll get the documented code instead.

The manual is formatted as a z-fold leaflet which illustrates the layout but makes on-screen reading difficult as the reverse sheet is upside-down.

The leaflet class loads the article class, but some changes are made to the defaults. For example, \part is not available and the other sectioning commands aren't numbered. You can use the letterpaper or a4paper class options to set the paper size, but other paper sizes may need to have the margins adjusted, which can be done using:

\setmargins{top}{bottom}{left}{right}

Marginal notes and two-column typesetting are disabled and by default there are no page headers or footers. Paragraph indentation is set to zero and paragraphs are separated by vertical space.

Class options (in addition to the options provided by article) are:

tumble
Print the back sheet upside-down (default).

notumble
Don't print the back sheet upside-down.

bothsides
Create both the front and back sheet (default).

frontside
Only create the front sheet.

backside
Only create the back sheet.

foldmark
Print a fold mark (default).

nofoldmark
Don't print a fold mark.

combine
Combine three pages to a sheet (default). An error is issued if too much text is generated to fit onto the front and back sheets. (The surplus text is ignored.)

nocombine
Don't combine multiple pages onto a single sheet.

twopart
Creates a four-page leaflet (first part) and a two-page detachable form (second part).

notwopart
Not a two-part leaflet (default).

You may find that ragged-right justification produces better results given the narrow page sizes (where a page is one-third of a sheet). The leaflet class provides the following commands:

\CutLine{page number}

This command may only be used in the preamble and indicates that a cut line should be drawn to the left of the page given by ⟨page number⟩. The starred version just draws a dotted line. The unstarred version draws a dotted line with a pair of scissors.

\AddToBackground{page number}{picture code}

Again this command may only be used in the preamble. This indicates that ⟨picture code⟩ should be added to the page given by ⟨page number⟩. With the starred version, the ⟨page number⟩ refers to the sheet number (1 for the front and 2 for the back sheet). The background is placed inside a picture environment, so the ⟨picture code⟩ may include any of the commands described in §10.1 The picture Environment. Remember that the co-ordinates are in terms of \unitlength. If you want to provide a specific length that's independent of \unitlength, the leaflet class provides:

\LenToUnit{length}

which may be used to specify a length.

The font declaration used for the sectioning commands is given by

\sectfont

This may be redefined as required. The default value is \bfseries. The font declaration used for the item label in the description environment is given by

\descfont

This may be redefined as required. The default value is \bfseries.

Example 51. Sample Leaflet

This example uses the starred version of \AddToBackground to place text across the first sheet and uses the unstarred version to place an oval on the first page. The origin is the lower left hand corner of the sheet/page. Rather than working out the co-ordinates in terms of \unitlength, I've used \LenToUnit with multiples of \paperwidth and \paperheight.

I've also changed the fonts used by the sectioning commands and the description item labels. Since the default Computer Modern fonts don't support bold smallcaps, I've used the Alegreya package [105] to switch to the Alegreya font, which does have bold smallcaps. (For other fonts, have a look at the Font Catalogue [49].) The wasysym package [42] provides the \Square command used for the tick boxes ☐.

Leaflets and flyers tend to be less structured than normal documents, so I've used some commands that typically shouldn't be used (or, at least, used only sparingly on the final copy) in article, report or book-like documents. These include

which forces a page break, without attempting to vertically justify the page,

which inserts a vertical space,

which inserts a vertical space that will expand to fit the available height. The paragraph justification can be made through an environment, such as center or flushright, which additionally inserts a vertical space above and below the environment, or the justification can be made through a declaration, such as \raggedright (recall Volume 1).

\documentclass[a4paper,12pt,notumble]{leaflet}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}

\usepackage{wasysym}
\usepackage{xcolor}
\usepackage{graphicx}

\renewcommand*{\sectfont}{\scshape}
\renewcommand*{\descfont}{\bfseries\scshape}

\AddToBackground*{1}{%
 \put (0,0) 
  {\rotatebox{33}{\resizebox{30cm}{!}{\color{lightgray}CLASSIFIED}}}%
}

\AddToBackground{1}{%
 \put
 (\LenToUnit{0.5\paperwidth},\LenToUnit{0.5\paperheight}) 
 {\oval(\LenToUnit{0.95\paperwidth},\LenToUnit{0.95\paperheight})}%
}

\CutLine{6}

\begin{document}
\begin{center}\bfseries\Huge
Culinary Experimental Research

\vfill

\normalsize
\begin{tabular}{c}
Secret Lab of Experimental Stuff\\
University of Somewhere
\end{tabular}

\vfill

\begin{tabular}{c}
Department of Stripy Confectioners\\
College of Somewhere Else
\end{tabular}

\vfill

\includegraphics[height=3cm]{dummy-logo}
\end{center}

\newpage
\raggedright

\section{Secret Lab of Experimental Stuff}

The Secret Lab of Experimental Stuff is a top-secret laboratory
whose existence is highly classified so don't tell anyone about it
or we'll get really cross with you.

The University of Somewhere denies all knowledge of the Secret Lab
of Experimental Stuff, except on Open Days where members of the
public may visit the facility and ask questions as long as they
consent to a memory wipe when they leave. The memory wipe is
harmless (well, we haven't really tested it properly, but no one's
complained so far) and your memory of the visit will be replaced by
a pleasant recollection of spending the day feeding the ducks in the
nearby pond.

\begin{flushright}
\includegraphics{mallard}
\end{flushright}

\section{Department of Stripy Confectioners}

% lots of text omitted

\newpage
\section{Query Form}

If you'd like to know more about the exciting collaboration between
the Secret Lab of Experimental Stuff and the Department of Stripy
Confectioners please fill in your details below and post this slip to:

\bigskip

\begin{tabular}{@{}l}
Miss Ingperson\\
Secret Lab of Experimental Stuff\\
University of Somewhere\\
Some City\\
AB3 4YZ
\end{tabular} 

\bigskip

\Square\␣I would like to receive quarterly newsletters.

\Square\␣I agree to having my memory wiped.

\Square\␣Yes, I'd really like to feed the ducks.

\bigskip

\begin{tabular}{@{}lp{4cm}}
Name: & \dotfill \\
Address: & \dotfill\\
 & \dotfill \\
 & \dotfill \\
 & \dotfill \\
Postcode: & \dotfill\\
Country: & \dotfill\\
Telephone: & \dotfill\\
Mobile: & \dotfill\\
Email: & \dotfill
\end{tabular}

\newpage

\section{Research Team}

\begin{description}
\item[Administrator] Mr Big Head

\item[Assistant Administrator] Dr Bor Ing

\item[Project Co-ordinator] Mabel Canary

\item[Senior Scientists] Dickie Duck, Polly Parrot

\item[Research Assistants] Zöe Zebra, José Arara, Fred Canary

\end{description}

\section{Acknowledgements}

The Culinary Experimental Research team would like to thank the
following:

\begin{description}

\item[University of Somewhere] For something or other

\item[College of Somewhere Else] For providing bread crumbs

\item[The Ministry of Top Secret Stuff] For supporting the 
project somehow.

\end{description}

\end{document}

(You can download or view this document, and the sample image files dummy-logo.png, mallard.png and goose.png.)

The resulting document is shown in Figure 10.3 (first sheet) and Figure 10.4 (second sheet). The small marker line to the right of the first section heading on the second sheet is the folding mark. Try this example first without and then with the twopart class option.

Figure 10.3: A Sample Leaflet (First Sheet)
 
Image of first sheet. This is in a three column landscape format. There's a dotted vertical line between the first and second column with two images of scissors. The word CLASSIFIED is written in light grey text across the sheet starting at the bottom left and ending at the top right. The third column is inside an oval.

First column (left-most panel):

Query Form

If you'd like to know more about the exciting collaboration between the Secret Lab of Experimental Stuff and the Department of Stripy Confectioners please fill in your details below and post this slip to:

Miss Ingperson
Secret Lab of Experimental Stuff
University of Somewhere
Some City
AB3 4YZ

☐ I would like to receive quarterly newsletters.

☐ I agree to having my memory wiped.

☐ Yes, I'd really like to feed the ducks.

Name: ....................
Address: ....................
  ....................
  ....................
  ....................
Postcode: ....................
Country: ....................
Telephone: ....................
Mobile: ....................
Email: ....................

[Vertical cut line.] The second column (middle panel):
Research Team

Administrator Mr Big Head

Assistant Administrator Dr Bor Ing

Project Co-ordinator Mabel Canary

Senior Scientists Dickie Duck, Polly Parrot

Research Assistants Zöe Zebra, José Arara, Fred Canary

Acknowledgements

The Culinary Experimental Research team would like to thank the following:

University of Somewhere For something or other

College of Somewhere Else For providing bread crumbs

The Ministry of Top Secret Stuff For supporting the project somehow.

Third column (right-most panel bordered by an oval outline):
Culinary
Experimental
Research

Secret Lab of Experimental Stuff
University of Somewhere

Department of Stripy Confectioners
College of Somewhere Else

[Image of logo.]

End of Image.

Figure 10.4: A Sample Leaflet (Second Sheet)
 
Image of second sheet. This is in a three-column landscape format.

First column (left-most panel):

Secret Lab of Experimental Stuff

The Secret Lab of Experimental Stuff is a top-secret laboratory whose existence is highly classified so don't tell anyone about it or we'll get really cross with you.

The University of Somewhere denies all knowledge of the Secret Lab of Experimental Stuff, except on Open Days where members of the public may visit the facility and ask questions as long as they consent to a memory wipe when they leave. The memory wipe is harmless (well, we haven't really tested it properly, but no one's complained so far) and your memory of the visit will be replaced by a pleasant recollection of spending the day feeding the ducks in the nearby pond.

[Image of mallard duck.]

Department of Stripy Confectioners

The Department of Stripy Confectioners is a department within the College of Somewhere Else. The department is internationally known for its cutting-edge research in the field of stripy confectionery, including humbugs and sticks of rock.

[Small vertical fold mark.] Second column (middle panel):
In a spirit of co-operation between the University of Somewhere and the College of Somewhere Else, a number of the department's faculty spend half their time feeding ducks in the pond near the University of Somewhere. The Department of Stripy Confectioners has received a grant of £1 million from the Ministry of Top Secret Stuff to purchase the bread crumbs provided by the University of Somewhere.

Mind-Controlling Cookies

Preliminary tests have shown that the mind-controlling properties of the mind-controlling cookies are somewhat disappointing, but critics have said that they taste very nice and could they have some more bread for the ducks.

Ingredients

  • Self-raising flour;
  • Butter;
  • Chocolate chips;
  • Sugar obtained from secret genetically modified beet.

Telepathic Cakes

Preliminary experiments on the telepathic cakes have revealed an unfortunate side-effect. The full results are in the senior scientist's head. Telepathy is required to view them. Please read the full terms and conditions before use.

The third column (right-most panel):
Ingredients

The ingredients of the telepathic cakes may be obtained telepathically on consumption of the cake.

Exploding Chocolates

One of the junior research assistants suffered injuries during the initial development phase but, after a full and detailed investigation, the health and safety department observed that there are also geese present in the duck pond.

[Image of a goose.]

End of Image.

Although the \AddToBackground hook adds code to the picture environment, if you prefer to use more advanced image drawing code, such as tikz [102] or pstricks [117], you can do so.

Example 52. Leaflet (with tikz)

The preamble code from Example 51 can be modified to use the tikz package. The new preamble is as follows:

\documentclass[a4paper,12pt,notumble]{leaflet}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}

\usepackage{wasysym}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}

\renewcommand*{\sectfont}{\scshape}
\renewcommand*{\descfont}{\bfseries\scshape}

\AddToBackground{1}{%
 \put (0,0) 
 {\begin{tikzpicture}
   \path[fill=Thistle1,draw=Thistle4,double=Orchid1,line width=2pt] 
     (0,0) rectangle ($(\paperwidth, \paperheight)-(4pt,4pt)$);
  \end{tikzpicture}
 }}

\CutLine{6}

The remainder of the document is as before. This uses the calc tikz library, which enables co-ordinate calculations using the $ syntax. For example

($(\paperwidth, \paperheight)-(4pt,4pt)$)

indicates the co-ordinate obtained by subtracting the point (4 pt,4 pt) from the point (\paperwidth,\paperheight). The calc library must first be loaded using:

The above example code also loads the xcolor package with the x11names option to enable the use of the X11 colour names, such as Thistle1. For further details about the syntax of the \path command, see the pgf/tikz user manual [102]. The first sheet is now as shown in Figure 10.5.

For other possible fancy frames or decorations, have a look at the decoration topic. There is also a non-CTAN tikz-based package called pgfornament available from http://altermundus.com/pages/tkz/ornament however this will require a manual installation since it's not included in the TeX distributions (recall Volume 1).

Figure 10.5: A Sample Leaflet Using tikz (First Sheet)
 
As previous first sheet except that the right-hand panel now has a pink background with a darker pink rectangular border.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).

© 2015 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs