LaTeX

From Christoph's Personal Wiki
Revision as of 23:06, 27 October 2006 by Christoph (Talk | contribs)

Jump to: navigation, search

LATEX, written as LaTeX in plain text, is a document preparation system for the TeX typesetting program.

Examples

Basic document

\documentclass[amsmath,amssymb]{revtex4}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{epsfig}% include .eps files for figures
\usepackage[frenchb]{babel}% SmallCaps font

\begin{document}
...
\end{document}

Tables

\begin{table}
\caption{\label{tab:table1}Table Title}
\begin{ruledtabular}
\begin{tabular}{rrrrrrrrrr}
\multicolumn{5}{c}{Heading 1}&\multicolumn{5}{c}{Heading 2}\\
Seg & Res & Atom & $<B>$ & $<$A$>$ & RMSD & {$T^rB$} & eval & $<B>$ & $<$A$>$\\
\hline
1-9 & 9 & 63 & 22.2 & 1.00 & 10.34 & 8.6 & 146.39 & 22.2 & 0.30\\
10-15 & 6 & 41 & 14.7 & 1.00 & 6.99 & 1.3 & 0.00 & 14.7 & 0.17\\
16-29 & 14 & 119 & 12.7 & 1.00 & 6.12 & 2.0 & 73.85 & 12.7 & 0.32\\
30-47 & 18 & 130 & 7.4 & 1.00 & 2.79 & 2.9 & 11.28 & 7.4 & 0.69\\
48-56 & 9 & 66 & 14.4 & 1.00 & 4.77 & -0.5 & 58.11 & 14.4 & 0.32\\
\end{tabular}
\end{ruledtabular}
\end{table}

Figures

Adding figures is easy in LaTeX:

ps2epsi input.ps output.eps
\usepackage{epsfig} % place at top of .tex file
...
\begin{figure}[hbt]
\begin{center}
\psfig{file=output.eps,width=3.25in}
\end{center}
\caption[short TOC caption]{\em Testing 1FIN.}
\label{ReferenceLabelHere}
\end{figure}

tex2ps

Convert your TeX file to a PostScript file ready for printing:

latex input.tex && dvips -f input.dvi > output.ps

Or, as a shell script:

latex $1.tex && dvips -f $1.dvi > $1.ps

External links

Community

  • Official LaTeX project site web site for open development of LaTeX (you can also obtain a CVS snapshot of LaTeX3, the next version of LaTeX which is not yet released)
  • The TeX Users Group
  • comp.text.tex. A Usenet newsgroup for (La)TeX related questions, comp.text.tex is an invaluable resource for (La)TeX. Search the archives with Google Groups before posting.
  • #latex IRC chat room on Freenode

Periodicals

Tutorials/FAQs

Add-on Packages

Reference