lhs2tex, Haskell Platform and cygwin
I just downloaded a fresh copy of Haskell Platform, and successfully got cabal to update itself. I installed smallcheck-0.4 successfully too. But then I tried to install lhs2tex, which 'worked' until the point of saying: Linking dist\build\lhs2TeX\lhs2TeX.exe ... Installing executable(s) in C:\Program Files (x86)\Haskell\bin setup.exe: The program mktexlsr is required but it could not be found And I do have 'mktexlsr' in my cygwin PATH (where I was running 'cabal install lhs2tex'). It's true that mktexlsr isn't in my Windows PATH. I would have thought someone else would have encountered this already, but my google searchers found other (long fixed) problems with lhs2tex under cygwin, but not this one. Jacques
Hi Jacques Does it install properly by the runhaskell Setup.hs configure / build / install? I re-installed it this way a couple of weeks ago and it never mentioned mktexlsr.
From a runhaskell Setup.hs ... install it did have a couple of problems which don't relate to your problem but seem worth enumerating here on the mailing list (so a Google search should pick them out). Unless lhs2TeX has been updated recently, it uses the old exceptions so I had to edit FileNameUtils.lhs. Also (on Windows) if your TeX installation has a space in the path, getting poly style to work will be challenging - the Setup.hs file has (had?) logic to reject 'bad' paths. Finally on Windows I was getting this error - the problem is actually with Windows and TeX (not lhs2TeX):
! Undefined control sequence. l.30 }\SkipToFmtEnd ? q OK, entering \batchmode Where the lhs2TeX manual gives these command to generate a file: $ lhs2TeX -o HelloWorld.tex HelloWorld.lhs $ pdflatex HelloWorld.tex On Windows, you need an intermediate step: $ lhs2TeX -o HelloWorld.tex HelloWorld.lhs $ dos2unix HelloWorld.tex $ pdflatex HelloWorld.tex Best wishes Stephen
Stephen Tetley wrote:
Hi Jacques
Does it install properly by the runhaskell Setup.hs configure / build / install? I re-installed it this way a couple of weeks ago and it never mentioned mktexlsr.
No, it doesn't. I first run into issues with exceptions-related issues (as you did), which I solved via runghc Setup configure --constraint="base<4" But the install still failed on mktexlsr. So I tried runghc Setup configure --constraint="base<4" --with-mktexlsr="C:\\cygwin\\bin\\mktexlsr" runghc Setup build runghc Setup install but now I get a new error related to mktexlsr, namely $ runghc Setup install Installing executable(s) in C:\Program Files (x86)\Haskell\bin Setup: \cygwin\bin\mktexlsr: runGenProcess: invalid argument (Exec format error) mktexlsr is a /bin/sh script, so it's quite natural that an Exec on that would fail. So I'm still stuck. Thanks for the dos2unix pointer, that would have taken quite a while to figure out. Jacques
2009/12/17 Jacques Carette <carette@mcmaster.ca>:
mktexlsr is a /bin/sh script, so it's quite natural that an Exec on that would fail. So I'm still stuck.
Ah ha - yes running mktexlsr is an optional step on page 5 of the lhs2TeX manual necessary to get the "poly" style. I tried a couple of hacks to the Setup.hs file to get poly running, but as I've MikTeX installed in a path with a space (and didn't want to re-install it), I decided I could live without poly and just have the simple styles. Best wishes Stephen
Some success now. Reverting to building by hand, if I 1. edit config.ml to put "" quotes around the name of the GHC executable (since it contains spaces AND () ), 2. edit Makefile to add -package base-3.0.3.1 on to the --make line, things proceed through the build and install stage properly. For doing things by-hand, it would be nice if the 'configure' script automatically put "" quotes aroung the name of the GHC executable when generating config.mk. I took a look to see if I could figure out a patch to do that, but it wasn't obvious enough. Also, it would be nice if there were an lhs2tex version which worked out-of-the-box with base>=4, since hacking the Makefile for that seems, er, sub-optimal? Best would be if cabal was cygwin-friendlier. Unfortunately, that seems to be a lot easier said that done :-(. Now I have to see if 'poly' style *actually* works... Jacques
Also, it would be nice if there were an lhs2tex version which worked out-of-the-box with base>=4, since hacking the Makefile for that seems, er, sub-optimal?
I've just uploaded 1.15 which should work better on Windows. Sorry, I should have released a new version a long time ago. Please let me know if this works. Cheers, Andres -- Andres Loeh, Universiteit Utrecht mailto:andres@cs.uu.nl mailto:mail@andres-loeh.de http://www.andres-loeh.de
participants (3)
-
Andres Loeh -
Jacques Carette -
Stephen Tetley