caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Caml code listing inside LaTeX
@ 2007-06-22 19:07 Philippe Wang
  0 siblings, 0 replies; only message in thread
From: Philippe Wang @ 2007-06-22 19:07 UTC (permalink / raw)
  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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-22 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-22 19:07 Caml code listing inside LaTeX Philippe Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).