[Haskell-cafe] Re: lhs2TeX \eval{} problem

Andres Loeh andres at cs.uu.nl
Tue Mar 2 15:10:29 EST 2010


Hi.

> I'm having a problem with lhs2Tex and \eval{}. It doesn't work.
> 
> I have the following in a file test.lhs:
> 
> --------------------------------
> %include polycode.fmt
> 
> One
> %option ghci
> Two
> \eval{4}
> Three
> --------------------------------
> 
> When I try to run this file through lhs2Tex, it crashes:
> 
> > lhs2Tex test.lhs
> ... polycode junk removed ...
> 
> One
> %option ghci
> Two
> lhs2TeX: fd:7: hGetLine: end of file
> 
> --------------------------------
> 
> Has someone encountered this problem before, or knows how to solve this?

Two issues:

First, it's

%options ghci

and not

%option ghci

Second, the \eval is executed in the context of the current file,
i.e., the source must be a valid literate Haskell file. An empty
literate file causes the literate preprocessor to fail. This
works for me:

--------------------------------
%include polycode.fmt

One
%options ghci
Two
\eval{4}
Three

> x = 0
--------------------------------

HTH,
  Andres

-- 

Andres Loeh, Universiteit Utrecht

mailto:andres at cs.uu.nl     mailto:mail at andres-loeh.de
http://www.andres-loeh.de


More information about the Haskell-Cafe mailing list