<< . 2( 2)
x n + y n = z n ∀n = 2
\mathit n/a
xn + y n = z n ∀n = 
\mathnormal n/a
§\ + †\ = ‡\ ∀\ = ∈
\mathcal n/a

Table 3: Font attributes.

22
5 THE FORMAT MENU 5.2 Format/Character

5.2 Format/Character
Standard character properties are listed in Table 3, font sizes in Table 4.
Please note the di¬erence between italics and emphasised text. For example, this portion of
text is typeset in italics, and these words are emphasised in upright. As you can see, \emph is a
logical rather than typographic command.
Also, please note that underscript is normally used in math mode only. The trick to use it in
normal text is:
this is
this is subscript
$_{\mbox{\footnotesize{subscript}}}$

Font size Example
tiny sample text

scriptsize sample text
footnotesize sample text
sample text
small
sample text
normalsize
sample text
large
sample text
Large
sample text
LARGE
sample text
huge
sample text
Huge

Table 4: Font sizes

5.2.1 Underline styles

Normally, underline is not used. It™s just a relic of the old teletype era, and it doesn™t look really
good. If you still want to use underline, the ulem package provides some fancy styles:
\uline{important}
\uuline{urgent}
important urgent boat wrong // // //
removed
/// ///
\uwave{boat} :::::
\sout{wrong}
\xout{removed}
Beware: ulem rede¬nes the \emph command, which will be replaced by underline. To avoid this
behaviour, use this declaration:

\usepackage[normalem]{ulem}

5.2.2 Format/Character Size

If the standard font sizes aren™t enough for you, the package extsizes may be handy. It provides
˜extended™ versions of the standard document classes, with support for sizes 8“12, 14, 17, and
20 pt.

23
5 THE FORMAT MENU 5.2 Format/Character

For example, let™s suppose you want to typeset an article using a 17 pt font. You™ll use this
document preamble:

\documentclass[17pt]{extarticle}

Another way to get big fonts is to use the package type1cm, which provides commands like the
following:

\fontsize{72pt}{72pt}\selectfont
No Smoking

(The example above is way too large to ¬t on this page. . . )
Parameters are font size and baseline. Yet another approach is this:

1-cm tall
\resizebox{!}{1cm}{1-cm tall}

5.2.3 Format/Character Font

L TEX uses its own fonts, automatically generated when needed by the METAFONT subsystem.
A
This ensures portability and yields very good results. However, many of us are accustomed to
other fonts: Times, Helvetica, Sans Serif. . .
Fortunately, L TEX can use PostScript fonts. Try using one of the following packages: avant,
A
avangar, bookman, chancery, charter, courier, helvet, helvetic, ncntrsbk, newcent, palatcm, palatino,
pifont, times, utopia, zapfchan. Insert \usepackage{times} and enjoy the results. The only
caveat is that L TEX handles maths at its best only with Computer Modern fonts: using
A
PostScript fonts might render your formulas slightly less appealing.
The packages above set the font for the whole document. To use a PostScript font for a region
of text only, specify the font family as in the example below. Common font families are listed
in Table 5.

Z Beware, some font shapes may be unavailable on some systems!

This is Computer Modern Roman,
This is Computer Modern Roman, this is Hel-
{\fontfamily{phv}\selectfont
vetica!
this is Helvetica!}

Yet another possibility is replacing a standard L TEX font with a PostScript one: for example,
A
you may want to use Avantgarde whenever Computer Modern Sans Serif would appear. These
commands can be renewed as in the example below:

• \rmdefault (roman)

• \sfdefault (sans serif)

24
5 THE FORMAT MENU 5.2 Format/Character

Family Name
Computer Modern Roman
cmr
Computer Modern Sans Serif
cmss
cmtt Computer Modern Typewriter
Avantgarde
pag
Bookman
pbk
Helvetica
phv
New Century Schoolbook
pnc
Palatino
ppl
Times
ptm
Courier
pcr

Table 5: Common font families.

• \ttdefault (typewriter)

• \bfdefault (boldface)

• \mddefault (medium)

• \itdefault (italics)

• \sldefault (slanted)

• \scdefault (small caps)

• \updefault (upright)

% Avantgarde replaces sans serif
\renewcommand{\sfdefault}{pag}

5.2.4 Format/Character Colour

