% starting.tex
%
% \begin{stealth} \pspage{page_skew.ps} \end{stealth}
\chapter{Simple LameTeX Formatting}
This chapter introduces to the essentials of running the
LameTeX program, but is primarily an overview of LaTeX buzzwords and
syntax.
% The below text should only be printed in the LameTeX version. When
% running LaTeX there are no little wizards to see!
% \begin{stealth} Those grossly familiar with LaTeX can just glimpse at the
% little wizards and skip to the next section. \end{stealth}
\section{Running LameTeX}
\subsection{Useful Buzzwords To Know}
A {\em LaTeX file} is a text file full of the words of your document,
plus some fancy formatting commands. The LaTeX text formatter knows
how to interpret the formatting commands from your LaTeX file and
produce a printed result. The filename of a LaTeX file usually ends
with the suffix ``.tex'' but this is not required.
A {\em LameTeX file} is just like a LaTeX file, except that LameTeX
has some extra text formatting commands that LaTeX doesn't know. Also,
LameTeX doesn't know all of the commands that LaTeX knows.
Fortunately, for the basic commands, both programs work fine. For
reference, there is a complete list of all text formatting commands
that LameTeX understands at the end of this document.
LaTeX will understand any well-written LameTeX document because the
fancy LameTeX commands are ``hidden'' inside comments. Any LameTeX
command that LaTeX doesn't know is called a {\em stealth command}.
A big part of LameTeX is being able to make your own very fancy
page descriptions. A {\em page description file} is a file
full of some PostScript page descriptions, written in the PostScript
programming language.
\subsection{Example 1 - A Plain Vanilla Text File}
LameTeX comes with a number of example LameTeX files. They all
begin with the prefix ``example'', then a number, and end with the
conventional suffix ``.tex''.
Try formatting the LameTeX file {\tt example1.tex} by typing {\tt
lametex example1.tex}. LameTeX will process the file, converting it to
the graphics language PostScript. Your screen should look something
like this:
\begin{tt}\begin{flushleft}
vegas\% {\bf lametex example.tex} \\
This is LameTeX, C++ Version pre 1.0 \\
Processing example1.tex... \\
Opening example1.PS for temporary output... \\
Including PostScript file /home/jgm/PS/Lametex/page/page\_latex.ps \\
Making dummy file for snarfing LaTeX fonts... \\
Snarfing LaTeX fonts... \\
This is TeX, C Version 3.0 \\
(lametex.tex \\
LaTeX Version 2.09 (24 May 1989) \\
(/cs/lib/tex/inputs/report.sty \\
Document Style `report' (13 Nov 89). \\
(/cs/lib/tex/inputs/rep10.sty) (/cs/lib/tex/inputs/titlepage.sty)) \\
(/cs/lib/tex/inputs/10pt.sty) (lametex.aux) [1] (lametex.aux) ) \\
Output written on lametex.dvi (1 page, 344 bytes). \\
Transcript written on lametex.log. \\
This is dvips 5.47 Copyright 1986-91 Radical Eye Software \\
' TeX output 1992.08.22:0325' - lametex.ps \\
(tex.pro). [1] \\
\hspace{1 cm} ** SNARF! ** \\
Created PostScript file example1.ps \\
vegas\% \\
\end{flushleft}\end{tt}
LameTeX has produced a new file, {\tt example1.ps} that you can print
on any PostScript printer using the {\tt lpr} command. Alternatively,
you can view it on-line by using GhostScript or some other PostScript
previewer. It is recommended that you {\em always} use a PostScript
previewer before printing, just to make sure that you get what you
want.
As part of the text formatting process, LameTeX must acquire the
correct ``official'' LaTeX fonts, and to do this, it makes a small
trojan horse file and tricks LaTeX into interpreting it. The dummy
file it creates is {\it lametex.tex}
% \begin{stealth} \begin{postscript}
% /Wizard LeftMarginIcon \end{postscript} \end{stealth}
which is formatted by LaTeX to
become {\it lametex.ps}. All temporary files are deleted after they're
used.
You are welcome to omit the suffix {\em .tex} if you wish, just as
with LaTeX. For example, you could have typed {\tt lametex example1}.
\subsection{Specifying the Default Page Description File}
% \begin{stealth} \begin{postscript}
% /Wizard LeftMarginIcon \end{postscript} \end{stealth}
The {\em default page description} is the PostScript file that is used
to decide what the page should look like, if you don't specify a page
description. You can use the -p command line option to specify a new
page description. Try typing {\tt lametex -p page\_skew.ps
example1.ps} to format the same example LameTeX file with a different
page description. You can use any of the page descriptions in the
LameTeX page description directory.
If you don't specify the default page description, it automatically
defaults to {\tt page\_latex.ps}.
You can use the -t command to produce plain ASCII text output. Just
type {\tt lametex -t yourfile.tex} and the result will be
placed in yourfile.txt.
\section{A Brief Review of LaTeX}
Following is a brief review of what normal LaTeX commands look like.
You should peek at a real LaTeX manual if this section confuses you.
If you formatted {\tt example1.tex}, you saw that the printed result was
placed so that it lined up on both columns. Each new paragraph was
indented, and the title was centered on the page.
Take a look at {\tt example1.tex}, and you will see that the plain
LameTeX file is not nearly so pretty! LameTeX was responsible for
doing the formatting. LameTeX shares responsibility for
decision-making with you, the user. For example, there is a special
notation that makes LameTeX center the title of the document. A normal
LameTeX document is full of such decision-making commands, either to
ask for something new, or to override a LameTeX decision (like whether
to indent a paragraph).
\subsection{$\backslash$documentstyle}
The most important command in this example is {\tt
$\backslash$documentstyle\{report\}}.
LaTeX wants to know what kind of document you are trying to produce.
LameTeX, it turns out, doesn't really care! All document styles look
the same to LameTeX, but unfortunately you must have the
$\backslash$documentstyle command anyway, just because that is the way
the cruel world is sometimes. Plus, you need it if you are ever going
to run your document through normal LaTeX.
There are three alternate versions of this command, {\tt
$\backslash$documentstyle[10pt]\{report\}},\\ {\tt
$\backslash$documentstyle[11pt]\{report\}},\\ and {\tt
$\backslash$documentstyle[12pt]\{report\}}, which specify that the default
font size for this document will be 10 point, 11 point, or 12 point
respectively. The real LaTeX text formatter can do a lot of other
fancy things with the $\backslash$documentstyle command, but this version of
LameTeX cannot.
\subsection{$\backslash$begin and $\backslash$end Delimit Environments}
An {\em environment} is an important LaTeX concept. It tells LaTeX
where to start and stop doing fancy stuff. For example, in the example
LameTeX file {\tt example1.tex} there are two commands, {\tt
$\backslash$begin\{center\} and $\backslash$end\{center\}} . The
$\backslash$begin command says ``start doing a fancy thing, which is
to center every line.''. Likewise, the $\backslash$end command is
very important because it tells LaTeX where to {\bf stop} centering.
We say that the text in-between the $\backslash$begin and
$\backslash$end command is ``in a $\backslash$center environment''.
\newlength{\baselinetemp}
\setlength{\baselinetemp}{\baselineskip}
\setlength{\baselineskip}{20pt}
A shorthand notation for an environment is to use braces. For example,
the line of text
{\tt $\backslash$begin\{center\} this text is
centered $\backslash$end\{center\}}
could be re-written as follows:
{\tt\{ $\backslash$center this text is centered \}}
\setlength{\baselineskip}{\baselinetemp}
\subsection{Text Goes in the $\backslash$document Environment}
Whenever you use LaTeX, you must place any text to be printed inside
of a $\backslash$document environment. Don't place text outside of a
$\backslash$document environment, although you may place text formatting
commands there.
The two commands you will {\em always} want to make part of your
LameTeX documents are $\backslash$documentstyle and $\backslash$document.
\subsection{Example 2 - Environments Can Be Fancy}
Try running the second example file, by typing {\tt lametex example2.tex}.
This LameTeX file doesn't have any stealth commands either. Like {\tt
example1.tex}, it is just a demonstration that LameTeX can handle some
pretty complicated normal LaTeX text formatting commands.
This file contains some fancy environments. For example, the
$\backslash$verse command modifies the environment in several ways to
allow a natural look to poems.
The $\backslash$enumerate environment indents the text and numbers all
paragraphs that begin with the $\backslash$item command.
\subsection{Environments Can Be Nested}
Also notice that the $\backslash$enumerate commands can be nested
inside one another. Also the $\backslash$bf command for {\bf boldface}
is nested inside the $\backslash$Huge command for {\Huge Huge} text.
Putting the boldface environment inside the Huge environment yields
text that is {\bf\Huge both bold and Huge}.
In general, when you nest environments, ``it does the right thing.''
In general you can trust LaTeX to {\it do the right thing}. Can you
trust LameTeX? Well\ldots you know the old saying: ``Trust your
mother. But watch her!''