remove `keep-all-lines`

main
Matthew Butterick 4 years ago
parent 04b3b32a36
commit 7f2979ad22

@ -575,11 +575,10 @@ Vertical space added around a block. Value is a @tech{dimension string}.
}
@deftogether[(@defthing[#:kind "attribute" keep-first-lines symbol?]
@defthing[#:kind "attribute" keep-last-lines symbol?]
@defthing[#:kind "attribute" keep-all-lines symbol?])]{
How many lines of the quad are kept together near a page break. @racket[keep-first-lines] sets the minimum number of lines that appear before a page break; @racket[keep-last-lines] sets the minimum number that appear after. In both cases, they take a non-negative integer string as a value.
@defthing[#:kind "attribute" keep-last-lines symbol?])]{
How many lines of the quad are kept together near a page break. @racket[keep-first-lines] sets the minimum number of lines that appear before a page break; @racket[keep-last-lines] sets the minimum number that appear after. In both cases, they take a non-negative integer string as a value, or @racket["all"].
@racket[keep-all-lines] keeps all the lines of a quad on the same page. Activated only when value is @racket["true"]. Be careful with this option — it's possible to make a single quad that is longer than one page, in which case @racketmodname[quadwriter] will ignore the setting to prevent an impossible situation.
If the value (of one or both attributes) is @racket["all"], then all the lines of the quad are kept the same page. Be careful with this option — it's possible to make a single quad that is longer than one page, in which case @racketmodname[quadwriter] will ignore the setting to prevent an impossible situation.
}
@defthing[#:kind "attribute" keep-with-next symbol?]{

@ -596,16 +596,16 @@
(define idx (add1 idx0))
;; always catch last line of block in this case
;; so later cases are guaranteed to have earlier lines.
(define keep-first (quad-ref ln :keep-first-lines))
(define keep-last (quad-ref ln :keep-last-lines))
(unless (eq? idx group-len)
(when (or
;; if we have :keep-all we can skip :keep-first and :keep-last cases
(quad-ref ln :keep-all-lines)
;; if we have keep all we can skip :keep-first and :keep-last cases
(or (equal? keep-first "all") (equal? keep-last "all"))
;; to keep n lines, we only paint the first n - 1
;; (because each nobr line sticks to the next)
(let ([keep-first (quad-ref ln :keep-first-lines)])
(and (number? keep-first) (< idx keep-first)))
(let ([keep-last (quad-ref ln :keep-last-lines)])
(and (number? keep-last) (< (- group-len keep-last) idx))))
(and (number? keep-first) (< idx keep-first))
(and (number? keep-last) (< (- group-len keep-last) idx)))
(make-nobreak! ln)))
(cons ln reversed-lines)))

@ -68,7 +68,7 @@
:inset-bottom "8"
:inset-left "30"
:inset-right "30"
:keep-all-lines "yes")
:keep-first-lines "all")
attrs) exprs))
(define id (default-tag-function 'id))

Loading…
Cancel
Save