This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.
If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.
SLaTeX is a wrapper program for LaTeX which typesets blocks of Scheme and Lisp code listings.
Dorai Sitaram, ported to CHICKEN and packaged as an egg by Peter Bex
This egg provides a library as well as a program. Most people will only need the 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:
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.
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:
- 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.
- Common Lisp The Language keyword definitions.
- Chicken-specific keyword definitions. All macros in core Chicken will be recognised by this style file.
The library can be loaded as usual:
It provides the following procedures:
- process-main-tex-file FILENAMEprocedure
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.
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.
- set-tex-search-path! PATHprocedure
Set the search path. PATH can be either a Unix pathstring (paths separated by colons) or a list of strings that represent filesystem paths.
- 20090928.1 Convert deprecated getenv calls to get-environment-variable so it works with new Chicken versions (thanks to Christian Kellermann).
- 20090928.0 Initial release
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.