caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Syntaxe Caml en LaTeX
Date: Mon, 30 May 2005 11:40:10 +0100	[thread overview]
Message-ID: <200505301140.11135.jon@ffconsultancy.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0505291556580.2556-100000@localhost>

On Monday 30 May 2005 00:25, Martin Jambon wrote:
> On Sun, 29 May 2005, 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 ?
>
> I don't know what people have used so far (you can ask Jon Harrop what he
> used for his book
> http://www.ffconsultancy.com/products/ocaml_for_scientists/).

I wrote a little program to color syntax-highlight LyX files by treating 
anything in typewriter font as code. This has several advantages - no need to 
annotate by hand, code can be extracted and even tested, easy to alter the 
document self-consistently and so on.

I chose to put all code snippets on their own minipage, to help lay them out 
aesthetically. However, LaTeX does a poor job of distributing them on the 
page, so any alterations to the document need to be carefully checked to make 
sure the LaTeX output hasn't become very ugly (e.g. huge gaps).

I think the solution I used works reasonably well but there is plenty of room 
for improvement. Ideally, I'd like to get rid of LaTeX...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


  reply	other threads:[~2005-05-30 10:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-29 11:52 Pierre-Etienne Meunier
2005-05-29 23:25 ` [Caml-list] " Martin Jambon
2005-05-30 10:40   ` Jon Harrop [this message]
2005-05-31 19:56   ` ocaml + enscript (was Re: [Caml-list] Syntaxe Caml en LaTeX) Janne Hellsten
2005-05-29 23:49 ` [Caml-list] Syntaxe Caml en LaTeX Chris Campbell
2005-05-30  2:01 ` Robert Roessler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200505301140.11135.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).