# LaTeX for Beginners

by Tom Schneider

The goal of this page is to provide a very simple start for people to begin using LaTeX the powerful typesetting language. If you find something on this page confusing, please email me.

# Setting Up

Setting up LaTeX isn't too hard. You can learn about it from LaTeX Bibliography and other resources. Here are several methods I've used:

• Set it up using the TEX Collection DVD from the TeX User's Group (TUG) for a Mac.
• A really easy way to get going: install a RedHat Linux. My Linux 7.1 had LaTeX already set up.
• These days I'm using Ubuntu Linux. It's not pre-installed but just type 'latex' and it will lead you to installation!
To test my LaTeX installation I typed in (or cut and paste) this small file:
\documentclass[12pt]{article}

\begin{document}

\large
a buncha
stuff

$$\sqrt{\pi}$$

\end{document}


I called it test.tex. Then I did this:

latex test
xdvi test

The first line ran LaTeX and the second one poped up a viewer. It worked fine.

On Ubuntu I also did:

latex test
dvips test
gv test.ps
ps2pdf test.ps

I found I needed to install gv - that took only a few seconds. So I was able to get LaTeX running on Ubuntu in about 5 minutes, mostly waiting for the download. The last step made a PDF for me and double clicking on it in the graphical window opened it in evince.

Notes:
• A fully worked example is in latex.test. You can see the result in the test.png file, shown to the right. It's not very fancy, but you can go to The TeX showcase if you want fancy!
• In general one may need to call LaTeX several times to get cross references right.
• Actually, I put the two commands above into a file and used it as a script, in preparation for automating the whole process using atchange. This makes LaTeX into a WYSIWYG (what you see is what you want!).
• A more complex starting file and other paraphernalia is in this directory. It contains, among other things:

# Some simple rules for typesetting in LaTeX:

• Get used to your text editor first. I like vi and vim, other people like emacs. The advantage of learning vim is that all unix operating systems have it. It's also quite ergonomic. Avoid using the arrow keys since they will not be available on all keyboards.
• In LaTeX, paragraphs are separated by blank lines. If you are using the vim editor, you can hop between paragraphs with "}" (move forward one paragraph) and "{" (move back one paragraph. You can also move paragraphs around. If you are above one paragraph, just d}p to switch it with the next paragraph!
• As in standard typing, sentences are separated by two spaces. If you are using the vi editor, you can hop between sentences with ")" (move forward one sentence) and "(" (move back one sentence. You can also move sentences around. If you are at the start of one sentence, just d)p to switch it with the next sentence!
• \emph{Italics} gives italics
• \textbf{Bold face} gives bold face
• lines that begin with a percent (%) are comment lines. They do not show up in the final text.
• \cite{Shannon1948} automatically (!) pulls in the citation for Shannon's famous 1948 paper (assuming you already have it in a database). Further details are beyond the scope of this page, but you can use atchange to automate the generation of the BiBTeX database.
• \command{argument} is the form of a command with its argument.
so the base must be distorted.
This figure
was
the cover of \emph{Nucleic Acids Research}
Volume 29, Number 23,
December 1, 2001
\cite{Schneider.baseflip.2001}.
}
\label{fig.baseflipcover}
\end{wrapfigure}
}

More information may be found in: Guide to LATEX: Document Preparation for Beginners and Advanced Users by Helmut Kopka, Patrick W. Daly. Essential!!

Schneider Lab

origin: 2000 February 16
updated: 2014 Nov 10