On Sat, 20 Apr 2024, David Olson wrote:

> I'm a lyric poet writing songs about science.
>
> "CO2" is three syllables and often works better than "carbon dioxide".
>
> It's acceptable even if "2" doesn't appear as a subscript (one sees this
> usage frequently), but subscript would be cool. 
>
> A superscript option would be cool too.

Easy enough to do using \markup and \sub, as in:

<<
  \new Voice = melody { c'2 c'2 | c'4 bes4 f'2 | }
  \new Lyrics \lyricsto melody { \lyricmode {
    "ooh!" "ooh!" C O \markup { \sub { "2" } "!" }
  } }
>>

There are a number of variations possible:  \super for superscript,
\normal-size-sub for subscript without making the font smaller (which
might be easier to read even if it's not standard chemistry usage), and so
on.  In general, you can just break into \markup and use any of the usual
markup commands.  See "Formatting text" in the Notation manual:
   https://lilypond.org/doc/v2.24/Documentation/notation/formatting-text

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Reply via email to