-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

LaTeX Cookbook
By :

Flyers are a common way to promote an event or to inform about a product. In particular, a folded leaflet is very handy as a giveaway and to carry around, so let's see how to produce one.
The intended layout is very different compared to the already shown document types. Fortunately, there's a document class for it with the name leaflet
, which we will use now. Let's start filling it with some content. Let's take a look at the following steps:
leaflet
document class. Choose a base font size of 10 pt, and set the option notumble
, which keeps the back side printed in the same direction:\documentclass[10pt,notumble]{leaflet}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\renewcommand{\familydefault}{\sfdefault}
microtype
package:\usepackage{microtype}
graphicx
package to include a picture:\usepackage{graphicx}
\pagenumbering{gobble}
\begin{document}
\title{\textbf{\TeX\ Live Install Party}} \author{\Large\textbf{Your \TeX\ team}} \date{\textbf{August 11, City Hall Cellar}} \maketitle
\begin{center} \includegraphics[width=\linewidth]{ctanlion.pdf} \end{center}
We'd like to welcome you to our famous yearly \TeX\ install party! Bring your laptop and have free cold soft drinks while we assist you in installing the latest \TeX\ version on your computer. We will provide
itemize
environment for it, each list item starting with \item
:\begin{itemize} \item a fast internet connection fow downloading, \item media such as DVDs and USB sticks with the latest \TeX\, \item \TeX\ books for bying with a discount, \item chat with \TeX\ experts. \end{itemize}
\clearpage Fill in text for page 2 (on the back side) \clearpage Fill in text for page 3 (on the back side) \clearpage Fill in text for page 4 (on the back side) \clearpage
\section
command to insert a heading:\section{Schedule}
tabular
environment. Using the @{}
option, we suppress spacing at the left and right:\begin{tabular}{@{}rl@{}} 6 pm & Welcome \\ 7:30 pm & Live install presentation \\ 8 pm & Book authors available for talks and signing \\ 9:30 pm & Bar closing \end{tabular}
From 6pm to 10pm: install support and free \TeX\ copies on DVD on our welcome desk. \section{Accomodation} Hotel, Meals, Travel information here \section{Sponsors} Information about our local \TeX\ user group and Open Source projects sponsor \clearpage \section{Contact} Names, Phone numbers, email addresses \end{document}
The back side still contains just some dummy text, which helps to identify the position where the text finally lands on the page.
In the first line, we loaded the leaflet
package with a font size of 10 pt. The notumble
option suppresses the default behavior, that is, printing the back side upside down.
The next three lines contain our font settings. We used the Linux Libertine font and specified the T1
font encoding. You can read more about encodings in Chapter 2, Tuning the Text, specifically in the Improving justification and hyphenation recipe. Furthermore, we set the default font family to be sans serif. I prefer the clean look of sans serif on a flyer or a leaflet, which usually contains little text.
The remaining part of the preamble is as follows:
microtype
package, which improves the justification capabilities with tiny font adjustments. This is especially useful in a situation with narrow columns, such as in this case.graphicx
package, so we are able to include images such as a logo or a geographic map.\gobble
command is a TeX command that removes the following command or control sequence, so the page number will simply be absorbed.Our document body shows usual sectioning commands and text. You can see that we added an explicit space after the TeX logo by inserting a backslash and a following space. That's because the space after a macro, such as the \TeX
command, just indicates the end of the macro. It doesn't produce a space in print because punctuation may follow the macro.
To have an image in our template, we used the CTAN lion drawn by Duane Bibby; simply replace it with your own image, for example, a geographic map or logo.
The remaining text is straightforward and shows some useful layout details, as follows:
center
environment:\begin{center} ... \end{center}
itemize
environmenttabular
environment for text, which should be aligned in columnsIn the \begin{tabular}{@{}rl@{}}
line, the characters rl
stand for two columns, where the first one is right aligned and the second one is left aligned. The expression @{code}
inserts a piece of code instead of the space before or after the column, so @{}
replaces it with nothing, that means, removes it. We got two columns without additional whitespaces on the left or right, saving our previous line space.
The leaflet
class provides some options and commands for customization.
By default, a small folding mark is printed on the back side. If you would like to omit it, add the nofoldmark
option when loading the class:
\documentclass[10pt,notumble,nofoldmark]{leaflet}
You can draw a vertically dotted line with a scissors symbol using the \CutLine
command in the preamble with a page number as an argument. The line will go between this one and the preceding page, which is as follows:
\CutLine{3}
This will print a dotted line with two scissors symbols on the back side, between pages 2 and 3, where a folding mark will be placed by default. The starred command version \CutLine*
will not print the scissors.
Similar to standard classes, you can use page headers and footers. There are none by default here. Standard commands such as \setlength{\headheight}{…}
and \pagestyle
can be used. The leaflet
provides an additional command to declare the margins:
\setmargins{top}{bottom}{left}{right}
You can add an image to the background of a certain page:
\AddToBackground{pagenumber}{\includegraphics{filename}}
Use the starred version \AddToBackground*
to allow it to be printed in the background of the combined page.
Instead of the \includegraphics
command, you can use other positioning commands, including our drawing code. Here, the Absolute positioning of text recipe in Chapter 2, Tuning the Text, will be useful.
The font size of section headers is already a bit smaller than that of standard classes. If you would like to change the size, shape, or color of the headings, you can redefine the \sectfont
macro. For example, if we enable using color with the \usepackage{xcolor}
command, we can write the following line of code:
\renewcommand{\sectfont}{\large\sffamily\bfseries\color{blue}}
This will give a large sans serif font in bold and with blue color.
For further information regarding fonts, refer to Chapter 3, Adjusting Fonts.
Change the font size
Change margin width
Change background colour