
Hello, I find it interesting that Haskell should make native provision for a basic form of literate programming, and this immediately suggests, of course, the possibility of mixing code with LaTeX commands. The problem is that putting one's hand on a dedicated LaTeX extension doesn't seem so straightforward. The link to Andrew Cooke's haskell.sty is broken and I couldn't find the file at his new home (www.acooke.org/andrew/). Other possibilities such as Manuel Chakravarty's, lambdaTex and lhs2tex (which I, admittedly, have only looked at briefly) deviate from the \begin{code}...\end{code} suggested by the report and seem to require more (La)TeX proficiency on the part of the user. As my interest is to introduce the ideas of literate programming and LaTeX to people thorougly unfamiliar with such, I need to keep things as simple as possible - of special interest is the fact that a given file can be submitted as is to both hugs and latex, without the need for preprocessing. I've tried to address the question by redefining an existing environment \usepackage{moreverb} \newenvironment{code}{\begin{verbatimtab}[4]}{\end{verbatimtab}} but moreverb and the like depend on verbatim which is apparently the one environment you can't use like this and I'm no such LaTeX guru that I can come up with better alternatives. So the question is : would anyone know where to find haskell.sty (presuming that's what I need) or is there some fairly simple solution I've missed ? Thanks, François

On Wednesday, July 10, 2002, at 03:01 AM, François Bédard wrote:
I find it interesting that Haskell should make native provision for a basic form of literate programming, and this immediately suggests, of course, the possibility of mixing code with LaTeX commands.
I've tried to address the question by redefining an existing environment
\usepackage{moreverb} \newenvironment{code}{\begin{verbatimtab}[4]}{\end{verbatimtab}}
but moreverb and the like depend on verbatim which is apparently the one environment you can't use like this and I'm no such LaTeX guru that I can come up with better alternatives.
Use the fancyvrb package. \usepackage{fancyvrb} \DefineVerbatimEnvironment{code}{Verbatim}{} \begin{code} module Main(main) where \end{code} Cheers, Rock. -- Andrew Rock -- arock@cit.gu.edu.au -- http://www.cit.gu.edu.au/~arock/ School of Computing and Information Technology Griffith University -- Nathan, Brisbane, Queensland 4111, Australia

Andrew Rock wrote:
On Wednesday, July 10, 2002, at 03:01 AM, François Bédard wrote:
I find it interesting that Haskell should make native provision for a basic form of literate programming, and this immediately suggests, of course, the possibility of mixing code with LaTeX commands.
I've tried to address the question by redefining an existing environment
\usepackage{moreverb} \newenvironment{code}{\begin{verbatimtab}[4]}{\end{verbatimtab}}
but moreverb and the like depend on verbatim which is apparently the one environment you can't use like this and I'm no such LaTeX guru that I can come up with better alternatives.
Use the fancyvrb package.
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{}
\begin{code} module Main(main) where \end{code}
Cheers, Rock. -- Andrew Rock -- arock@cit.gu.edu.au -- http://www.cit.gu.edu.au/~arock/ School of Computing and Information Technology Griffith University -- Nathan, Brisbane, Queensland 4111, Australia
Well, I wanted something simple and it doesn't get any simpler than this! Thanks a lot, Andrew! I don't know what percentage of Haskell people have an interest in LaTeX (or literate programming, for that matter), but it seems to me the solution you're offering should be put somewhere in the doc - or Wiki perhaps. It's a fundamental complement to the .lhs format. Many thanks again, François

François Bédard wrote:
The link to Andrew Cooke's haskell.sty is broken and I couldn't find the file at his new home (www.acooke.org/andrew/).
I just appended the old filname to the new hostname, and behold, there it was: http://www.acooke.org/jara/pancito/haskell.sty Yours, Florian.

Florian Hars wrote:
François Bédard wrote:
The link to Andrew Cooke's haskell.sty is broken and I couldn't find the file at his new home (www.acooke.org/andrew/).
I just appended the old filname to the new hostname, and behold, there it was:
http://www.acooke.org/jara/pancito/haskell.sty
Yours, Florian.
Well, that's very devious of you, Florian ;) I must say I did try that, but I didn't try removing the "andrew" part; I also tried the search engine on the site plus looking in every corner, but there you go, putting my searching abilities to shame ;) I'm now submerged in options, but that's much better than having none... Thanks, François
participants (3)
-
Andrew Rock
-
Florian Hars
-
François Bédard