The extract-code tool
page in Romanian courtesy of azoft
The extract-code tool takes an source file annotated with special
comment forms and extracts LaTeX files that can be used in a document.
The generated LaTeX uses the
Currently, it supports both SML and Moby source files, but it
is easy to extend to other languages.
The tool can also produce HTML files in a form suitable for inclusion
in a LaTeX document being processed by
The extract-code tool is distributed in source form
as a gzipped tar file
It was last modified on May 17, 2014; see the CHANGES
file in the distribution for more information.
You can also get the source via anonymous svn using the command
% svn co --username anonsvn \
The password is anonsvn.
To install extract-code, you must have
SML/NJ installed on your machine and in your PATH.
Assuming that this is the case, then installation
For example, to build and install the system /usr, one
would use the following commands:
- Configure the installation by running the
You can set the installation directory by using the
--prefix option (the default is
- Build the system using the build make target.
- Install the system using the install make target.
% ./configure --prefix=/usr
After running these commands, /usr/bin would hold the
% make build
% make install
extract-code options files
where options are taken from the following:
- -lang language
Use language as the input language.
Currently, the following languages are supported:
||.sml and .sig
Generate HeVeA as the output format (this is the default).
Output files will have a .hva suffix.
Generate LaTeX as the output format (this is the default).
Output files will have a .tex suffix.
Generate text files with formatting comments stripped.
Strip the formatting comments from the source files; for
an input file foo, the stripped output will be in
Formattting commands are written as comments in the source
These comments must start in the first column of their line.
Here are the commands and their descriptions:
- (*@FILE attributes files *)
open the list of files for extracted output with the
specified attibutes (attributes are
either @LEFT, @CENTER)
- (*@BEGIN files *)
start directing output to the list of files
(these files are called active).
- (*@END files *)
stop directing output to the list of files;
if files is empty, then all active files are stoped.
- (*@BEGIN-ELLIPSE *)
- (*@END-ELLIPSE *)
- suspend/resume output to the currently active files.
- suspend/resume highlighting the output to the current files. Currently,
highlighting is represented by underlining.
- (*@IF-FILE files *)
- (*@ELIF-FILE files *)
- (*@ELSE *)
- (*@END-IF *)
- ... stuff ...
insert the stuff into the currently active files.
treat the token as a keyword. This markup is not supported for all
Last modified: May 28, 2014.
Comments to: John Reppy