haskell.sty
François Bédard
bedard@info.uqam.ca
Tue, 09 Jul 2002 23:23:29 -0400
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 environme=
nt
>>
>> \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