CS140: Algorithms
Getting Started with LaTex
These brief instructions on LaTex are intended to get you started. If you
want a thorough treatment of LaTex, I suggest you purchase Leslie Lamport's book
LaTex .
These instructions assume an X-Windows/Unix environment.
There is a freeware version
of LaTex available for the PC but it is non-trivial to install. For more information
go to EMTEXGI Home Page .
Step 1:
-
Download the tex version of homework 0 from the course web page. Save it to a file
named sol00.tex.
-
To ``compile'' this file, enter the command latex sol00.tex . Several files will
be produced including sol00.dvi.
-
To view the typset version of your file, enter the command xdvi sol00.dvi .
-
To create a postscript version of the file, enter the command dvips -o sol00.ps sol00.dvi. This creates
the file sol00.ps.
Step 2:
-
Open sol00.tex in a text editor. The first two lines of text establish the document style and open the document;
you should not change these lines. The next seven lines of text print a heading.
-
After the heading code enter the line
-
Compile the modified version of sol00.tex and view it in xdvi.
Step 3:
-
The next few lines of sol00.tex are instructions followed by the problems.
-
In the text for problem one, find the line that reads "$f(n)=10$ and $g(n)=3^n$".
Insert a new line
-
$f(n)>g(n)$ for $n$ in the range $[1 \ldots 3]$
-
Recompile and view the result.
-
Text delimited by the $ are interpreted in math mode . You should see a difference in the type style
between the two versions of of the letter "n".
- Some mathematical symbols that are only available in math mode.
For example the \ldots command produces an ellipse in math mode. If you remove the $ delimiters the
the document will not compile.
Step 4:
-
Insert the correct answers to each question.
-
Recompile and view the results.
-
Create a postscript version, print, and bring to the next class.
-
:)
Last updated:
August, 2000