From c571d7f8818dd9b382f9d27036321f7d3211d7e6 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 25 Feb 2009 18:27:16 +0000 Subject: [PATCH] add #lang scribble/manual; change latex table rendering to use a smaller minipage for multiple columns of non-para/table cell flows svn: r13839 original commit: 0321cad60e6311ed1881327ddccb94949871216c --- collects/scribble/latex-render.ss | 11 +++++++---- collects/scribble/manual/lang.ss | 4 ++++ collects/scribble/manual/lang/reader.ss | 10 ++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 collects/scribble/manual/lang.ss create mode 100644 collects/scribble/manual/lang/reader.ss diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss index d79d5027..e0e47988 100644 --- a/collects/scribble/latex-render.ss +++ b/collects/scribble/latex-render.ss @@ -259,7 +259,10 @@ (and m (equal? "bigtabular" (car m)) (= 1 (length (car (table-flowss (cadr m))))))))] - [boxline "{\\setlength{\\unitlength}{\\linewidth}\\begin{picture}(1,0)\\put(0,0){\\line(1,0){1}}\\end{picture}}"]) + [boxline "{\\setlength{\\unitlength}{\\linewidth}\\begin{picture}(1,0)\\put(0,0){\\line(1,0){1}}\\end{picture}}"] + [twidth (if (null? (table-flowss t)) + 1 + (length (car (table-flowss t))))]) (unless (or (null? flowss) (null? (car flowss))) (parameterize ([current-table-mode (if inline? (current-table-mode) (list tableform t))] @@ -306,7 +309,7 @@ (loop (cdr flows) (add1 n))] [else n]))]) (unless (= cnt 1) (printf "\\multicolumn{~a}{l}{" cnt)) - (render-table-flow (car flows) part ri) + (render-table-flow (car flows) part ri twidth) (unless (= cnt 1) (printf "}")) (unless (null? (list-tail flows cnt)) (printf " &\n")))) (unless (null? (cdr flows)) (loop (cdr flows))))) @@ -321,7 +324,7 @@ tableform))))) null) - (define/private (render-table-flow p part ri) + (define/private (render-table-flow p part ri twidth) ;; Emit a \\ between blocks: (let loop ([ps (flow-paragraphs p)]) (cond @@ -330,7 +333,7 @@ (let ([minipage? (not (or (paragraph? (car ps)) (table? (car ps))))]) (when minipage? - (printf "\\begin{minipage}{\\linewidth}\n")) + (printf "\\begin{minipage}{~a\\linewidth}\n" (/ 1.0 twidth))) (render-block (car ps) part ri #f) (when minipage? (printf " \\end{minipage}\n")) diff --git a/collects/scribble/manual/lang.ss b/collects/scribble/manual/lang.ss new file mode 100644 index 00000000..f3aa8bcb --- /dev/null +++ b/collects/scribble/manual/lang.ss @@ -0,0 +1,4 @@ +#lang scheme +(require scribble/doclang scribble/manual) +(provide (all-from-out scribble/doclang + scribble/manual)) diff --git a/collects/scribble/manual/lang/reader.ss b/collects/scribble/manual/lang/reader.ss new file mode 100644 index 00000000..45fc9380 --- /dev/null +++ b/collects/scribble/manual/lang/reader.ss @@ -0,0 +1,10 @@ +#lang s-exp syntax/module-reader + +scribble/manual/lang + +#:read scribble:read-inside +#:read-syntax scribble:read-syntax-inside +#:whole-body-readers? #t +#:wrapper1 (lambda (t) (list* 'doc '() (t))) + +(require (prefix-in scribble: "../../reader.ss"))