Input to is in the form of a text file.
input files have
a .tex extension. The logical structure of a document is
imposed by typesetting commands. It is good practice to split your text
into logical units, each stored in a separate file, (see
Chapter
). Co-ordination is
achieved through a root input file which specifies
the document style and `pulls in' the relevant text files. This
document was produced with the following root file:
1
\documentstyle[11pt,a4wide,twoside]{report} \pagestyle{headings} \newcommand{\dspaceon}{\renewcommand{\baselinestretch}{1.3}\large\normalsize} \newcommand{\dspaceoff}{\renewcommand{\baselinestretch}{1}\large\normalsize} \title{Document Preparation with \LaTeX} \author{Edited by David Budgen \\ Department of Computing Science \\ University of Stirling} \date{February 1990, Revised October 1990} \begin{document} \pagenumbering{roman} \maketitle \input{acks} \tableofcontents % The chapters as available \include{intro} \include{example} \include{miniguide} \include{documents} \include{running} \include{dvipsguide} \include{previewer} \include{graphics} \include{hints} \include{biblio} \end{document}1.3A detailed description of this file follows. Firstly, the command
\documentstyle[11pt,a4wide,twoside]{report}specifies the basic format of the document - this effects the layout of your text on the page, the size of headers, etc. In general
Comment lines begin with the % character, and are terminated by the end of a line. Comments are mostly useful in `root' files such as this one, where they can be used to remind the author of items to be included later, or to exclude sections that have not yet been completed.
The commands used to specify these entities illustrate the notion
of scope associated with certain commands known as declarations.
Braces are used to delimit the scope of a declaration.
For example, here is some emphasised text produced by the
\em command. The associated input takes the form:
For example, here is some {\em emphasised text} produced by ...The scope of a declaration can also be delimited by the \begin and \end commands. For instance, consider ``some more emphasised text'' which was produced by the following fragment of
\begin{em} ``some more emphasised text'' \end{em}Such a construct is called an environment, the name of the environment is specified within braces. Note that the \em declaration corresponds to the em environment. Environments are best used where a large section of text is involved. The largest text environment is the complete document and is delimited as follows:
1
\begin{document} ... \end{document}1.3The \pagestyle declaration controls the text printed in the header and footer regions of the page. The command \pagestyle{plain} generates an empty header and places the page number in the footer, whereas \pagestyle{empty} generates an empty header and footer. Roman and arabic numbering is achieved by the \pagenumbering declarations.
keeps track of various kinds of referencing information
enabling the automatic generation of a table of contents by the
\tableofcontents command. Similarly, lists of figures and
tables can also be generated for free.
The \chapter{Introducing \LaTeX}
\label{intro}
\pagenumbering{arabic}
\section{What is \LaTeX?}
During the 1980's, one of the major changes that occurred in computing
was the development of highly versatile output devices. Unlike earlier
impact printers, the high-resolution matrix printers and laser printers
are capable of printing a wide range of typefaces, fonts and sizes (these
terms will be clarified later). \LaTeX\ is one of the software tools
that has been developed to allow the user to take full advantage of the
power of such printing devices.
The popularity of {\em word processing} has led to the development of
many software tools which are based upon {\em wysiwyg} techniques
(what you see is what you get). While such systems can be excellent
when used with fixed-pitch typewriter style printing forms, the
results when used with mixed fonts and mixed typefaces are often far
less impressive. This is largely because over the decades and centuries
typesetters and compositors have developed a set of `rules' which
embody hard-won `knowledge' about the effective use of such tools,
and we have become used to seeing books and document laid out to these
high standards.
Another reason for the lack of `perfect' {\em wysiwyg} packages
is that while printer technology involving resolutions in hundreds of
pixels per inch is standard, display screen technology is
still limited to less than 100 pixels per inch, except in very specialised
(and very expensive) areas. Thus, it is technologically impossible to
achieve true {\em wysiwyg} effects, unless the effects required are very
limited in scope (boxes-and-lines diagrams or fixed-width fonts, say).
\LaTeX\ is based upon an entirely different philosophy to that of
{\em wysiwyg} tools. The idea in \LaTeX\ is that the designer of a
document should specify their layout requirement in an {\em abstract}
manner, and that the program should then translate these into the
necessary details of typeface, font and size, making use of a set of
rules of `style' that have been derived from type-setting experience.
So the user of \LaTeX\ is concerned only with specifying the {\em logical}
design of their document in terms of chapters, sections, lists etc, rather
than being concerned with physical layout.
The effect of this approach is that the document producer controls the
appearance of the document indirectly, through a series of encodings which
describe to the document processing package how the document should look.
These descriptions take the form of ordinary text files produced with any
ordinary text editor; indeed, the whole armoury of text-processing utilities
may be used to `attack' \LaTeX\ source files, which can lead to useful short
cuts, as will be seen later.
\section{How it works}
\LaTeX\ is what is termed a `mark up' language. The input to \LaTeX\
consists of the raw text of a document, interspersed with
{\em directives} that indicate how each part of a document is to be
processed. \LaTeX\ supplies a generous set of structures, as well
as the means of adjusting some of their parameters where necessary.
Overall, the effect is very like that of compiling a program.
The output from \LaTeX\ is not immediately printable. While a number
of files of information may be produced (the exact number depending
upon the options selected), the main textual output is a
{\em device-independent}
file, usually given the extension {\tt .dvi}. This file
needs to be further processed so that it can be displayed on a screen
or printed on a particular printer. A wide range of programs to
performs the translation are available. For example, tools are available
to transform {\tt .dvi} files into line-printable output for cheap
proof-reading purposes (highly recommended and environmentally sound),
various different programs are available locally to preview output
approximating the page display on a workstation screen (depending on the
exact type of your workstation), and at least two programs are locally
available to transform {\tt .dvi} file into
PostScript\footnote{PostScript is an example of a {\em Page Description
Language}, a shorthand method for describing the layout
of every pixel on a printed page.}
for output to a laser printer for `fair copy'.
\LaTeX\ is itself built upon Donald Knuth's \TeX\ typesetting language.
\TeX\ is enormously powerful, but writing in \TeX\ is rather akin to
writing programs in assembler---and is {\em not} recommended for the
inexperienced. Because \LaTeX\ is implemented as a set of style
macros for \TeX\, we occasionally become aware of its presence when
errors occur, since some of the error messages may be generated from
\TeX\ rather than from \LaTeX\@. Neither give particularly clear
messages, but those from \TeX\ can be particularly obscure!
\section{This document}
The purpose of this document is to support the `no frills' use of
\LaTeX\ within the Department. The various chapters give basic
guides to \LaTeX\ document commands, running the available tools,
and organisation of a large document, such as a dissertation.
It provides hints and guidelines and has been assembled from a wide
range of sources.
As a general point though, if you cannot find out how to obtain a
particular effect with \LaTeX\ fairly easily, don't waste your time,
simply find a different form of expression. \LaTeX\ discourages
the production of output forms that are regarded as stylistically
undesirable, and it is generally better to accept that in these
matters `\LaTeX\ knows best'. It is probably only too true!
\section{Other tools}
UNIX does provide some useful tools that can be used with any form of
document preparation. In particular, everyone should know about the
following ones.
\begin{description}
\item [wc] will count words and lines in a file.
\item [spell] will check the spelling of words in a file and provide
a list of errors.
\end{description}
We particularly recommend the use of the latter\ldots
One other point ought to be mentioned here: laser printers are relatively
slow and are expensive to run. Draft sections of a document need not be
typeset simply for the purposes of proof-reading, and may simply
be printed out on the standard line-printer. Please avoid laserprinting your
output whenever possible.
\section{Typography and other issues}
\subsection{Typographic terms}
Most of us use these very casually (and erroneously). As an instant
guide to correct use of someone else's technical terms, we offer the
list below.
\begin{description}
\item [typeface] is an `abstract design idea for how letters are to
be presented'. Examples of typefaces are Times New Roman, Helvetica
and Baskerville. A typeface can be realised in various sizes and
{\em fonts} (see below).
\item [font] describes a particular aspect of a typeface, often in a
particular size. Examples of fonts are {\bf bold}, roman, {\it italic},
{\sl slanted} and condensed.
\item [point] is a printer's measure of size. A point can be taken
as being approximately $1/72$ of an inch. Font size is measured in
points; for example, this document is set in 11-point type.
\item [serif] is a small lateral extension at the end of a stroke.
These are found in various forms in many typefaces, and are considered
to be an aid to faster reading of a document, since they help to create
the imaginary line followed by the eye as a line of text is read.
Most books (and this guide) are set in typefaces that have serifs.
\end{description}
For a fuller description of typographical terms, the book by
Rubinstein described in the next section is particularly recommended.
\subsection{Other reading}
There is a short bibliography at the end of this document. The
`bible' of \LaTeX\ was written by Leslie Lamport, who was its creator
\cite{lamport}. There is a copy in the library and various copies are
owned by members of the Department (who are generally {\em very}
reluctant to lend them out). It is not particularly well organised
as a book, {\em but}, there is, at the time of writing, no alternative.
For dissertation
preparation these notes should suffice, although reference to Lamport's
book may prove necessary on occasion.
Anyone wanting to know more about digital type-setting, and about
typography in general, should consult the book {\em Digital Typography}
by Richard Rubinstein \cite{rubinstein}. This is a very interesting
and well-written book that is saturated with useful references and
gives lots of fascinating ideas.
\TeX\ itself is thoroughly documented in the works by Donald Knuth,
but these are {\sc not} recommended as suitable reading for the novice.
command causes to include the file
intro.tex. In this way the text of your document can be held
in different files. In practice you will only work on one file (chapter)
at a time. A mechanism to prevent the inclusion of particular
files is therefore required. Two approaches are available. Firstly,
as already mentioned,
any line of the input file starting with a % symbol is
ignored by
. For instance, the following sequence of
includes would result in only ``chapter2'' being included:
1
. . .1.3Alternatively, the \includeonly command enables you to specify within the preamble which of the include files should be processed. For instance, the inclusion of only ``chapter2'' can also be achieved by the following use of the \includeonly command:
1
\includeonly{chapter2} . . . . . .1.3Finally, the \appendix command tells