You can prepare high quality math and engineering
papers using LaTeX, pronounced lah tech.
This is not intended to cover all or even most of LaTeX.
You will prepare a LaTeX file foo.tex
running LaTeX
On UMBC GL machines you have several options to get output:
latex foo.tex
latex foo.tex # this is needed for TOC, bibliography, etc
dvips -o foo.ps foo.dvi # compiling produces a .dvi and other files
lpr foo.ps # print high quality PostScript
# your browser can view foo.ps, lower quality print
ps2pdfwr foo.ps foo.pdf # optional to also produce a .pdf
pdflatex foo.tex # generate a foo.pdf directly
acroread foo.pdf # use acroread to view and print
evince foo.pdf # use evince to view and print
# your browser can view and print foo.pdf
and, many other auxiliary programs are available.
Use your favorite editor to create foo.tex
Best on-line reference is:
http://en.wikibooks.org/wiki/LaTeX
Getting LaTeX on your computer
Linux: sudo apt-get install texlive
MacOSX: get mactex
Windows: get protext or miktex
First example
Here is a simple, complete, .tex file
hello.texhello.pshello.pdf
% hello.tex absolute minimum to get output
\documentclass[12pt]{letter} % could be paper, article, report, book, slides ...
\begin{document} % start of document
Hello world from LaTeX.
\end{document} % end of document, nothing after this line
The Makefile commands to generate hello.ps and hello.pdef are:
latex hello.tex
latex hello.tex
dvips -o hello.ps hello.dvi
ps2pdfwr hello.ps hello.pdf
Note some syntax "\" and "{ }"
"\" starts a command, there are many.
You can define new commands to save on typing.
More commands can be brought in from packages
"{ }" are for grouping or enclosing. Usually REQUIRED!
e.g. \frac {numerator equation} {denominator equation}
Generally, arbitrary nesting is allowed, just use
lots of { { {} {} } { } }
one or mode spaces is a space.
carriage return and tab are a space.
lines automatically formatted unless you interfere
No semicolons at end of lines or statements
Printing equations
equation.texequation.ps
% equation.tex just a few samples
\documentclass[12pt]{article}
\begin{document} % start of document
For subscript use underscore
$A_1 \; \; A_i \; \; A_{i,j} $ % \; for more spaces
For power, superscript use hat % $ your equation $
$x^2 \; \; x^{p+q} \; \; x^{y^z} $
${n \choose k} = \frac{n!}{k!(n-k!)}$
$z = \sqrt {x^2 + y^2}$
\[ \int _{i=0} ^{\infty} \frac {1}{{(x+1)}^2} dx \]
\( \sum _{j=1} ^{10} A_j \)
\end{document} % end of document, nothing after this line
printing matrices and vectors
Using \matrix
pdemat.texpdemat.pspdemat.pdf
% pdemat.tex
\documentclass[11pt,fleqn]{article} % preamble follows
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0.5in}
\setlength{\textwidth}{6.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\oddsidemargin}{0in}
\newcommand{\LL}{\mit L}
\begin{document} % start of document
System of simultaneous equations that are too wide for paper
$$\left| \matrix{ \int_{\Omega} \LL \left( \phi_1(x,y) \right) \phi_1(x,y) dx \, dy \
\int_{\Omega} \LL \left( \phi_2(x,y) \right) \phi_1(x,y) dx \, dy \
\ldots \
\int_{\Omega} \LL \left( \phi_{nxy}(x,y) \right) \phi_1(x,y) dx \, dy \cr
\int_{\Omega} \LL \left( \phi_1(x,y) \right) \phi_2(x,y) dx \, dy \
\int_{\Omega} \LL \left( \phi_2(x,y) \right) \phi_2(x,y) dx \, dy \
\ldots \
\int_{\Omega} \LL \left( \phi_{nxy}(x,y) \right) \phi_2(x,y) dx \, dy \cr
\ldots \cr
\int_{\Omega} \LL \left( \phi_1(x,y) \right) \phi_{nxy}(x,y) dx \, dy \
\int_{\Omega} \LL \left( \phi_2(x,y) \right) \phi_{nxy}(x,y) dx \, dy \
\ldots \
\int_{\Omega} \LL \left( \phi_{nxy}(x,y) \right) \phi_{nxy}(x,y) dx \, dy \cr
} \right|
\times
$$
$$ \left| \matrix{ U_1 \cr U_2 \cr \ldots \cr U_{nxy} \cr } \right|
=
\left| \matrix{ \int_{\Omega} f(x,y) \phi_1(x,y) dx \, dy \cr
\int_{\Omega} f(x,y) \phi_2(x,y) dx \, dy \cr
\ldots \cr
\int_{\Omega} f(x,y) \phi_{nxy}(x,y) dx \, dy \cr } \right|
$$
\end{document} % end of document, nothing after this line