This is a problem as the LaTeX detection heuristic appears to be:
- Look for a \documentclass macro (the begining of a LaTeX document); or
- Look for a LaTeX command; or
- Assume that the “literate” part is not LaTeX
Needless to say, this is rather annoying as I’m writing a program with a number of modules (and thus a number of files) and want to produce a single document from them. To ameliorate this problem, I just make sure to include a LaTeX-style comment on the first line of every literate Haskell file and use a few macros to do include imported modules into the LaTeX document.
I’m also using the listings package to pretty-print the Haskell code and my next goal is to use its custom keyword handling capabilities to