Jump to content

Forcing a clef symbol to be displayed: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
No edit summary
Line 15: Line 15:


[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Pitches]]
[[Category:Pitches]][[Category:Snippet]]

Revision as of 22:53, 21 November 2025

When a clef sign has already been displayed and it has not been changed to a different clef, then repeating the \clef command will be ignored by LilyPond, since it is not a change of clef. It is possible to force the clef to be redisplayed using the command \set Staff.forceClef = ##t.

\version "2.24"

\relative c' {
  \clef treble 
  c1
  \clef treble 
  c1   
  \set Staff.forceClef = ##t
  c1   
  \clef treble 
  c1   
}