2014-09-11 11:17 GMT+02:00 Jayaratna <[email protected]>:
> Dear lilyexperts,,
>
> is there a function for a fraction without a separation line to be used in
> \markup?
>
> Something like:
> \markup { \fractionwithnohline 21 5 }
>
>
> Thank you,
> A
#(define-markup-command (fraction-with-no-line layout props arg1 arg2)
(markup? markup?)
#:category other
#:properties ((font-size 0))
(let* ((m1 (interpret-markup layout props arg1))
(m2 (interpret-markup layout props arg2))
(factor (magstep font-size))
(padding (* factor 0.2))
(baseline (* factor 0.6))
(offset (* factor 0.75)))
(set! m1 (ly:stencil-aligned-to m1 X CENTER))
(set! m2 (ly:stencil-aligned-to m2 X CENTER))
(let* ((stack (stack-lines DOWN padding baseline (list m1 m2))))
(set! stack
(ly:stencil-aligned-to stack Y CENTER))
(set! stack
(ly:stencil-aligned-to stack X LEFT))
;; should have EX dimension
;; empirical anyway
(ly:stencil-translate-axis stack offset Y))))
\markup { \fraction-with-no-line 21 5 }
Though, why not use \center-column with adjusted baseline-skip, etc?
Cheers,
Harm
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user