For version 0.7.0.
To top.

The Shapes language compiler

This page corresponds to the man page shapes(1), dated 2016-02-06.
Note: The examples here may be presented using characters that may not be available in the man page format. Hence, the examples may be presented differently in the man page.


shapes — Compile a Shapes source to pdf.


shapes option* source
shapes option*
shapes ( options | file-request )*
shapes --help


shapes compiles a source file written in the Shapes language, with filename suffix .shape (shape mode) or .blank (blank mode). On success and unless in blank mode, this results in a pdf file (or a directory of files) containing a viewable representation of the graphics described by the source.

Command line options

Command line options fall into two cathegories, most of which were referred to as option above. The others, found in the last subsection below, are used to request which files would be used under given circumstances, and will cause the compiler to terminate without processing any files, these options were referred to as file-request above.
Options for setting or clearing flags are written as one entity, ending with =bool, where bool can be any of: yes, true, on, no, false, off.


Tolerances and other parameters




Shapes can launch xpdf or invoke the MacOS open command to show the resulting graphics. In a future version, it may be possible to specify an arbitrary command to be issued, which could look like this:
shapes --viewer 'open -a TeXShop %' myfile.shape

User level debugging

Compiler developer debugging

Garbage collection

In the end, when garbage collection is implemented, there will be options for controlling the gc behavior here. At the moment, there is only a dummy option here.

File requests

Several file requests may be issued. The answer to each will be written on a separate line on stdout, in the order of the requests. After having answered to all requests, the program exits without compiling any input. If the output filename is undefined in the presence of file requests, a dummy name will be used.

Environment variables

Exit codes


Basic use

Suppose there is a source called hi.shape in the current working directory. Then there are three ways to specify this file to the compiler. One may give the full filename:
  shapes hi.shape
or just to the point your shell completion will take you:
  shapes hi.
or exclude the suffix altogether:
  shapes hi

Use with xpdf

To use the xpdf program for preview, the previous example can be extended as:
  shapes --xpdf hi.shape

Use with stdin

The following can be used to generate a small pdf-label from a LaTeX string, without littering the current working directory with the LaTeX-related files:
echo '[TeX `$x^{2}$´]' | shapes --tmpdir /tmp --out label.pdf

The test suite

When testing the compiler on the bundled tests, the compiler is invoked something like this:
shapes --resources=no --needpath ../../resources/extensions/ --fontmetricspath ../../resources/fontmetrics/ \
       --tmpdir tmp/ --outdir out/ hello.shape
The first three options ensure that extension files and font metrics are not used from a previous installation. This example assumes that environment variables are not used to provide search paths.


Most of the code was written by Henrik Tidefelt. Portability and distribution was provided by Gustaf Hendeby.

See also

xpdf(1) open(1)
Get Shapes at Fast, secure and Free Open Source software downloads