Difference between revisions of "User:Gwh2/LaTeX Best Practices"
From Cyber-Physical Systems Laboratory
Jump to navigationJump to searchLine 2: | Line 2: | ||
Add a line break after each sentence. This makes it much easier to deal with version control, since CVS and SVN can automatically merge changes iff they happen on different lines. | Add a line break after each sentence. This makes it much easier to deal with version control, since CVS and SVN can automatically merge changes iff they happen on different lines. | ||
+ | |||
+ | == Hyphens vs. Dashes == | ||
+ | |||
+ | Complex words use a single hyphen (<code>-</code>): <code>standards-based</code>, <code>state-of-the-art</code>. Ranges use an en dash (<code>--</code>): <code>1981--2009</code>, <code>1--5</code>. Parentheticals use an em dash (<code>---</code>): <code>the total energy consumption --- comprised of the network, sensing, and computation costs --- at each node</code>. | ||
== Citation Formatting == | == Citation Formatting == |
Revision as of 19:05, 22 May 2009
General
Add a line break after each sentence. This makes it much easier to deal with version control, since CVS and SVN can automatically merge changes iff they happen on different lines.
Hyphens vs. Dashes
Complex words use a single hyphen (-
): standards-based
, state-of-the-art
. Ranges use an en dash (--
): 1981--2009
, 1--5
. Parentheticals use an em dash (---
): the total energy consumption --- comprised of the network, sensing, and computation costs --- at each node
.
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 ofpdflatex
, 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?)