Closed johndcook closed 10 years ago
Using \eval
requires the file itself to be accepted by ghci
. An empty literate Haskell file currently is not. You get unlit: No definitions in file (perhaps you forgot the '>'s?)
. I would rather not special-case this. You can of course use a different literate preprocessor that is more tolerant, for example lhs2TeX
itself, by saying
%options ghci -pgmL lhs2TeX -optL--pre
(but then again, this has other implications).
Thanks.
On Tue, Jul 22, 2014 at 2:57 PM, Andres Löh notifications@github.com wrote:
Using \eval requires the file itself to be accepted by ghci. An empty literate Haskell file currently is not. You get unlit: No definitions in file (perhaps you forgot the '>'s?). I would rather not special-case this. You can of course use a different literate preprocessor that is more tolerant, for example lhs2TeX itself, by saying
%options ghci -pgmL lhs2TeX -optL--pre
(but then again, this has other implications).
— Reply to this email directly or view it on GitHub https://github.com/kosmikus/lhs2tex/issues/36#issuecomment-49792057.
John D. Cook http://www.johndcook.com
Apparently a .lhs file must contain a code block, though it may be empty. The following file will process correctly, but lhs2TeX will hang if you remove the empty code block.
\documentclass{article} %include polycode.fmt \begin{document}
%options ghci \eval{2+2}
\begin{code} \end{code}
\end{document}
I'm using lhs2TeX version 1.8.1 and ghc 7.8.2 on Windows.