Humbly submitting the way I work on my book for learning Haskell:
https://github.com/bitemyapp/doc-workshop
Uses Pandoc, compiles markdown to LaTeX, LaTeX renders to PDF.
Dynamically re-renders the preview of the PDF as I save my markdown files.
Pandoc admits inline LaTeX in the markdown documents themselves.
Auto-rebuilder script by http://twitter.com/mwotton
Learn about Pandoc here: http://johnmacfarlane.net/pandoc/
I edit in Emacs, but you can use whatever obviously.