Handy LaTeX Tips

This page is an archive of handy LaTeX tips. Enjoy!

Problem: How do I doublespace the document?

Solution #1 (John Regehr): Setting \baselinestretch = 2.0 is not right. The LaTeX Companion p. 53 says that an appropriate \baselinestretch value to achieve double spacing for an 11pt font is 1.62. Solution #2 (Allison Powell): setspace.sty has a \doublespacing command that uses this 1.62 value, plus it automatically drops back to singlespacing for footnotes, captions and tables.

Problem: Computer Modern font is ugly!
Problem: Distilling LaTeX postscript to pdf results in an ugly bitmapped font for Computer Modern.

Solution (John Regehr): "\usepackage{pslatex}" will make the entire document use postscript fonts.

Problem: URL breaks aren't working.

Solution (John Regehr): \usepackage{url}.

Problem: I want my bibliography urls to be formatted nicely.

Solution: I forget now why I had to create an alias for \url in my BiBTeX file. (Maybe BiBTeX already has a definition for \url?) Anyway, in your main .tex file, put this in your header:

\usepackage{url}
\newcommand{\urlBiBTeX}[1]{\url{#1}}
Then in your .bib file, do this for an entry with a URL:
  note = "URL: {\urlBiBTeX{http://coppit.org/}}",
Problem: I want latex to automatically figure out how many times to run itself.

Solution: Try latexmk, latexmk-jcc, or tex-it.

Problem: I want to generate PDF directly instead of having to go through dvips and distill.

Solution (John Regehr): "pdflatex" produces nice, compact pdf directly from latex, eliminating the need to go through dvips and distill. It also gives you direct control over many pdf features that you can't get to if you go through the longer toolchain.

Problem: A makefile would be nice.

Solution: Here's mine: makefile. You can do "make ps" and "make pdf". It should give you a starting point for something more complicated. Be sure to change the file name from dft-spec to yours.

Problem: How can I transform LaTeX to HTML?

Solution (John Regehr): There are a lot of tools out there. TeX4ht seems to be one of the better ones. Get the LaTeX Web Companion for a really good discussion of font issues with PDF, LaTeX to HTML conversion, etc.

Back Back to my homepage.