From: form@pyuxe.UUCP Subject: Re: Put something above a word ? Newsgroups: comp.text.tex Date: 1991-03-22 01:26:29 PST |
I've just been writing a set of macros to produce a songbook (lyrics and chords). The macro to place chords above lyrics is (in LaTeX notation): \newcommand{\Ch}[2]{\vbox{\hbox{ }\hbox{bf{#1}}\hbox{#2}}} Paramater: 1 - chord to be set; 2 - sylable over which chord is to be right justified. The rationale behind the macro is: A chord is normally attached to a syllable or syllables. A chords placement has musical/timing significance. Hence the design. I force the chords bold so that they're more easily read. As it stands the macro has one bug: When the macro is the first character in a paragraph, it forces a newline after the syllable. Christopher Rath 613-594-3026
From: R o d
Johnson (rcj@caen.engin.umich.edu) Subject: Re: Put something above a word ? Newsgroups: comp.text.tex Date: 1991-03-22 13:17:07 PST |
In article <1139@pyuxe.UUCP> form@pyuxe.UUCP (71133-Christopher Rath) writes: >I've just been writing a set of macros to produce a songbook (lyrics and >chords). The macro to place chords above lyrics is (in LaTeX notation): > > \newcommand{\Ch}[2]{\vbox{\hbox{ }\hbox{bf{#1}}\hbox{#2}}} > > Paramater: 1 - chord to be set; > 2 - sylable over which chord is to be right justified. . . . >As it stands the macro has one bug: When the macro is the first character in >a paragraph, it forces a newline after the syllable. I think you need to put a \leavevmode in there somewhere to avoid this. As it stands, the macro has another, if not bug, undesirable feature. If your #2 has no ascenders (e.g., the word "one") the chord is going to be lower than it is over words with ascenders. You need to put a \strut in both \hboxes to forestall this. A properly defined strut will make the first \hbox{ } unnecessary as well. -- Rod Johnson * rjohnson@vela.acs.oakland.edu * (313) 650 2315 "House, bridge, well, gate, jug, olive tree, window" --Rilke