Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Caml code listing inside LaTeX

233 views
Skip to first unread message

Philippe Wang

unread,
Jun 22, 2007, 3:08:49 PM6/22/07
to ocaml ml
Hi,

If ever you are interested in putting some caml code inside your latex
document, *without* using verbatim environment or listings package,

the online tool :
http://philippewang.info/cs.tools.camltotex.php (*)

takes some caml code and returns LaTeX code.

The applied treatments are :
- colors
- nested comments (even with strings such as "*)" inside) are detected
- based on LaTeX macros such as
\DeclareTextSymbol{\BS}{T1}{92} % backslash
\newcommand{\mlkeyword}[1]{\mbox{\color{red}{#1}}}
- the code is put in a tabular environment


Well, it's very small : 300 lines of code for the moment (about 230
lines of ocamllex and 30 lines of ocaml...).

It could have certainly been written in camlp4 or in latex, but well,
they are not (yet) my cup of tea.

Hopefully, it will be released under a free license next month (if you
are interested in this program, which license do you want ?)

The main goals are :
- no use of verbatim, so that it can be used with beamer without the
[fragile] option
- no use of the listings package (because it don't like it)

It certainly contains bugs, it was never proved or certified, and
probably never will be...

Cheers,

--
Philippe Wang
mail[at]philippewang.info


(*) I used php because cgi in pure caml is very complicated on the
hosting server

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

0 new messages