tabular: fix insertion of separator before 'cont
Use 'cont before a 'cont cell instead of adding a separator.
This commit is contained in:
parent
0ea9922784
commit
e0a14fa28d
|
@ -265,7 +265,9 @@ If @racket[sep] is not @racket[#f], it is inserted as a new column
|
||||||
between every column in the table; note that any
|
between every column in the table; note that any
|
||||||
@racket[table-columns] or @racket[table-cells] property in
|
@racket[table-columns] or @racket[table-cells] property in
|
||||||
@racket[style] must take the added columns into account. Otherwise,
|
@racket[style] must take the added columns into account. Otherwise,
|
||||||
the default style places no space between table columns.
|
the default style places no space between table columns. When @racket[sep]
|
||||||
|
would be placed before a @racket['cont], a @racket['cont] is inserted,
|
||||||
|
instead.
|
||||||
|
|
||||||
The @racket[column-properties], @racket[row-properties], and
|
The @racket[column-properties], @racket[row-properties], and
|
||||||
@racket[cell-properties] arguments specify @tech{style properties} for
|
@racket[cell-properties] arguments specify @tech{style properties} for
|
||||||
|
@ -324,7 +326,9 @@ properties will be used from the merger into @racket[table-cells].}
|
||||||
|
|
||||||
@history[#:changed "1.1" @elem{Added the @racket[#:column-properties],
|
@history[#:changed "1.1" @elem{Added the @racket[#:column-properties],
|
||||||
@racket[#:row-properties],
|
@racket[#:row-properties],
|
||||||
and @racket[#:cell-properties] arguments.}]
|
and @racket[#:cell-properties] arguments.}
|
||||||
|
#:changed "1.12" @elem{Changed @racket[sep] insertion before a
|
||||||
|
@racket['cont].}]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
@codeblock[#:keep-lang-line? #f]|{
|
@codeblock[#:keep-lang-line? #f]|{
|
||||||
|
|
|
@ -24,4 +24,4 @@
|
||||||
|
|
||||||
(define pkg-authors '(mflatt eli))
|
(define pkg-authors '(mflatt eli))
|
||||||
|
|
||||||
(define version "1.11")
|
(define version "1.12")
|
||||||
|
|
|
@ -554,10 +554,21 @@
|
||||||
[else (make-paragraph plain cell)]))
|
[else (make-paragraph plain cell)]))
|
||||||
(define l (map cvt row))
|
(define l (map cvt row))
|
||||||
(if sep
|
(if sep
|
||||||
(add-between l (cvt sep))
|
(add-between/cont l (cvt sep))
|
||||||
l))
|
l))
|
||||||
cells)))
|
cells)))
|
||||||
|
|
||||||
|
;; Like `add-between`, but change `sep` to 'cont when
|
||||||
|
;; adding before a 'cont:
|
||||||
|
(define (add-between/cont l sep)
|
||||||
|
(cond
|
||||||
|
[(null? l) null]
|
||||||
|
[(null? (cdr l)) l]
|
||||||
|
[else
|
||||||
|
(list* (car l)
|
||||||
|
(if (eq? 'cont (cadr l)) 'cont sep)
|
||||||
|
(add-between/cont (cdr l) sep))]))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
|
|
|
@ -18,3 +18,7 @@
|
||||||
#:sep "-"
|
#:sep "-"
|
||||||
(list (list "A" "B" "C" "D")
|
(list (list "A" "B" "C" "D")
|
||||||
(list "apple" "banana" "coconut" "donut")))
|
(list "apple" "banana" "coconut" "donut")))
|
||||||
|
|
||||||
|
@(tabular #:sep "-"
|
||||||
|
(list (list "A" 'cont "C" 'cont 'cont)
|
||||||
|
(list "apple" "banana" "coconut" "donut" "eclair")))
|
||||||
|
|
|
@ -7,3 +7,6 @@ a -b -c -d
|
||||||
|
|
||||||
A- B -C -D
|
A- B -C -D
|
||||||
apple-banana-coconut-donut
|
apple-banana-coconut-donut
|
||||||
|
|
||||||
|
A -C
|
||||||
|
apple-banana-coconut-donut-eclair
|
||||||
|
|
Loading…
Reference in New Issue
Block a user