User:Gwh2/LaTeX Best Practices

From Cyber-Physical Systems Laboratory
Revision as of 22:00, 8 April 2009 by Gwh2 (talk | contribs) (New page: == Citation Formatting == Add <code>\usepackage{cite}</code> to your preamble to get nicer formatting for multiple-key citations. Use <code>text~\cite{key}</code> rather than <code>text ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Citation Formatting

Add \usepackage{cite} to your preamble to get nicer formatting for multiple-key citations.

Use text~\cite{key} rather than text \cite{key} to keep LaTeX from breaking sentences like

blah blah blah text
[1]

Image Formatting

The One True Template for inserting images is:

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\columnwidth]{filename-no-extension}
    \caption{Figure caption}
    \label{fig:section:filename-no-extension}
\end{figure}
  • LaTeX is incredibly whiny about having the image, caption, and label in that order. Get it wrong, and parts of your paper may have funny references.
  • Be sure to exclude the filename extension. That way, when a conference changes its mind and demands an .EPS rather than a .PDF, you can just convert all of your .PDF/.PNG images to .EPS, run latex instead of pdflatex, and not have to change any of your LaTeX code.
  • Starting the label with "fig:section:" helps for code completion. (You are using an editor with code completion, right?)