Most of the technical books I've read use what I call "side icons" to mark out certain types of content. Stuff like "watch out for this" and "helpful tip", with corresponding icons.
Here's an example of what I mean (the "key point" and "coding horror" icons):

Taken from http://www.codinghorror.com/blog/2007/12/on-the-meaning-of-coding-horror.html
How can I do this in LaTeX (with \documentclass{book})? To be clear, I want to be able to attach icons (with captions) to text so that the icons are outside the normal flow of the text.
I have tried \marginpar (reversed), it's always pushing a portion of the image out of the paper. For example, the following code:
\reversemarginpar
\chapter{Getting started}
\pagestyle{headings}
AABBB
\marginpar{\includegraphics[scale=0.3]{images/example}}
CCC
gives:

I get similar results with \marginnote
using http://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg.
\marginpar(LaTeX-kernel) or\marginnote(from the marginnote package). – Ulrike Fischer Dec 17 '12 at 09:31\marginpardoesn't work (see above). I'll try\marginnote– Manishearth Dec 17 '12 at 09:50\marginpardoes work. But your page layout is not adapted for large objects on the inner margin. You can usehfillto move the picture on odd pages\marginpar[{\hfill\includegraphics[scale=0.3]{example}}]{\includegraphics[scale=0.3]{example}}. But if you want the pictures always on the left side, you should check this answer: http://tex.stackexchange.com/questions/62017/how-can-i-place-marginal-notes-always-on-the-right-but-show-normal-odd-even-head – Ulrike Fischer Dec 17 '12 at 10:33