Latex Tips

editor: David Buttler
Return to Index

Latex Cheat Sheet (PDF) (PS) (LaTeX)
Essential Latex (PS) (PDF) (HTML)

Figures and Tables Fonts, page numbering, spacing Misc
Three figures in a row
A table cell spanning multiple columns
Placing a box around a text area
Referencing Figures in text
Fonts
Paragraph and list item spacing
Converting PS to PDF
Counting words in a document
Removing page numbers from first page in document
BibTex
Style file collection for bibliography styles
Bibtex-style bibliographies for MS Word



Fonts

Contributed by Dan Rocco

\usepackage{times}
This allows Latex to use true type fonts, which produces smaller files and the results look much better on other machines, such as Acrobat Reader once the file is converted to PDF

Counting words

Contributed by David Buttler

To strip out all tex commands from a document, run the command
detex
Then you can pipe the result through
wc 
to obtain a count of the words in your document

Postscript to PDF

Contributed by David Buttler, Minaxi Gupta, Patrick Yaner

Acrobat Distiller is installed on a handful of solaris machines. The output of this is very nice (except for embedded images which turn out a bit grainy) log into forge and the command is:
distill filename.ps
You can use several tools to convert between postscript to PDF or vice versa. Some methods have better quality than others. Typically, the methods on linux or windows work better than solaris.
convert filename.ps filename.pdf
on linux
pdf2ps
ps2pdf
convert
xpdf (print writes to an postscript file)

Note: You may get better results if you add the command
-Ppdf
to the dvips command

Alternatively, log into one of the Unix machines with distiller installed and run
latex document.tex
; [repeat as necessary, bibtex, whatever]
dvips -Pdistill document.dvi
distill document.ps
beautiful PDFs will result.

Paragraph and list item spacing

Contributed by Zack Kurmas and David Furcy

In LaTeX, the command \parskip lets you set the amount of whitespace between paragraphs.

The command that sets the amount of whitespace between items in an itemized/enumerated list is \itemsep. If I remember correctly, it is added to \parsep to determine the vertical space between items.


three figures in one row

Contributed by Lakshmish
\begin{figure}[tbh]
\setlength{\unitlength}{.5in}
\begin{picture}(14,6)
\put(0, 0){\special{psfile=cache2lat.ps hscale=12 vscale=15}}
\put(4, 0){\special{psfile=cache4lat.ps hscale=12 vscale=15}}
\put(8, 0){\special{psfile=cache8lat.ps hscale=12 vscale=15}}
\end{picture}
\caption{Estimated Latency for Cache Group}
\label{figthree}
\end{figure}

A box around text

Contributed by Henrique
\begin{figure*}[ht]
\begin{center}
{\small
\framebox[7in]{
\begin{minipage}[t]{1.0in}

% Insert here your text

\end{minipage}
}
}
\end{center}
\caption{Figure Label}
\label{lb}
\end{figure*}

Get rid of the page number appearing on the first page only

Contributed by Chad Honeycut, Jau, Tricha, and Patrick Widener

Put
\thispagestyle{empty}
just after
\maketitle
Make sure your title, pagestyle, etc. are inside of
\begin{document}

Inserting a figure and referencing it

Contributed by Henrique Paques

For referencing in the text:
Figure~\ref{querysteps}
For inserting the figure:
\begin{figure*}[ht]
\begin{center}
\leavevmode
\epsfxsize=5.5in
%\epsfysize=3.5in
\epsffile{../figures/figs/fig-step.eps}
\end{center}
\caption{A Sketch of the DIOM distributed query scheduling framework}
\label{querysteps}
\end{figure*}

For automatic one-inch margins:
\usepackage{fullpage}

To set page size for dvips add the following command:
\special{pagesize=8.5in,11in}

Double column

\documentclass[10pt,twocolumn]{article}

Easy Graphics

For more options see CTAN postscript guide
\usepackage[dvips]{graphicx}
\graphicspath{{./images/}{./figs/}}
Example for using this package:
\begin{figure*}[ht]
\begin{center}
\includegraphics[scale=.70]{filename.eps}
\end{center}
\caption{A Sketch of the DIOM distributed query scheduling framework}
\label{querysteps}
\end{figure*}

A Cell Spanning multiple columns (e.g. a title cell)

Contributed by Wai Gen
\begin{table}
\begin{center}
\begin{tabular}{|l|l|}
\hline
\multicolumn{2}{|l|}{\textbf{Decision Variables}}\\
\hline
$x_{ij}$        & decides; if data fragment $i$ is included in datagroup
$j$\\
$y_j$           & decides; if datagroup $j$ is active\\
$z_{jk}$        & decides; if datagroup $j$ is transferred to client $k$\\
\hline
\multicolumn{2}{|l|}{\textbf{Pre-Decision Variables}}\\
\hline
$n$             & number; of data fragments\\
$s_i$           & size; of data fragment $i$\\
$b$             & size; of each operation transmitted\\
$m$             & total; number of operations per day\\
$u_{ik}$        & indicator; variable--shows if data fragment $i$ in the in
interest set of client $k$\\
$w_i$           & \% of; operations that apply to data fragment $i$\\
$D$             & number; of clients\\
$d_i$           & data; fragment $i$\\
$p_j$           & datagroup; $j$\\
$C_c$           & cost; of checking an operation against a datagroup\\
$C_u$           & cost; of saving an update operation to a group update
file\\
$C_t$           & cost of; transmitting an update operation to a client\\
$C_a$           & cost of; assimilating an update operation at the client\\
$\alpha$        & weight; of server-side processing\\
$\beta$         & weight; of group update file transmission\\     


Monitor this page for changes