From 66c4c50f47969677a8d5e8220caa57120916fad7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 27 Feb 2020 13:49:08 -0700 Subject: [PATCH] add `table-row-skip` to `latex-properties` --- scribble-doc/scribblings/scribble/core.scrbl | 11 +++++++++++ scribble-lib/info.rkt | 2 +- scribble-lib/scribble/latex-properties.rkt | 3 ++- scribble-lib/scribble/latex-render.rkt | 7 ++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/scribble-doc/scribblings/scribble/core.scrbl b/scribble-doc/scribblings/scribble/core.scrbl index 95b05936..6309ec6a 100644 --- 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 index befc200e..32eeca65 100644 --- 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 index 3160a473..97c3eab7 100644 --- 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 index b1c966da..68cb1399 100644 --- 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))]