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: -- (:)
From: Chris Campbell <cyberdanx@g...>
Subject: Re: [Caml-list] Syntaxe Caml en LaTeX
On 29/05/05, Pierre-Etienne Meunier <> wrote:
> 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 (

You might consider using the listings package for latex.

I have not used it for OCaml code, but I think you can use


or something like that.

It supports small code snippets, larger snippets and separate files.

You can customise it to set the colours of keywords, symbols, etc.

\lstset{keywordstyle=\color{blue}, stringstyle=\color{green}}

It's all documented in the pdf inside the zip.

If it doesn't support of the current ocaml syntax, it's fairly easy to tweak