I am writing a songbook and I would like to insert guitar chord diagrams in the appropriate positions above the lyrics of each verse. I have found the musixguit
package capable of drawing nice diagrams which I would like to include in my songbook (showing fret numbering for barre chords and possibly tabular notation of the chord) but I am not able to position them in accordance with the lyrics.
\documentclass{article}
\usepackage{musixguit}
\begin{document}
\raiseguitar {14}
\NOtes\guitar {Cm $^7$}{2}x-----\gbarre1\gdot33\gdot52
\guitar G{}o-----\gbarre3\gdot25\gdot35\gdot44\en
*Lyrics of the first *verse...
\end{document}
How to place the diagrams above their intended positions (denoted by asterisks)? Would it be possible to define a new command for in-line insertion of predefined chords into the appropriate positions in lyrics like in the following example?
\chord{Cm7}Lyrics of the first \chord{G}verse...
Thank you.
Best Answer
The chords only have to be defined via
\guitarchord
once, and can be reutilized as needed. Rather that using\raiseguitar
to set the vertical position, I use\setstackgap{L}{<baselinekip of stack>}
to do so.EDITED to address deficiencies noted by OP. Macros to use include
and
where the optional argument is used if the chord text is shorter than the chord width. Note two lengths specified in the MWE that allow adjustments in alignment and minimum chord spacing.
RE-EDITED to provide optional syntax that some may find preferable:
Here is the MWE:
While I don't recommend it because of potential danger, the OP followed up asking if the
#
character (and things like parentheses) could be incorporated into chord names. To do so, I make#
catcode 11, and employ a lot of\csname
nomenclature.Here is such a version: