2 % Some utilities for formatting (extended) lambda calculus and
6 \startuniqueMPgraphic{box}
8 % Create a rectangle of the full size
9 a := unitsquare xyscaled(\overlaywidth,\overlayheight);
11 b := a randomized (\overlaywidth / 25) ;
13 drawoptions (withpen pencircle scaled .75mm withcolor black) ;
17 \defineoverlay[box][\uniqueMPgraphic{box}]
19 % Define \{start,stop}boxed with a nice metapost box around it.
20 \defineframedtext[boxed][background=box,frame=off]
21 % A boxed variant with the width forced to page width. This is used in
22 % \startrans, since the content somehow doesn't scale the box around it
24 \defineframedtext[wideboxed][background=box,frame=off,width=\textwidth,offset=.02\textwidth]
26 % Install the lambda calculus pretty-printer, as defined in pret-lam.lua.
27 \installprettytype [LAM] [LAM]
28 % Define \startlambda \stoplambda
29 \definetyping[lambda][option=LAM,style=sans,before=\startboxed,after=\stopboxed]
31 % Define \lam{} (since \lambda is taken)
32 \definetype[lam][option=LAM,style=sans]
34 % Install the transformation pretty-printer, as defined in pret-trans.lua.
35 \installprettytype [TRANS] [TRANS]
36 % Define \starttrans \stoptrans
37 \definetyping[trans][option=TRANS,style=normal,before=\startwideboxed,after=\stopwideboxed]
39 % Install the haskell pretty-printer, as defined in pret-haskell.lua.
40 \installprettytype [HASKELL] [HASKELL]
41 % Define \starthaskell \stophaskell
42 \definetyping[haskell][option=HASKELL,before=\startboxed,after=\stopboxed]
44 \definetype[hs][option=HASKELL,style=mono]