From a9141a3c3d37ec836cdcf21e500d717985375997 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 15 Feb 2013 21:52:09 -0600 Subject: [PATCH] =?UTF-8?q?add=20in=20the=20rest=20of=20the=20double=20bar?= =?UTF-8?q?red=20chars=20(=E2=95=AC=20and=20company)=20and=20adjust=20the?= =?UTF-8?q?=20existing=20ones=20a=20little?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit original commit: d5ffb1e3c01e5f280bafc6e69c2c3eb0f30622ca --- collects/scribble/latex-render.rkt | 151 +++++++++++++++-------------- 1 file changed, 78 insertions(+), 73 deletions(-) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index d34c4e3a..90662d25 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -1055,7 +1055,8 @@ (define (combine . args) (apply string-append "\\setlength{\\unitlength}{0.05em}" - (filter (λ (x) (not (regexp-match #rx"^[ \n]*$" x))) args))) + (filter (λ (x) (not (regexp-match #rx"^[ \n]*$" x))) + (flatten args)))) (define (adjust % v) (define num (* % (/ v 10) 10)) (define i-part (floor num)) @@ -1063,79 +1064,83 @@ (format "~a.~a" i-part d-part)) (define (x v) (adjust 1 v)) (define (y v) (adjust 6/4 v)) + (define upper-horizontal @list{\put(@x[0],@y[6]){\line(1,0){@x[10]}}}) + (define lower-horizontal @list{\put(@x[0],@y[4]){\line(1,0){@x[10]}}}) + (define righter-vertical @list{\put(@x[6],@y[10]){\line(0,-1){@y[10]}}}) + (define lefter-vertical @list{\put(@x[4],@y[10]){\line(0,-1){@y[10]}}}) + (define bottom-right @list{\put(@x[6],@y[4]){\line(1,0){@x[4]}} + \put(@x[6],@y[0]){\line(0,1){@y[4]}}}) + (define bottom-left @list{\put(@x[0],@y[4]){\line(1,0){@x[4]}} + \put(@x[4],@y[0]){\line(0,1){@y[4]}}}) + (define upper-right @list{\put(@x[6],@y[6]){\line(1,0){@x[4]}} + \put(@x[6],@y[10]){\line(0,-1){@y[4]}}}) + (define upper-left @list{\put(@x[0],@y[6]){\line(1,0){@x[4]}} + \put(@x[4],@y[10]){\line(0,-1){@y[4]}}}) + (define header @list{\begin{picture}(@x[10],@y[10])(0,0)}) + (define footer @list{\end{picture}}) + (case c - [(#\╔) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[4],@y[6]){\line(1,0){@x[6]}} - \put(@x[6],@y[4]){\line(1,0){@x[6]}} - \put(@x[4],@y[0]){\line(0,1){@y[6]}} - \put(@x[6],@y[0]){\line(0,1){@y[4]}} - \end{picture}}] - [(#\═) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[0],@y[6]){\line(1,0){@x[10]}} - \put(@x[0],@y[4]){\line(1,0){@x[10]}} - \end{picture}}] - [(#\╦) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[0],@y[6]){\line(1,0){@x[10]}} - \put(@x[0],@y[4]){\line(1,0){@x[4]}} - \put(@x[4],@y[0]){\line(0,1){@y[4]}} - \put(@x[6],@y[0]){\line(0,1){@y[4]}} - \put(@x[6],@y[4]){\line(1,0){@x[4]}} - \end{picture}}] - [(#\╩) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[0],@y[4]){\line(1,0){@x[10]}} - \put(@x[0],@y[6]){\line(1,0){@x[4]}} - \put(@x[4],@y[6]){\line(0,1){@y[4]}} - \put(@x[6],@y[6]){\line(0,1){@y[4]}} - \put(@x[6],@y[6]){\line(1,0){@x[4]}} - \end{picture}}] - [(#\╣) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[6],@y[0]){\line(0,1){@y[10]}} - \put(@x[4],@y[0]){\line(0,1){@y[4]}} - \put(@x[0],@y[4]){\line(1,0){@x[4]}} - \put(@x[0],@y[6]){\line(1,0){@x[4]}} - \put(@x[4],@y[6]){\line(0,1){@y[4]}} - \end{picture}}] - [(#\╠) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[4],@y[0]){\line(0,1){@y[10]}} - \put(@x[6],@y[0]){\line(0,1){@y[4]}} - \put(@x[6],@y[4]){\line(1,0){@x[4]}} - \put(@x[6],@y[6]){\line(1,0){@x[4]}} - \put(@x[6],@y[6]){\line(0,1){@y[4]}} - \end{picture}}] - [(#\╬) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[4],@y[0]){\line(0,1){@y[4]}} - \put(@x[0],@y[4]){\line(1,0){@x[4]}} - \put(@x[0],@y[6]){\line(1,0){@x[4]}} - \put(@x[4],@y[6]){\line(0,1){@y[4]}} - \put(@x[6],@y[0]){\line(0,1){@y[4]}} - \put(@x[6],@y[4]){\line(1,0){@x[4]}} - \put(@x[6],@y[6]){\line(1,0){@x[4]}} - \put(@x[6],@y[6]){\line(0,1){@y[4]}} - \end{picture}}] - [(#\╗) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[0],@y[6]){\line(1,0){@x[6]}} - \put(@x[0],@y[4]){\line(1,0){@x[4]}} - \put(@x[6],@y[0]){\line(0,1){@y[6]}} - \put(@x[4],@y[0]){\line(0,1){@y[4]}} - \end{picture}}] - [(#\║) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[4],@y[10]){\line(0,-1){@y[10]}} - \put(@x[6],@y[10]){\line(0,-1){@y[10]}} - \end{picture}}] - [(#\╚) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[4],@y[4]){\line(1,0){@x[6]}} - \put(@x[6],@y[6]){\line(1,0){@x[4]}} - \put(@x[4],@y[10]){\line(0,-1){@y[6]}} - \put(@x[6],@y[10]){\line(0,-1){@y[4]}} - \end{picture}}] - [(#\╝) @combine{\begin{picture}(@x[10],@y[10])(0,0) - \put(@x[0],@y[4]){\line(1,0){@x[6]}} - \put(@x[0],@y[6]){\line(1,0){@x[4]}} - \put(@x[4],@y[10]){\line(0,-1){@y[4]}} - \put(@x[6],@y[10]){\line(0,-1){@y[6]}} - \end{picture}}])) - - + [(#\╔) + @combine{@header + \put(@x[4],@y[6]){\line(1,0){@x[6]}} + \put(@x[4],@y[0]){\line(0,1){@y[6]}} + @bottom-right + @footer}] + [(#\═) @combine{@header + @upper-horizontal + @lower-horizontal + @footer}] + [(#\╗) @combine{@header + \put(@x[0],@y[6]){\line(1,0){@x[6]}} + \put(@x[6],@y[0]){\line(0,1){@y[6]}} + @bottom-left + @footer}] + [(#\║) @combine{@header + @lefter-vertical + @righter-vertical + @footer}] + [(#\╚) @combine{@header + @upper-right + \put(@x[4],@y[4]){\line(1,0){@x[6]}} + \put(@x[4],@y[10]){\line(0,-1){@y[6]}} + @footer}] + [(#\╝) + @combine{@header + @upper-left + \put(@x[0],@y[4]){\line(1,0){@x[6]}} + \put(@x[6],@y[10]){\line(0,-1){@y[6]}} + @footer}] + [(#\╣) + @combine{@header + @upper-left + @bottom-left + @righter-vertical + @footer}] + [(#\╠) + @combine{@header + @upper-right + @bottom-right + @lefter-vertical + @footer}] + [(#\╩) + @combine{@header + @upper-right + @upper-left + @lower-horizontal + @footer}] + [(#\╦) + @combine{@header + @bottom-right + @bottom-left + @upper-horizontal + @footer}] + [(#\╬) + @combine{@header + @upper-left + @bottom-left + @upper-right + @bottom-right + @footer}])) ;; ----------------------------------------