*Task* How to pretty-print a grammar. *Description* A grammar can be pretty-printed (to plain text, html, or latex) using the GPP package in the following way: 1. Parse the grammar. 1. Feed the resulting parse tree to the pretty-print front-end [[AsFixToAbox][asfix2abox]]. 1. Feed the resulting [[BoxLanguage][Box]] expression to one of the pretty-print back-ends: [[AboxToText][abox2text]], [[AboxToHtml][abox2html]], or [[AboxToLaTex][abox2latex]]. Alternatively, a grammar can be pretty-printed using the [[AstToAbox][ast2abox]] tool: 1. Parse the grammar. 1. Implode the resulting parse tree to an AST. 1. Feed the AST to the pretty-print front-end [[AstToAbox][ast2abox]] 1. Feed the resulting BOX expression to one of the pretty-print back-ends: [[AboxToText][abox2text]], [[AboxToHtml][abox2html]], or [[AboxToLaTex][abox2latex]]. *Examples* Assuming G.tbl is the parse table for a grammar of language L and G.pp is the corresponding pretty-print table. A term T.sdf over langauge L can be pretty-printed to text, html and latex in the following way: # sglr -2 -p G.tbl -i T.sdf -o T.asfix # implode-asfix -i T.asfix -o T.af # ast2abox -p G.pp -i T.af -o T.sdf.abox # abox2text -i T.sdf.abox -o T.sdf.text # abox2html -i T.sdf.abox -o T.sdf.html # abox2latex -i T.sdf.abox -o T.sdf.tex The file T.sdf.tex can be included in a latex document, which has the following package statement in its preamble: \usepackage{boxenv} In the file T.sdf.tex you can read where to find the file _boxenv.sty_ (See HowToUseGPPWithLaTeX). *See also* GenericPrettyPrinter, HowToUseGPPWithLaTeX