Am Sa., 17. Okt. 2020 um 20:33 Uhr schrieb David Kastrup <d...@gnu.org>:
>
> Thomas Morley <thomasmorle...@gmail.com> writes:
>
> > Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra 
> > <j...@abou-samra.fr>:
> >>
> >> The point of interpret-markup is to turn a markup into a stencil, so I'd
> >> use empty-stencil:
> >>
> >> \version "2.20.0"
> >>
> >> #(define-markup-command (print-if-defined layout props sym text)
> >>                          (symbol? markup?)
> >>    (if (defined? sym)
> >>        (interpret-markup layout props
> >>          #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
> >>        empty-stencil))
> >>
> >> symA = "Something"
> >>
> >> \markup {
> >>    \print-if-defined #'symA "Text"
> >>    \print-if-defined #'symB "More text"
> >> }
> >>
> >
> > An empty stencil will still be spaced (unless removed by other
> > markup-commands).
>
> empty-stencil will typically not trigger additional spacing.  That's
> typically what distinguishes it from point-stencil .
>
> --
> David Kastrup

Well, I'd say it depends how that empty-stencil is consumed. See:

\markup
  \box
  { \stencil #point-stencil \stencil #empty-stencil \stencil #point-stencil }

Here I did something silly (of course there are warnings emitted) and
the output _is_ affected.

Thus, the detailed use-case is important...

Cheers,
  Harm

Reply via email to