commit 66c4c50f47969677a8d5e8220caa57120916fad7
parent ed02550d1a8a43873892bc8f4b63f33a0faaac0b
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 27 Feb 2020 13:49:08 -0700
add `table-row-skip` to `latex-properties`
Diffstat:
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/scribble-doc/scribblings/scribble/core.scrbl b/scribble-doc/scribblings/scribble/core.scrbl
@@ -1961,3 +1961,14 @@ arguments to the element's command in Latex output.}
@history[#:added "1.20"]
}
+
+@defstruct[table-row-skip ([amount string?])]{
+
+ Used as a @tech{style property} in @racket[table-cells] to specify a
+ spacing adjustment between the cell's row and the row afterward, such
+ as @racket["1ex"] to increase the space or @racket["-1ex"] to
+ decrease it. If multiple cells on a row provide this property, the
+ first one in the row is used.
+
+ @history[#:added "1.33"]
+}
diff --git a/scribble-lib/info.rkt b/scribble-lib/info.rkt
@@ -23,4 +23,4 @@
(define pkg-authors '(mflatt eli))
-(define version "1.32")
+(define version "1.33")
diff --git a/scribble-lib/scribble/latex-properties.rkt b/scribble-lib/scribble/latex-properties.rkt
@@ -12,4 +12,5 @@
([replacements (hash/c string? (or/c bytes? path-string? (cons/c 'collects (listof bytes?))))])]
[command-extras ([arguments (listof string?)])]
[command-optional ([arguments (listof string?)])]
- [short-title ([text (or/c string? #f)])])
+ [short-title ([text (or/c string? #f)])]
+ [table-row-skip ([amount string?])])
diff --git a/scribble-lib/scribble/latex-render.rkt b/scribble-lib/scribble/latex-render.rkt
@@ -836,7 +836,12 @@
(not (for/or ([cell-style (in-list cell-styles)])
(or (memq 'bottom-border (style-properties cell-style))
(memq 'border (style-properties cell-style)))))))
- (printf " \\\\\n"))
+ (let ([row-skip (for/or ([cell-style (in-list cell-styles)])
+ (for/or ([prop (style-properties cell-style)])
+ (and (table-row-skip? prop) prop)))])
+ (printf " \\\\~a\n" (if row-skip
+ (format "[~a]" (table-row-skip-amount row-skip))
+ ""))))
(cond
[(null? rest-blockss)
(unless index? (add-clines cell-styles #f))]