Title: LaTeX notes
Author: Darin Brezeale
Date Created: 05-13-2004
Updated: Sunday, 12-Jul-2009 22:12:11 EDT

 

a simple LaTeX file

\documentclass{article}
\begin{document}
This is a LaTeX document.
\end{document}

 

Note that when creating an index or bibliography, it may be necessary to run latex or pdflatex twice; the first time xxxxxxxxxx counts.

create a .dvi file from the file somefile.tex (assumes that the extension is lowercase)

latex somefile

view the file somefile.tex

xdvi somefile &

create a PDF

pdflatex somefile

create an index

in the header of the .tex file, include
\usepackage{makeidx}
\makeindex

and at the place in the file where the index should appear place
\printindex

then run using
makeindex somefile

create a bibliography

at the end of the file where the bibliography should appear, include (style alpha is used here)
\bibliography{somefile}
\bibliographystyle{alpha}

then run using
bibtex somefile

check spelling -- words not in the dictionary but that are spelled correctly can be saved from within ispell (they will be in the file ~/.aspell.english.pws)

ispell -t somefile.tex

remove the LaTeX statements and check spelling

detex somefile | spell > errors.txt

extract the images from somefile.pdf

pdfimages somefile.pdf root

 

to skip a number in the eqnarray environment
something &=& somethingelse \nonumber\\


change section numbers to capital Roman numerals:
\renewcommand \thesection{\Roman{section}}


to insert an Arabic section number after the section title:
\section {Section Title \arabic{section}}


to skip a line:
\vspace{\baselineskip}		


to get first level enumerations to use lowercase letters:
\renewcommand{\labelenumi}{(\alph{enumi})}

to get second level enumerations to use lowercase Roman numerals:
\renewcommand{\labelenumii}{(\roman{enumii})}


to create side-by-side tables:
\begin{minipage}{2in}
	\begin{tabular}{c}
		Table1
	\end{tabular}
\end{minipage}
\begin{minipage}{2in}
	\begin{tabular}{c}
		Table2
	\end{tabular}
\end{minipage}


options for package hyperref

\usepackage[
]
{hyperref} colorlinks=true % change links from a box to be colored
linkcolor=blue
pdfpagemode=FullScreen % begin in fullscreen (ctrl-L) mode
pdfpagelayout=SinglePage % put each section on a separate page
pdfstartview=FitH % fit to window

box around equation
\usepackage{amsmath}
\boxed{\theta = \frac{\mu + 3}{5}}
Can't remember the command for a symbol? Go to Detexify. There you can draw the symbol and the website will tell you the command.


References

  1. LaTeX for Word Processor Users
  2. The Not So Short Introduction to LaTeX2e
  3. Using Imported Graphics in LaTeX2e
  4. A BibTeX Guide Through Examples
  5. BibTeX and bibliography styles good examples of style files
  6. A Guide to LaTeX, 4th Ed., Addison Wesley
  7. More Math Into LaTeX, 4th Ed.
  8. LaTeX Tips and Tricks — great collection of tips
  9. LaTeX isn't for everyone but it could be for you — the benefits of using LaTeX
  10. Sebastien's Latex Tricks — good examples of working with figures
  11. http://www.math.uiuc.edu/~hildebr/tex/ — good tutorials for representing math in LaTeX
  12. AMS-LaTeX — how and why you should use the AMS-LaTeX packages