Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Syntaxe Caml en LaTeX
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-05-29 (23:26)
From: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] Syntaxe Caml en LaTeX
On Sun, 29 May 2005, Pierre-Etienne Meunier wrote:

> Bonjour,
> Je voudrais savoir s'il y a un moyen d'intégrer les couleurs de syntaxe
> Caml (comme avec tuareg dans emacs) dans une page LaTeX, pour rendre le
> code présentable.
> Amicalement,
> Pierre-Etienne Meunier (
> Here comes the english version :
> I'd like to include Caml code in a LaTeX file, but since it is pretty
> big, I want it to be easily readable. Then I want to keep the colored
> syntax, like in tuareg for emacs. Do you know how to do it ?
> Best regards,
> Pierre-Etienne Meunier (

I don't know what people have used so far (you can ask Jon Harrop what he
used for his book

One solution would be to adapt Caml2html
You can either (1) start an independent Caml2latex library/executable and
reuse some code from Caml2html, or (2) make Caml2html polyglot.
IMO solution (1) is better than (2) since the OCaml parser does not
require a lot of maintenance as opposed to the formatting options which
are not really reusable anyway.

Otherwise, you can convert your program to colorized PostScript with
enscript (ask Janne Hellsten, google for "ocaml and enscript") or directly
from emacs.


Martin Jambon, PhD