Lesson One |
In this section we run through the the principles of writing and printing of a simple TeX document. If it seems like an awful lot of work, remember that writing and printing your first document it the hardest part: the learning curve is initially steep, but flattens off quickly.
Traditionally, using TeX (and associated utilities) is a command-line-based activity, be you using a Unix or a Windows machine. Graphical shells to exist for TeX, especially for Windows (and Macintosh). We assume a command-line-based system here.
The complete procedure is:
Create a TeX source file by using your favourite text editor, such as (GNU) emacs, joe, pico or vi on Solaris and Linux, or Notepad on Windows.
If you modify the above example, or create your own, do not be surprised
if TeX gets upset and reports errors
(
Compile your TeX source file, <myfile>.tex to produce a DVI file, <myfile>.dvi, by using the tex command:
prompt> tex <myfile>.tex |
prompt> tex simple_example.tex
This is TeX, Version 3.14159 (Web2C 7.3.1)
(simple_example.tex [1] )
Output written on simple_example.dvi (1 page, 1884 bytes).
Transcript written on simple_example.log.
prompt>
...and you will
get a DVI file.
It's possible that you will make a mistake and get an error message, such
as this:
tex simple_example.tex
This is TeX, Version 3.14159 (Web2C 7.3.1)
(simple_example.tex
! Undefined control sequence.
l.15 `\ttbackslas
'. The first two macros, for example,
?
which says that TeX does not recognise the macro \ttbackslas
(the "h" is missing from the end). In this case quit from TeX
by typing a "q" (and hitting "return"). Then follow the
strategy given below in
One usually obtains hard-copy from a TeX document by converting the DVI file to a postscript file (<myfile>.ps) and sending the postscript file to a printer. The conversion is commonly done by using a utility called dvips, e.g:
prompt<GT> dvips simple_example.dvi
This is dvips(k) 5.86 Copyright 1999 Radical Eye Software
(www.radicaleye.com)
' TeX output 2000.06.16:1028' -> simple_example.ps
<texc.pro>. [1]
prompt<GT>
This will
produce a postscript (.ps) file.
This can be sent to your printer
in the usual way.
For more on dvips