How To Use GPPWith La Te X

XT -- A Bundle of Program Transformation Tools
Task

How to use pretty-printed documents in LaTeX.

Description

The back-end abox2latex produces LaTeX code according to the formatting defined in a Box term. In order to process this LaTeX code by latex, the `boxenv' style file is required.

The location of this style file depends on your GPP installation but abox2latex includes a comment section in the generated LaTeX code that tells you where to find the style file.

A generated LaTeX file can be incorporated in a larger LaTeX document as follows:

  1. Determine the location of the boxenv style file by inspecting the comments at the beginning of example.tex.

  1. Add this location to your TEXINPUTS environment variable.

  1. Add `\usepackage{boxenv}' to the preamble of main.tex.

  1. Import the generated LaTeX file using `\input'.

  1. Process the file by latex.

The paper http://www.cs.uu.nl/groups/ST/twiki/bin/view/Merijn/PaperALaTeXStyleFileForFormattingBOXExpressions contains detailed information about the boxenv style file and its use.

Examples

The location of boxenv.sty can be appended to your TEXINPUTS environment variable as follows:

For Bourne shells # TEXINPUTS=<boxenv.sty location>:${TEXINPUTS}; export TEXINPUTS

For C shells # set TEXINPUTS=<boxenv.sty location>:${TEXINPUTS}; setenv TEXINPUTS

Assuming that the generated LaTeX code is stored in the file example.tex, then a typical LaTeX document that includes the file example.tex looks like:

\documentstyle{aricle} \usepackage{boxenv}

\begin{document} \input{example.tex} \enddocument}

See Also

GenericPrettyPrinter, HowToPrettyPrintAGrammar, AboxToLaTex