slatex

  1. slatex
    1. Description
    2. Author
    3. Requirements
    4. Documentation
      1. Program
      2. Styles
      3. Library
    5. Changelog
    6. License

Description

SLaTeX is a wrapper program for LaTeX which typesets blocks of Scheme and Lisp code listings.

Author

Dorai Sitaram, ported to CHICKEN and packaged as an egg by Peter Bex

Requirements

None

Documentation

This egg provides a library as well as a program. Most people will only need the program.

Program

SLaTeX can be invoked as follows:

 slatex [OPTION ...] FILE[.tex] [COMMAND ...]

The commandline syntax is identical to that of LaTeX (or TeX), and everything but the main TeX file argument is ignored by SLaTeX and passed on verbatim to the LaTeX program.

SLaTeX will detect whether the input file is a plain TeX file or a LaTeX file by analysing the first command it finds. If it's a LaTeX command (documentstyle, documentclass or NeedsTeXFormat), it will call the latex program on the file, otherwise it will call tex. Comments and non-command text are safely skipped.

You will also need to use the SLaTeX package in your LaTeX sources:

 \usepackage{slatex-chicken}

The above also loads instructions for highlighting Chicken-specific macros. See the "Styles" section below for more information.

For information about the TeX commands that are available from SLaTeX, please refer to the official documentation.

Styles

SLaTeX provides style files which you will need to import in your TeX or LaTeX document to make use of SLaTeX. These files are installed by this egg in a location which is automatically added to TeX's search path by the slatex wrapper program so you can just \usepackage them. If for some reason it cannot be found, please add it to your TEXINPUTS. It can be found under share/chicken/slatex/ under Chicken's installed prefix.

The style files are:

slatex.sty
The main SLaTeX engine. Include this if you only want basic Scheme highlighting. The style files below include this one, so you won't need to include this yourself unless you want only basic highlighting.
cltl.sty
Common Lisp The Language keyword definitions.
slatex-chicken.sty
Chicken-specific keyword definitions. All macros in core Chicken will be recognised by this style file.

Library

The library can be loaded as usual:

(use slatex)

It provides the following procedures:

[procedure] (process-main-tex-file FILENAME)

This procedure will extract all the Scheme code blocks from your TeX files and create fully typeset TeX files from them. These files are written to the current directory and generally named .Z[Z]jobname.tex where jobname is the name of the TeX file being processed. It will generate temporary files named .Z[Z]jobname.scm, which should be removed during processing. The slatex.sty file knows how to find these files and pull them in to replace the raw source code blocks.

The FILENAME argument is the file of the main TeX source file which includes all the others (in short, it's the same one you would provide on the commandline for the latex command). The extension is optional; a .tex will automatically be appended if missing.

[procedure] (tex-search-path)

This returns a list of the directories in the path which SLaTeX will search during the code extraction phase (initiated by process-main-tex-file). It is advisable to keep this the same as the actual search path used by LaTeX as it processes the file again so that any files in the search path which define new Scheme keywords get picked up properly.

[procedure] (set-tex-search-path! PATH)

Set the search path. PATH can be either a Unix pathstring (paths separated by colons) or a list of strings that represent filesystem paths.

Changelog

License

 Copyright (c) 1990-2002, Dorai Sitaram.
 All rights reserved.
 
 Permission to distribute and use this work for any
 purpose is hereby granted provided this copyright
 notice is included in the copy.  This work is provided
 as is, with no warranty of any kind.