caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* LaTeX  listings and (o)caml
@ 1999-11-05 16:04 Vincent Poirriez
  1999-11-06 11:16 ` Christian Lindig
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Poirriez @ 1999-11-05 16:04 UTC (permalink / raw)
  To: caml-list

Bonjour,

 avant que je m'y mette, quelqu'un a-t-il fait une "définition"
 des langages caml pour etre utilisée avec le package listings de latex?

 Cela permettrait d'avoir facilement du code joli dans des transparents
 ou des articles.

Hello

 before I start the work, does someone have designed a "definition" of
 the caml languages to be used with the package listings of LaTeX?
 This should provide an easy way to have nice formatted code in slides
  and articles.

Vincent Poirriez

-----
Vincent.Poirriez@univ-valenciennes.fr






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: LaTeX  listings and (o)caml
  1999-11-05 16:04 LaTeX listings and (o)caml Vincent Poirriez
@ 1999-11-06 11:16 ` Christian Lindig
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Lindig @ 1999-11-06 11:16 UTC (permalink / raw)
  To: Vincent Poirriez; +Cc: Caml Mailing List

On Fri, Nov 05, 1999 at 04:04:19PM +0000, Vincent Poirriez wrote:

> before I start the work, does someone have designed a "definition"
> of the caml languages to be used with the package listings of LaTeX? 
> This should provide an easy way to have nice formatted code in
> slides

I don't know about the package listing of LaTeX but have written a
tool that marks up OCaml code for HTML, XML, Vile, and Lout.  It has a
modular design, so adding a new LaTeX backend takes less than 100
lines of code.  The tool recognizes comments, strings, keywords,
operators, etc by scanning an OCaml source and permits the backend to
format them.  All other parts of a source file pass untouched.  The
man page is attached below -- mail me for the code if you are
interested.  I think a similar tool was announced on this list some
time ago.

-- Christian


-- 
 Christian Lindig       Gaertner Datensysteme GbR, Braunschweig,  Germany 
                        http://www.gaertner.de/~lindig lindig@gaertner.de
                        phone: +49 531 233 55 55   fax: +49 531 233 55 56 

NAME
    ocamldoc - markup Objective Caml source ocde

SYNOPSIS
    ocamldoc [ *format* ] [ *file* ]

    ocamldoc -help

    ocamldoc -version

DESCRIPTION
    ocamldoc reads an Objective Caml (see ocaml(1)) source file and
    pretty prints it accordingly to *format*. Pretty printing is
    done by highlighting keywords, comments, operators, and literals
    in the source; all other parts of the source pass untouched. The
    OCaml source is read from *file* or *stdin*; output goes to
    *stdout*. Please note, that ocamldoc does not reformat the
    source code like indent(1) does for C code. It only marks up
    some syntactic classes inside the code.

OPTIONS
    -html [ -title *title* ]
        The OCaml source is prepared for HTML. When a *title* is
        specified a standalone HTML file is generated. Without the -
        title flag code is embedded into a <pre> element but the
        mandatory outer structure of a HTML document is missing.
        The -title flag can be abbreviated as -t. Highlighting is
        not hard coded into the output but achieved through
        Cascading Style Sheets (CSS): each syntactical element is
        embedded into a <span> element with an additional class
        attribute denoting its syntactical class. For example:

            let hello = "hello"

        becomes (without the line breakes):

            <span class='keyword'>let</span> hello <span
            class='operator'>=</span> 
            <span class='strlit'>"hello"</span>

        The class attributes are matched by CSS rules which define
        the actual appearance of the code. A sample CSS file comes
        with the distribution. A standalone HTML page points to a
        CSS file ocaml.css in the actual directory.

    -xml [ -title *title* ]
        The formatting for XML works very much like the formatting
        for HTML. With a given *title* a standalone XML document is
        generated; the outermost element is <src> with a title
        attribute. The code inside this element is exactly like when
        formatting for HTML.

    -vile
        Highlighting for the Vile editor vi(1). Syntax highlighting
        in Vile is done by external filters like this. See the Vile
        documentation for the format. This version of ocamldoc works
        with Vile 8.3.

        When the ocamldoc binary is called under the name vile-
        ocaml-filt and without a format option it formats the input
        also for Vile. This feature makes ocamldoc compliant to the
        Vile filter naming scheme.

    -lout
        Source code is marked up for the Basser Lout document
        formatter and a Lout package camlprint provided by Basile
        Starynkevitch.

    -ascii
        The input is not marked up at all. This serves mainly as a
        test case for the internal scanner of ocamldoc.

    -version
        Reports the current version of ocamldoc to stdout.

    -help
        Prints a summary of command line options to stderr.

RETURN VALUE
    ocamldoc returns 1 in case of an error and 0 on success.

SEE ALSO
    ocaml(1)

AUTHOR
    Christian Lindig, lindig@gaertner.de,
    http://www.gaertner.de/~lindig



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-07 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-05 16:04 LaTeX listings and (o)caml Vincent Poirriez
1999-11-06 11:16 ` Christian Lindig

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).