Trent's LaTeX Resources

Aside: This page was made in a combination of plain text editors and W3C's Amaya. I guess it's what happens when you go for overkill on standards compliance. The source code isn't hugely interesting.

LaTeX fonts

LaTeX Preambles

\usepackage{times}
\usepackage{fancyhdr}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{theorem}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{epic}
\usepackage{setspace}
\usepackage{psfrag}
\usepackage{url}
\usepackage{flushend}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage[british]{babel}
\usepackage{hyphenat}
\usepackage[ps2pdf, backref, bookmarks, bookmarksopen=true, bookmarksnumbered=true]{hyperref}
\@ifundefined{newblock}{\def\newblock{\par}}{}
\widowpenalty=2000
\clubpenalty=2000
\hyphenpenalty=1000
\tolerance=1000

Packages

times

Makes Times Roman the default character font

fancyhdr

Fancy headers...

To actually have something happen when you use this package, you need to define your 'fancy' header.

Example (in the preamble):

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Your fancy heading 
% For the final copy you need to remove 
%       '\bfseries\today' below 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markright{\chaptername\ \thechapter.\ #1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}{}}
\lhead[\fancyplain{}{}]%
      {\fancyplain{}{\bfseries\rightmark}}
\chead[\fancyplain{}{}]%
      {\fancyplain{}{}}
\rhead[\fancyplain{}{}]%
      {\fancyplain{}{\bfseries\thepage}}
\lfoot[\fancyplain{}{}]%
      {\fancyplain{}{}}
\cfoot[\fancyplain{}{}]%
      {\fancyplain{}{}}
\rfoot[\fancyplain{}{}]%
      {\fancyplain{}{\bfseries\today}}

epsfig

Apparently you need this if you want to have eps figures.

graphicx

Better graphics support...?

amsmath

Some maths fonts...?

theorem

The theorem environment...?

amssymb

More math-ish fonts...?

latexsym

epic

setspace

psfrag

Allows you to insert postscript fragments...?

url

Use this to enable \url{http://www.balch.com}

flushend

Some submissions (e.g. CHI) require the columns on the last page to be flush. This package accomplishes this.

fontenc

The font encoding -- the options sets the type e.g. T1 for Type1 (outline) fonts.

ae

A font package, good for PDF generation.

aecompl

A font package, good for PDF generation.

babel

Use this for multi-language support or better hypenation (e.g. for British English)

hyphenat

This package allows you to set hypenpenalty and tolerance relaibly and also to disable hypenation altogether if you so desire. It also defines macros for '/', '-', etc. that tell TeX to insert that character and an optional linebreak (TeX would normally treat this as a whole word). See table:

\fshyp{} Forward Slash + Optional line break
\bshyp{} Backslash + ...
\hyp{} Hypen + ...
.
..

hyperref

This package sets up hyperlinks for the output format; PDF, for example. The first option should be the converter you are using -- ps2pdf, pdflatex, dvipdfm, etc. The 'backref' option adds references in your bibliography back to the [sub]section[s] in which they were cited. The "bookmarks" option adds PDF bookmarks (document map/tree) at the [sub]section starts.

newblock

This isn't really a package, but some BibTeX things need this defined even though they don't define it themselves. This prevents "Undefined Sequence" errors from occuring.

LaTeX Options

widowpenalty

When a the single, last line of a multi-line paragraph appears at the top of a page, it is called a widow. The default is 150. Increasing this to 1000~2000 will make TeX try harder to avoid them. Setting it as high as 10000 is unwise.

clubpenalty

When the single, first line of a multi-line paragraph appears at the bottom of a page, it is called an orphan or, in TeX, a "club". The default is 150 as for widowpenalty.

hyphenpenalty

Increasing this reduces the tendency for TeX to use hyphenation. Not sure what the default is. 1000 is more than the default.

tolerance

This is related in some way to hyphenpenalty.. not sure how though.