optimize link area in toc
This commit is contained in:
parent
e4b65aafcb
commit
7b97e04fab
@ -161,16 +161,13 @@
|
||||
(markup #:override (cons 'baseline-skip 3.5) (if catname (make-left-column-markup (string-split (cadr catname) #\newline)) category)))))
|
||||
|
||||
#(define-markup-command (index-item-with-pattern layout props)()
|
||||
(let (
|
||||
(let* (
|
||||
(text (chain-assoc-get 'index:text props))
|
||||
(page (chain-assoc-get 'index:page props))
|
||||
(width (-
|
||||
(chain-assoc-get 'line-width props)
|
||||
(interval-length (ly:stencil-extent (interpret-markup layout props "XXXX") X))))
|
||||
)
|
||||
(interpret-markup layout props
|
||||
(make-column-markup
|
||||
(let ((revlist
|
||||
(lines-reversed
|
||||
(if (markup? text)
|
||||
(list text)
|
||||
(reverse (map (lambda (stil) (markup #:stencil stil))
|
||||
@ -179,17 +176,25 @@
|
||||
(list (cons 'line-width width) (cons 'font-shape 'italic))
|
||||
(list (cons 'line-width width))) props) #f
|
||||
(chain-assoc-get 'rawtext text))))))
|
||||
(target-size-markup
|
||||
(last-line-with-dots (make-fill-with-pattern-markup 1 RIGHT "." (car lines-reversed) page))
|
||||
(lines-without-dots (cdr lines-reversed))
|
||||
(target-line-size-markup
|
||||
(make-column-markup
|
||||
(list
|
||||
(make-simple-markup "Agj")
|
||||
(make-vspace-markup 0.2))))
|
||||
)
|
||||
(reverse (map (lambda (m)
|
||||
(make-size-box-to-box-markup #f #t m target-size-markup))
|
||||
(cons
|
||||
(make-with-link-symbol-ref-markup 'index:label (make-fill-with-pattern-markup 1 RIGHT "." (car revlist) page))
|
||||
(cdr revlist)))))))))
|
||||
)
|
||||
(interpret-markup layout props
|
||||
(make-size-box-to-box-markup #f #t
|
||||
(make-with-link-symbol-ref-markup 'index:label
|
||||
(make-column-markup
|
||||
(reverse (cons
|
||||
last-line-with-dots
|
||||
(map (lambda (m) (make-size-box-to-box-markup #f #t m target-line-size-markup)) lines-without-dots)))))
|
||||
; this column is just to have a reference height for resizing
|
||||
(make-column-markup
|
||||
(reverse (map (lambda (m) (make-size-box-to-box-markup #f #t m target-line-size-markup)) (cons last-line-with-dots lines-without-dots))))
|
||||
))))
|
||||
|
||||
\paper {
|
||||
indexItemMarkup = \markup {
|
||||
|
Loading…
x
Reference in New Issue
Block a user