dtsmarin <dts_mari...@yahoo.com> writes: > Hello, > > How can I create a function such as: \Rpad #2 which will control the padding > of a text spanner? > > It's only for reducing my code's size since using the \override blah blah > takes a lot of space if used many times! > To be absolutely clear this will not used for common things that work well > but for a custom spanner that needs tweaking every time I use it so having a > shorter command made sense to me. > > Here is a template: > Rpad = #(define-music-function (parser location %??% ) (number?) > #{ > ..... %%%% > #}) > triggered by: > > \Rpad #2 > > I hope this can be achieved relatively easy.
With 2.19.35 or so you can use Rpad = \override Staff.TextSpanner.padding = \etc (or whatever you are overriding) and then use \Rpad #2 Of course, you can also write Rpad = #(define-music-function (parser location arg) (number?) #{ \override Staff.TextSpanner.padding = #arg #}) and this has the slight advantage that \Rpad will check right away for "arg" being a number and possibly coerce it to one (well, if you are overriding with a callback or with #f this might actually be a nuisance). The version with \etc is just passing the argument as-is. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user