[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fraction with no line
From: |
Thomas Morley |
Subject: |
Re: Fraction with no line |
Date: |
Thu, 11 Sep 2014 12:19:27 +0200 |
2014-09-11 11:17 GMT+02:00 Jayaratna <address@hidden>:
> 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