You can colour words using the package color and appropriate commands. Prede¬ned colours
are black, white, red, green, blue, cyan, magenta, and yellow; you can also de¬ne your own.
\textcolor{red}{This is red.}\\
\color{blue}
This text is blue!\\ This is red.
So is this. Let™s change.\\
This text is blue!
\definecolor{mygreen}
So is this. Let™s change.
{rgb}{0.1,1,0.1}
This is my shade of green!
\color{mygreen}
A cyan box
This is my shade of green!\\
\color{black} A green box in a blue frame
\colorbox{cyan}{A cyan box}\\
\fcolorbox{blue}{green}
{A green box in a blue frame}

Moreover, the command \pagecolor lets you specify. . . guess what?

25
5 THE FORMAT MENU 5.3 Format/Paragraph

5.3 Format/Paragraph
Let™s remind what a paragraph is according to L TEX: a portion of text that either ends with
A
\\, or is followed by a blank line.
Environments are L TEX™s way of specifying properties like text alignment or font selection for
A
a given portion of text. It™s like selecting text with the mouse, then choosing the property you
wish from a menu or clicking on a button. Another way is to enclose the text between brackets.
Environments have this general form:
\begin{environment}
...text goes here...
\end{environment}

For example, if you want to center a paragraph you™ll use the center environment:
\begin{center}
this text is centered
this text is centered
\end{center}
Standard environments are listed in Table 6. In the following sections, I™ll show you what to use
and when.

5.3.1 Format/Paragraph Horizontal Alignment

By default, the text is justi¬ed. To get left“aligned, right“aligned or centered text, use the
flushleft, flushright and center environments. The commands \raggedright, \raggedleft,
and \centering are equivalent to their correspondent environments, but they do not start a
new paragraph.

5.3.2 Format/Paragraph Vertical Alignment

The way paragraphs are separated is often puzzling to word processor users. Empty lines
and multiple spaces are treated like a single empty line or space. The commands \smallskip,
\medskip, and \bigskip provide some space between paragraphs.
If you need more space, use the command \vskip{parameter } as in this example:
These paragraphs will be separated by 1.3 cm:
These paragraphs will be
separated by 1.3 cm:\\
\vskip 1.3cm
there is a 1.3 cm gap above me.
there is a 1.3 cm gap above me.

Note that \vskip only works between paragraphs. What if you wanted to start a page after an
additional margin of, say, 1.5 cm? You™ll have to use \null, which sets a ˜mark™ in the text:

\null
\vskip 1.3 cm
This text comes after 1.3 cm...
This text comes after 1.3 cm...

26
5 THE FORMAT MENU 5.3 Format/Paragraph

Environment Purpose
Math arrays
array
Centered lines
center
Labelled lists
description
Numbered lists
enumerate
Sequence of aligned equations
eqnarray
Displayed equation
equation
Floating ¬gures
figure
Flushed left lines
flushleft
Flushed right lines
flushright
Bulleted lists
itemize
Letters
letter
Generic list environment
list
Miniature page
minipage
Picture with text, arrows, lines and circles
picture
Indented environment with paragraph indentation
quotation
Indented environment with no paragraph indentation
quote
Align text arbitrarily
tabbing
Floating tables
table
Align text in columns
tabular
Bibliography or reference list
thebibliography
Theorems, lemmas, etc
theorem
For hand crafted title pages
titlepage
Simulating typed input
verbatim
For poetry and other things
verse

Table 6: Standard L TEX environments.
A

27

Finally, the command \vfill is used to add empty lines between two paragraphs so that the
second paragraph goes exactly to the bottom of the page. For example,

This appears at the top of the page. . .
This appears at the top of
the page{\ldots}
\vfill
{\ldots}and this at the bottom.
. . . and this at the bottom.

5.3.3 Format/Paragraph Margins

Normally, the margins are set for the whole document as seen in Section 2.5. Rede¬ning them
for a section of text will not work: if you want to set a paragraph™s margins, you™ll have to create
a new environment like in the following example:

