There's a good article on nut compensation in the most recent 'American Lutherie' magazine, from the Guild of American Luthiers (
www.luth.org). It's also covered at length in the books by Trevor Gore and Gerrard Gilet. You can find those through a search on Trevor's name, I'm sure: expensive, but worth it.
For those who want the short synopsis:
When you fret a string at the first fret it goes a little sharp, and as you go up the neck the notes tend to get a bit sharper. You can plot this out as a rising graph of 'cents sharp', and each string works a little differently.
Compensating the saddle works by adding a bit of length to the sounding part of the string. Since a given saddle offset amounts to a larger proportion of the string length as you go up the neck the flatting effect gets greater. In graphic terms, the slope of the line is reduced. By moving the saddle back the correct amount you can get the string to sound an exact octave at the 12th fret. However, this does nothing (or next to nothing) to correct the intonation at the first fret. Thus, with only saddle compensation you end up playing a little sharp in the low positions, and flat above the 12th fret.
To get the intonation right at the first fret you could move it back toward the nut, but that would make the wrong interval from the first fret to the second. In the end, to keep the intervals right, you'd shift all the fret back, and that's the same as moving the nut forward a little, and re-tuning. It turns out that shifting the nut forward drops all of the fretted notes by about the same amount in terms of musical cents. Graphically, this amounts to shifting the whole line down. With the right nut offset you can get the first fret note in tune, but the rest of them still go sharp as you play up the neck.
The trick, then, is to use a combination of nut and saddle offset: shift the nut to get the first fret in tune, and shift the saddle to flatten the line. There's no way to ever get an acoustic instrument to play exactly in tune on every note without a lot of tweaking of individual fret locations, if for no other reason than that the resonances of the instrument throw things off. Still, nut and saddle offset will get you a lot closer than either by itself.
There's nothing particularly new about any of this. Bartolini wrote an article about nut compensation in the old 'Journal of Guitar Acoustics" back around 1982, and Greg Byers had an article in 'American Lutherie' a few years back. The problem is that, until recently, nobody's explained it very well, so I always found it hard to get on the bandwagon. Once you see how it works, it makes a lot of sense. Once you hear it, it makes even more.