Simon Albrecht <simon.albre...@mail.de> writes:

> Dear list,
>
> I have encountered some unexpected behaviour with tags and
> tagGroups. In the following example, I thought the two staffs should
> look the same, even without the \removeWithTag command, but they
> don’t:
>
> %%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.23.5"
> % tested with 2.23.5 (guile2-build) and 2.22.0
>
> \tagGroup sol,mi
> \tagGroup withCClefs,noCClefs
>
> \keepWithTag mi,noCClefs
> %\removeWithTag withCClefs
> <<
>   {
>     \tag mi,withCClefs \clef alto
>     1
>     \tag mi,noCClefs \clef bass
>     1
>   }
>   {
>     \tag withCClefs \clef alto
>     1
>     \tag noCClefs \clef bass
>     1
>   }
>>>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
> How come the other tagGroup interferes? Is this a bug?

‘\keepWithTag’ [music] - TAGS (symbol list or symbol) MUSIC (music)
     Include only elements of MUSIC that are tagged with one of the tags
     in TAGS.  TAGS may be either a single symbol or a list of symbols.

     Each tag may be declared as a member of at most one tag group
     (defined with ‘\tagGroup’).  If none of a MUSIC element’s tags
     share a tag group with one of the specified TAGS, the element is
     retained.

Essentially, \keepWithTag #'a \keepWithTag #'b is not the same as
the more inclusive \keepWithTag #'(a b) even when a and b are from
different tag groups.  That is in line with this documentation that is
close to the implementation.  Whether this is in line with sensible
expectations of what \tagGroup should achieve, I am not sure.

I do think that I have at times described the effect of \tagGroup as
making \keepWithTag #'(a b) equivalent to
\keepWithTag #'a \keepWithTag #'b when a and b belong to different tag
groups: that would point to even my expectations being more in line with
yours than with what the implementation does.

-- 
David Kastrup

Reply via email to