I'm writing a literate Haskell paper, and I'm using lhs2TeX to help make it look pretty. However, lhs2TeX seems to mess up my indentation. I have some source that looks like this:
\documentclass[a4paper]{article}
%include polycode.fmt
\begin{document}
I'm going to define a big function now.
\begin{code}
function :: Some -> Complicated -> Signature
function s c = some helper variables where
\end{code}
Now I explain the variables and summarize the structure of the function.
Here come the local variables:
\begin{code}
some = "I should be indented."
...
\end{code}
\end{document}
Compile with lhs2TeX Example.lhs -o Example.tex
, then render with pdflatex Example.tex
and check the pdf. Notice that the "I should be indented."
line is not indented.
Function locals should be indented, but lhs2TeX loses the indentation. Does anyone know how to convince lhs2TeX to indent function locals when they are separated by text from the beginning of the function definition?
I'm open to quick-and-dirty TeX solutions (like manually marking the code blocks that need indentation) and I'm also open to alternatives to lhs2TeX
if they also make the literate haskell file pretty.
\documentclass...
and ending with\end{document}
. It helps the solvers a lot.