How to Make LaTeX use a Hanging Indent

Ah, LaTeX. The programmer’s text processing system, in which you have to compile your document before it turns into something viewable. It gives us the joys of truly beautiful equation typesetting and the agonies of obscure commands, crazy “badness” rules, and sometimes obstreperous auto-figure placement.

Today was a case in point. I’m typesetting the index for a book and I wanted to get entries to have hanging indents, like this:

This is my paragraph, which I am writing to demonstrate what it looks like to have a paragraph that wraps and uses a hanging indent.

The only problem is that LaTeX only lets you specify how much to indent the first line of a paragraph, not the rest. The assumption is that the “typical” sort of indentation you want is to get paragraphs like this:

This is another paragraph, which shows what it looks like to have a paragraph that wraps but indents the first line instead of the following lines.

The solution turns out to be to set your left margin in to where you want the hanging lines to be, and then use a negative offset to specify the indentation of the first line. Here’s an example:

\leftskip 0.1in
\parindent -0.1in

Thank you, google! Talk about thinking outside the box.

P.S. What’s funny is that HTML has the same limitation, so to show the first example above, I had to set a negative text indentation.