| Title: | LaTeX notes |
| Author: | Darin Brezeale |
| Date Created: | 05-13-2004 |
| Updated: | Saturday, 26-Apr-2008 18:09:29 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}}
http://www.manicai.net/comp/latex/latex_tricks.html
dynamically include program
\verbatiminput{/hame/perfect/wonderful.cc}
Problem: Tables are ending up at the end of the document.
Solution: Try moving the location of the code for the table to an earlier location in the file.
Problem: A table that should be on the first page of a chapter is ending up on the second.
Solution: Because the first page of a chapter has less space for text than the other pages, there may not be enough room for the table. Try the longtable package.
After installing a new package, run texhash
Can install packages in home directory by installing into the directory ~/texmf/tex/<package name>
wrapping tables
\begin{tabular}{lp{4in}}
05/11/2004 --& this is a really, really, really long entry that is too long to fit into this column on a single line
01/17/1999 --& Submitted exam
\end{tabular}
# create hanging.sty
latex hanging.ins
cp hanging.sty ~/texmf/tex
# create hanging.dvi
latex hanging.dtx
cp hanging.dvi ~/texmf/docs
# rebuild the package database
texhash
to make Beamer presentations open in full-screen mode, use
\documentclass[hyperref={pdfpagemode=FullScreen}]{beamer}
to have a column span across columns in a two-column layout, use table*
to suppress the printing of a page number on a page, use
\thispagestyle{empty}
figures side-by-side (based on example at http://merkel.zoneo.net/Latex/index.php)
\begin{figure}
\begin{minipage}[t]{3in}
\begin{center}
\includegraphics[width = 2.5in] {sliders-normal}
\caption{Frame from Sliders.} \label{sliders-normal}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[t]{3in}
\begin{center}
\includegraphics[width = 2.5in] {sliders-dc}
\caption{Frame from Sliders in which all values in a block use the DC term.} \label{sliders-dc}
\end{center}
\end{minipage}
\end{figure}
show limits above and below the summation operator, even when inline
\sum\limits_{i = 1}^{n} x_{i}