summaryrefslogtreecommitdiff
path: root/support/lametex/doc/starting.tex
blob: 35f0473073ad51b5753456f67d4aa3e303851daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
% 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!''