\newenvironment{margins}[2]
{
\begin{list}{} {
\setlength{\leftmargin}{#1}
\setlength{\rightmargin}{#2}
} \item }
{\end{list}}

Then you will use the new environment:

As you can see, this paragraph has normal
As you can see, this paragraph
has normal margins. margins.
\begin{margins}{0.5cm}{1cm}
paragraph has custom margins. has custom margins.
\end{margins}

5.3.4 Format/Paragraph Indentation

To set the amount of indentation of the ¬rst line of a paragraph, use the command \parindent.
In the following example, we set a 1-cm indentation:

\setlength{\parindent}{1cm}

The commands \indent and \noindent allow/disallow indentation on the following paragraph.
Finally, the distance between paragraphs is set by \parskip:

\setlength{\parskip}{3pt}

To get framed (bordered) paragraphs or words, you have the choice of using the framed package
or the \parbox command. The package calc is required in the latter case.

28

This is the simplest method, using framed:
\setlength{\FrameRule}{2pt}
\setlength{\FrameSep}{5pt}
\begin{framed}
this is a framed paragraph!
this is a framed paragraph!
\end{framed}
{0.9,0.8,1}
this is a shaded paragraph, do you like it?
do you like it?
Equivalently, use the boxedminipage package and the equally named environment. For those who
want to know more: the commands

\framebox{
\begin{minipage}[c]{\linewidth}
text to be framed
\end{minipage}
}

are functionally equivalent to the boxedminipage environment.
This example uses \parbox:
\noindent
\fbox{
\parbox{\linewidth
again, a framed paragraph!
-2 \fboxsep -2 \fboxrule}
{again, a framed paragraph!}
}

\linewidth sets the width of the minipage equal to that of the remaining text. Obviously, you
can specify the width as you like.
Finally, to frame something adapting the frame to the width of the text:
this is a
this is a framed word
\framebox[\width]{framed}
word

Modifying the parameter, you can adjust the frame width:
this is another
this is another framed word
\framebox[2\width][r]{framed}
word

Note that the second optional parameter speci¬es the alignment (to the right in this example).

29
6 THE TABLE MENU 5.5 Format/Colour

5.5 Format/Colour
Now that you have a bordered paragraph, you™ll want to set its colour too. Do this:
\colorbox{yellow}{
\begin{minipage}
{0.8\linewidth}
I am a minipage, my colour is yellow!
I am a minipage, my colour
is yellow!
\end{minipage}
}

More about colours in Section 5.2.4.

5.6 Format/Columns
The commands \twocolumn and \onecolumn start a new page and set the number of columns;
they can also be used as parameters in \documentclass. If this is not enough for you, the
package multicols provides an environment of the same name. I could have set this section in
two columns with these commands:

\columnseprule=1pt
\begin{multicols}{2}[\subsection{\entry{Format}{Columns}}]
The commands \cmd{twocolumn} ...
\end{multicols}

The space between columns is controlled by the parameter \columnsep, and the thickness of the
rule between columns by \columnseprule. The text given as optional parameter in brackets is
excluded from the environment.

Quite a complex subject. . . A table is a ¬‚oat (as explained in Section 4.12) that must ¬t on
one page. It usually contains a tabular environment, even though other possibilities exist. By
default, a table adjusts its width to match the width of its contents.
This is the general format of a table:

\begin{table}[htbp] % placement: here, top, bottom, separate page
% \begin{small} % sets the table font
\begin{center} % optional
% 4-column table; alignment is left, centered, right, fixed width
\begin{tabular}{|l|c|rp{4cm}|}
\hline % horizontal line
\textbf{Left} & \textbf{Centre} & \textbf{Right} & \textbf{4 cm} \\
\hline
row 1, col 1 & row 1, col 2 & row 1, col 3 & row 1, col 4 \\
\cline{1-2} % horizontal line spanning columns 1-2
row 2, col 1 & row 2, col 2 & row 2, col 3 & row 2, col 4 \\
\cline{1-2}

30

\multicolumn{2}{|c|}{spanning two columns} & row 3, col 3 &
row 3, col 4 \\
\cline{1-3}
row 4, col 1 & row 4, col 2 & row 4, col 3 & ˜ \hfill right \\
% force a space with "\ "
row 5, col 1 & row 5, col 2 & row 5, col 3 & left \hfill ˜ \\
row 5, col 1 & row 5, col 2 & row 5, col 3 &
˜ \hfill centre \hfill ˜ \\
\hline
\end{tabular}
\caption{A sample table.}
% labels are used for cross references;
% for example, "see Table˜\ref{tab:sampletab}"
\label{tab:sampletab}
\end{center}
% \end{small}
\end{table}

Table 7 shows the result.

Left Centre Right 4 cm
row 1, col 1 row 1, col 2 row 1, col 3 row 1, col 4
row 2, col 1 row 2, col 2 row 2, col 3 row 2, col 4
spanning two columns row 3, col 3 row 3, col 4
row 4, col 1 row 4, col 2 row 4, col 3 right
row 5, col 1 row 5, col 2 row 5, col 3 left
row 5, col 1 row 5, col 2 row 5, col 3 centre

Table 7: A sample table.

Sometimes, a table is too wide and won™t ¬t on the page. In that case, the rotating package
provides the new environment sidewaystable. Also, rotating makes it possible to rotate the
contents of a cell by a speci¬ed angle. Finally, the tabularx package lets one specify tables of
¬xed width: the X column speci¬er indicates that a column can be spread as needed.
Here™s an example:

31
6 THE TABLE MENU 6.1 Line Spacing

wider
\begin{sidewaystable}

wider
\begin{tabularx}{7.5cm}{|l|X|X|}
\hline
\textbf{normal} & \textbf{tilted} &
\textbf{wider} \\

! ed
\hline

tilt
normal & \rotatebox{30}{I™m tilted!} &

tilted
I™m wider \\

I™m
\hline
\end{tabularx}

normal
\end{sidewaystable}

normal
The standard tabular environment cannot span more than one page. There are some packages
that overcome this limitation: you will want to try out longtable, supertabular, and xtab.
To enable colours in tables, you use the colortbl package:
Colour by row:\\\vskip 2mm
\begin{tabular}{|l|c|r|}
\hline
Colour by row:
\rowcolor{cyan}
one & two & three\\
one two three
\rowcolor{green}
one & two & three\\ one two three
\rowcolor{yellow} one two three
one & two & three\\
\hline
\end{tabular}

Colour by column:\\\vskip 2mm
\begin{tabular}
{|>{\columncolor{cyan}}l|
Colour by column:
>{\color{red}
\columncolor{green}}c|
>{\columncolor{yellow}}r|}
one two three
\hline
one two three
one & two & three\\
one two three
one & two & three\\
one & two & three\\
\hline
\end{tabular}

6.1 Line Spacing
A line adjusts itself to the height of the text it contains. To add some space before a line, the
trick is to start it with a \rule of 0 length and speci¬ed height. To add space after a line, use

32
6 THE TABLE MENU 6.2 Aligning Numbers

\\ followed by optional space. Here is an example:

\begin{tabular}{lll} one two three
one & two & three\\
0.3 centimeters after this line
0.3 centimeters & \textbf{after} &
this line\\[0.3cm] one two three
one & two & three\\
one two three
one & two & three\\
\rule{0pt}{1.2cm}1.2 centimeters &
\textbf{before} & this line\\
1.2 centimeters before this line
\end{tabular}

6.2 Aligning Numbers
A special case of a tabular environment is when we want to align numbers with respect to the
decimal positions.
The simplest method is using the @ column speci¬er, which in practice is useful in tables con-
taining only numbers. The column separator & is replaced by the decimal dot:
\begin{tabular}{r@{.}l}
3.14159
3&14159\\
1.61803
1&61803\\
1.41421
1&41421\\
100&00000 100.00000
\end{tabular}

Alternatively, use the dcolumn package, which adds the D column speci¬er. D has three argu-
ments: the separator to use in the L TEX source and in output (usually the same, ˜.™), and the
A
number of digits to the right of the decimal place indicator. Optionally, the third argument can
specify the number of digits to the left and to the right of the decimal place indicator, separated
by a dot. Lastly, if the third argument is -1, the material of the column is centered around the
separator.
All material in the table is typeset in math mode. To insert headings, you™ll have to put the
text in an \mbox.
\begin{tabular}{|D{.}{,}{4.2}|%
D{.}{.}{5}|D{.}{.}{-1}|}
\hline
One Two Three
\mbox{One} & \mbox{Two} &
10,33 10.33 10.33
\mbox{Three} \\
1000 1000 1000
10.33 & 10.33 & 10.33 \\
5,1 5.1 5.1
1000 & 1000 & 1000 \\
5.1 & 5.1 & 5.1 \\ 3,14 3.14159 3.14159
3.14 & 3.14159 & 3.14159 \\
\hline
\end{tabular}

6.3 Using slashbox
This package add the \backslashbox command:

33
6 THE TABLE MENU 6.4 Importing Data in L TEX Tables
A

\begin{tabular}{|l|l|l|}
\hline
\backslashbox[2cm]{Lesson}{Date} & PP
Date
PP
Monday Tuesday
Monday & Tuesday \\ P
Lesson PP P
\hline P
Stratigraphy room A room A
Stratigraphy & room A & room A \\
Chemistry room B Lab ±
Chemistry & room B & Lab $\alpha$ \\
Physics room C Lab β
Physics & room C & Lab $\beta$ \\
\hline
\end{tabular}
TODO: mention \newcolumntype and ¬‚oat¬‚t

6.4 Importing Data in L TEX Tables
A

For many people, data ¬les are the bread and butter of everyday™s work. Most data ¬les are
simply ASCII text with columns of numbers, but some people use spreadsheets. Nearly all
spreadsheet applications can export sheets in the ASCII-based .cvf ¬le format; values are
separated by the ˜;™ character.
Converting a data ¬le into a L TEX table is quite a tedious process. The following script for
A
Unix will convert a data¬le with an arbitrary number of columns to a table. It will also work
on .cvf ¬les.

#!/bin/sh

# dat2tex: converts tabular data to a tabular environment

if [ $# != 1 ]; then echo "Usage:$0 <datafile>"
exit 1
fi

# is this a cvs file?
grep ";" $1 > /dev/null if [$? = 0 ]; then
AWK="awk -F;"
else
AWK=awk
fi

# ok awk, make my day
$AWK ™{if (1 == FNR) { \ printf "\\begin\{tabular\}\{"; \ for (i = 1; i <= NF; i++) {printf "l"}; \ printf "\}\n" } for (i = 1; i < NF; i++) \ {printf$i" & "} printf $NF" \\\\ \n"} \ END {printf "\\end\{tabular\}\n"}™$1

# end of dat2tex

34

7.1 Tools/Mail Merges
This useful and time-saving tool is implemented in L TEX by the textmerg package. Let™s consider
A
a simple document, in which the name, surname, and title of people we™re writing to may vary.
The remaining text does not change.
We™ll de¬ne three ¬elds, which are the variable part of the text: \Name, \Surname, and \Title.
Their values will be gathered from an external ¬le, data.dat.

\documentclass{article}
\usepackage{textmerg}
\begin{document}
% let™s declare the variable fields:
% \Void is for empty lines
\Fields{\Name\Surname\Title-\Void}
\Merge{data.dat}{%
Dear \Title{} \Surname,\\
may I call you \Name?\\
Yours,\\
\hspace{3cm}Guido\clearpage}
\end{document}

The fourth ¬eld, \Void, isn™t really necessary and it™s there for illustration. It™s preceded by
a minus sign, which indicates that it can be empty in the data ¬le. Simply put, we want to
separate the records using empty lines.

Guido
Gonzato
Dr.

Francesco
Mulargia
Prof.

Carol
John-Paul II
Pope

That™s it: the resulting output will contain the merged text, one page for each recipient.

7.2 Tools/Labels
If making mail merges was easy, making labels is even trivial. Let™s suppose you want to make
20 equal labels on a 3—8 peel“o¬ label sheet. The package to use, predictably, is called labels.
In this example, we™ll make 10 plain labels and 10 boxed labels:

35
7 THE TOOLS MENU 7.2 Tools/Labels

\documentclass[a4paper,12pt]{article}
\usepackage{labels}
\LabelCols=3 % n. of columns of labels
\LabelRows=8 % n. of rows of labels
\LeftBorder=8mm % borders of each label
\RightBorder=8mm
\TopBorder=5mm
\BottomBorder=5mm
\LabelGridtrue % show the grid
\numberoflabels=10 % number of labels of each type to print
% the text of the label is specified by
\begin{document}
{\textbf{Guido Gonzato}, Ph.D.\\
\textsl{Linux system manager}}
% now on to the boxed labels
{\textbf{Guido Gonzato}, Ph.D.\\
\textsl{Linux system manager}}
\end{document}

To make labels containing di¬erent addresses, you may use either an external ¬le or insert the

\documentclass[a4paper,12pt]{article}
\usepackage{labels}
\LabelCols=3
\LabelRows=8
\LeftBorder=3mm
\RightBorder=3mm
\TopBorder=8mm
\BottomBorder=8mm
\LabelGridtrue
\begin{document}
% use either this environment:
\begin{labels}
1$^{st}$ name
1$^{st}$ address
1$^{st}$ city, state, zipcode

2$^{nd}$ name
2$^{nd}$ address
2$^{nd}$ city, state, zipcode

3$^{rd}$ name
3$^{rd}$ address
3$^{rd}$ city, state, zipcode
\end{labels}
% or an external file containing exactly the same text:
\end{document}

36
7 THE TOOLS MENU 7.3 Tools/Default Language

It is left to you to combine textmerg and labels!

7.3 Tools/Default Language
L TEX default language is English, but other languages are supported. By language support I
A
mean the translation of terms like ˜Chapter™ or ˜Index™, correct hyphenation, and the possibility
of inserting characters like ˜¸™ or ˜´™ directly via your keyboard. (The normal way being typing
c e
\c c and \™e.)
Your L TEX distribution contains a ¬le called language.dat (teTEX places it in $TEXMF/tex/ A generic/config/language.dat that contains a list of languages. Editing this ¬le you choose the languages for which you want hyphenation patterns. If you are not a native English speaker, you™ll want to use the package babel like in the following example: \usepackage[italian,english]{babel} In addition, to type accented letters and in general non-standard ASCII characters3 you may want to use the package isolatin1. However, this is not a recommended practice, because it reduces the legibility and portability of your ¬le: you had better stick to the TEX way. If you just can™t stand typying all those three- or four-letter clusters, then you could con¬gure your editor to type those for you. For example, I set up my editor of choice (jed) to have it insert \™e whenever I type ˜´™. I included this in my .jedrc: e define latex_mode_hook () { set_abbrev_mode (1); if ( () = abbrev_table_p ("LaTeX") ) use_abbrev_table ("LaTeX"); #ifdef WIN32 % prevent clash with movement keys undefinekey ("", "LaTeX-Mode"); aa definekey (" \\˜a", "", "LaTeX-Mode"); aa #else local_setkey (" \\˜a", ""); a #endif local_setkey (" \\™e", "´"); e local_setkey (" \\˜e", ""); e local_setkey (" \\˜\\i{}", ""); ± local_setkey (" \\˜o", ""); o local_setkey (" \\˜u", "`"); u } Please consult your editor™s documentation. 3 in computer jargon, ˜standard ASCII characters™ are the characters whose code is included between 32 (space) and 126 (tilde). 37 8 THE HELP MENU 7.4 Tools/Hyphenation 7.4 Tools/Hyphenation Although L TEX does a good job at hyphenating words, sometimes manual intervention may A yield better results. Manual hyphens are speci¬ed inserting \- where we want the word to be broken. A better way is to declare hyphenation rules: \hyphenation{ge-o-phy-sics, ge-o-lo-gy, earth} The above declaration instructs L TEX not to hyphen the word ˜earth™. Another way to prevent A a word to be hyphenated is to put it in \mbox: Do not hyphen \mbox{internationalisation}, please. 7.5 Tools/Spell Check L TEX is not aware of spell spelling. This task is done using external tools like ispell, aspell A or others. Under Unix, you can use ispell this way: shell> ispell -t mydocument.tex The -t switch instructs ispell to ignore TEX and L TEX commands. If your language is not A English, specify the appropriate dictionary with the -d switch: shell> ispell -d italiano -t mydocument.tex 8 The Help Menu There are many ways of getting help with L TEX, both online and o¬„ine. The best place to start A is the CTAN site, http://www.ctan.org/tex-archive/info/. • info latex (Unix systems) gives a concise but very complete on-line summary of com- mands and concepts; • http://www.giss.nasa.gov/latex/ is a comprehensive on-line reference. Lots of useful links! • http://www.ctan.org/tex-archive/info/LatexHelpBook/ is a very nice help system for L TEX, fully integrated with Windows. A • don™t forget the news:comp.text.latex newsgroup: it™s an invaluable source of help. Many GNU/Linux distributions ship with teTeX, one of the most complete TEX/L TEX systems. A A lot of documentation is provided, and is usually found in TEXMF/doc. Point your browser there, and be happy. 38 9 THE END 9 The End This document is copyright c Guido Gonzato, 2001“2003, and released under the GNU General Public Licence. I really hope you™ll ¬nd this guide useful. For any suggestions or comments, please feel free to contact me. 39 A DOCUMENT TEMPLATES A Document Templates A template for the class article was presented in Section 2.1. More examples are shown in the following ¬gures. \documentclass[twoside,11pt]{book} \begin{document} \frontmatter \begin{titlepage} \title{The Book of Mine} \end{titlepage} \author{John B. Smith} \maketitle \tableofcontents \mainmatter \part{The Beginning} \chapter{Introduction} \section{Let™s Start} The book starts here. \part{The End} \backmatter Thank you for reading this book. \end{document} Figure 3: Book template. 40 A DOCUMENT TEMPLATES \documentclass[twoside,12pt]{report} % tables and figures at the end: \usepackage{endfloat} \begin{document} \title{Final Report} \author{John B. Smith} \date{London, \today} \maketitle \begin{abstract} This is the final report. \end{abstract} \tableofcontents \listoftables \listoffigures \part{Start} \chapter{Begin} \section{Introduction} The report starts here. \end{document} Figure 4: Report template. \documentclass[12pt]{letter} \begin{document} \address{My address} \signature{Guido} \begin{letter}{John™s address} \opening{Dear John,} Thank you for being my friend. \closing{Hope to see you soon,} \ps{P.S. Say hello to granny!} \encl{My son™s photographs!} \end{letter} \end{document} Figure 5: Letter template. 41 A DOCUMENT TEMPLATES \documentclass[a4paper]{article} \usepackage{type1cm} \usepackage{times} \usepackage{color} \usepackage{rotating} \pagestyle{empty} \begin{document} \begin{sidewaysfigure} \fontsize{2.5cm}{2.5cm}\selectfont \centerline{\textcolor{blue}{\textbf{Please:}}} \vskip 1cm \fontsize{4cm}{3cm}\selectfont \centerline{\textcolor{red}{DO NOT}} \centerline{\textcolor{red}{SMOKE}} \centerline{\textcolor{red}{HERE!}} \vskip 1cm \fontsize{2cm}{2cm}\selectfont \centerline{\textcolor{magenta}{If you do,}} \centerline{\textcolor{magenta}{you™ll be \emph{deboned!}}} \end{sidewaysfigure} \end{document} Figure 6: How to write a notice. 42 A DOCUMENT TEMPLATES \documentclass{article} \usepackage[absolute,showboxes]{textpos} \usepackage{color} \usepackage{framed} \usepackage{graphicx} \setlength{\TPHorizModule}{10mm} % standard unit of length \setlength{\TPVertModule}{\TPHorizModule} \setlength{\TPboxrulesize}{1pt} % box line width % start everything near the top-left corner \textblockorigin{0mm}{0mm} \begin{document} \setlength{\parindent}{0pt} \definecolor{shadecolor}{rgb}{0.9,1,1} \begin{textblock}{5}(0,0) % this block is 5 modules wide; height is % automatically determined \begin{center} \begin{minipage}[c]{0.8 \linewidth} \begin{shaded} This block is placed with its top left corner at the ˜origin™ on the page, which has been set to (0mm,0mm). The internal margin and the shading are provided by the \texttt{minipage} and \texttt{shaded} environments. \end{shaded} \end{minipage} \end{center} \end{textblock} \begin{textblock}{6}(10,1) \includegraphics[width=6cm,angle=-90]{gnuplot.ps} This picture is at (10,1). Note that rotating it by -90 makes it overflow the margin. \end{textblock} \begin{textblock}{5}[0.5,0.5](2.5,8) This block is at position (2.5,8), but because the optional argument [0.5,0.5] has been given, it is the centre of the block which is located at that point, rather than the top-left corner. \end{textblock} \begin{textblock}{3,4}(6,4) The dimensions of this block are 3$\times\$4 cm.
Its origin is position (6,4) on the page. Note that the text
overflows the margin in some cases; you™ll want to
use the \texttt{minipage} environment to prevent that.
\end{textblock}
\end{document}

Figure 7: How to write a poster.

43

 << . 2( 2)