X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=pret-trans.lua;h=212c835ace52d0c7b026fc606dca6d336cba5ba1;hp=6ad51b74574768036e04200f2be9b0734f60a1b2;hb=4a7110a98633822b54a94f2333e6713b27aa9710;hpb=1687b8573daf7ee73241fa2651ac5bed07c10cdf diff --git a/pret-trans.lua b/pret-trans.lua index 6ad51b7..212c835 100644 --- a/pret-trans.lua +++ b/pret-trans.lua @@ -13,15 +13,15 @@ local vis = buffers.newvisualizer("trans") local commands = {} -- A command to create a horizontal rule. -commands.rule = "\\blackrule[height=0.5pt,depth=0pt,width=.45\\textwidth]" +commands.rule = "\\HLine[width=.40 * \\the\\textwidth]" -- Pretty printer to use for the stuff before and after the line commands.before_pret = "lam" commands.after_pret = "lam" -- Frame commands to use for the left (before + line + after) and right -- (conditions) parts. Should include an opening {, which will be closed -- automatically. -commands.leftframe = "\\framed[offset=0mm,location=middle,strut=no,align=right,frame=off,width=.5\\textwidth]{\\sans" -commands.rightframe = "\\framed[offset=0mm,location=middle,strut=no,align=right,frame=off,width=.5\\textwidth]{" +commands.leftframe = "\\framed[offset=0mm,location=middle,strut=no,align=right,frame=off,width=.48\\textwidth]{\\sans" +commands.rightframe = "\\framed[offset=0mm,location=middle,strut=no,align=right,frame=off,width=.48\\textwidth]{" -- A table to keep the lines in this buffer, so we can process them all at -- once at the end. @@ -63,6 +63,9 @@ end -- Capture all lines, without generating any output function vis.begin_of_display() lines = {} + -- Let all the lambda pretty printing in this buffer use shared subscript + -- detection + buffers.visualizers.handlers.lam.begin_of_block() end function vis.begin_of_line(n) -- Don't generate output here @@ -165,6 +168,7 @@ function vis.end_of_display() -- Clean up lines = {} + buffers.visualizers.handlers.lam.end_of_block() end -- vim: set sw=4 sts=4 expandtab ai: