English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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

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