# Creating a custom songbook with the songs package

Friends, I usually create songbooks with the help of songs package (I guess the CTAN version is a little old, the newest one can be downloaded from here). Consider the follow example (taken from the author's webpage):

\documentclass[letterpaper]{article}
%\usepackage[chorded]{songs}
\usepackage[lyric]{songs}

\newindex{titleidx}{cbtitle}

\begin{document}

\begin{songs}{titleidx}

\beginsong{Amazing Grace}[
by={John Newton},
sr={Luke 15:4; 2 Corinthians 4:8,9; Ephesians 2:8; Revelation 14:3},
cr={Public domain.}]

\beginverse
A\[E]mazing \[E/D#]grace! How \[A/C#]sweet the \[E/B]sound
That \[E]saved a \[E/C#]wretch like \[B7]me!
I \[E]once was \[E/D#]lost, but \[A/C#]now am \[E/B]found;
Was \[A]blind, but \[A/B]now I \[E]see.
\endverse

\beginverse
T'was ^grace that ^taught my ^heart to ^fear,
And ^grace my ^fears re^lieved;
How ^precious ^did that ^grace ap^pear
The ^hour I ^first be^lieved!
\endverse

\endsong

\end{songs}

\end{document}


The output is according to the parameter provided in \usepackage[<<type of songbook>>]{songs}:

I always use the chorded parameter for musicians and the lyric one for the rest of the audience. As you can see in the code, using the ^ symbol will make the other verses repeat the chords in those positions. Most of the songs have the same melody, so I'd love to save some space and spare some trees by putting the chords in the first verse and leaving the other verses untouched, like this:

\beginverse
A\[E]mazing \[E/D#]grace! How \[A/C#]sweet the \[E/B]sound
That \[E]saved a \[E/C#]wretch like \[B7]me!
I \[E]once was \[E/D#]lost, but \[A/C#]now am \[E/B]found;
Was \[A]blind, but \[A/B]now I \[E]see.
\endverse

\beginverse
T'was grace that taught my heart to fear,
And grace my fears relieved;
How precious did that grace appear
The hour I first believed!
\endverse

\endsong


Sadly, the chorded output still preserves the spaces between lines:

My idea was something like this: when chords were provided, display them like the chorded option, otherwise keep the lyric one. This is the output I'd like to obtain:

I read the songs documentation but could not find any references on how to mix chorded and lyrics styles the way I want. I'd like to stick with the songs package, as it has great index features and since I have already a book with thousands of songs. Of course, if not possible, I'm open to other suggestions on packages. =)

-
Nice package and I didn't know it. Thank you for mentioning it. –  Gonzalo Medina Jun 3 '11 at 19:21
@Gonzalo: it's a nice package indeed. Glad you like it. =) –  Paulo Cereda Jun 3 '11 at 19:53

One possible solution would be to use \singlespacing from the setspace package:

\documentclass[letterpaper]{article}
\usepackage[chorded]{songs}
\usepackage{setspace}

\newindex{titleidx}{cbtitle}

\begin{document}

\begin{songs}{titleidx}

\beginsong{Amazing Grace}[
by={John Newton},
sr={Luke 15:4; 2 Corinthians 4:8,9; Ephesians 2:8; Revelation 14:3},
cr={Public domain.}]

\beginverse
A\[E]mazing \[E/D#]grace! How \[A/C#]sweet the \[E/B]sound
That \[E]saved a \[E/C#]wretch like \[B7]me!
I \[E]once was \[E/D#]lost, but \[A/C#]now am \[E/B]found;
Was \[A]blind, but \[A/B]now I \[E]see.
\endverse

\beginverse\singlespacing
T'was grace that taught my heart to fear,
And grace my fears relieved;
How precious did that grace appear
The hour I first believed!
\endverse

\endsong

\end{songs}

\end{document}


EDIT: the songs package offers a native solution: the \baselineadj length controls the vertical distance between the baselines of consecutive lines of lyrics; so a redefinition of this length will also do the job (without loading extra packages):

\documentclass[letterpaper]{article}
\usepackage[chorded]{songs}

\newindex{titleidx}{cbtitle}

\begin{document}

\begin{songs}{titleidx}

\beginsong{Amazing Grace}[
by={John Newton},
sr={Luke 15:4; 2 Corinthians 4:8,9; Ephesians 2:8; Revelation 14:3},
cr={Public domain.}]

\beginverse
A\[E]mazing \[E/D#]grace! How \[A/C#]sweet the \[E/B]sound
That \[E]saved a \[E/C#]wretch like \[B7]me!
I \[E]once was \[E/D#]lost, but \[A/C#]now am \[E/B]found;
Was \[A]blind, but \[A/B]now I \[E]see.
\endverse

\beginverse
T'was grace that taught my heart to fear,
And grace my fears relieved;
How precious did that grace appear
The hour I first believed!
\endverse

\endsong

\end{songs}

\end{document}

-
Thanks a million, Gonzalo! This is a very straightforward and elegant solution, exactly what I was looking for! =) –  Paulo Cereda Jun 3 '11 at 19:50
@Paulo Cereda: I've updated my answer adding another solution which doesn't involve any new packages. –  Gonzalo Medina Jun 3 '11 at 21:06
I was unaware of that length. Thanks for the update! –  Paulo Cereda Jun 3 '11 at 21:12

The intended solution offered by the songs package is to use the \chordsoff and \chordson macros to turn chord-spacing on and off as needed to designate which verses/choruses are chorded and which are not. After \chordsoff, lines are single-spaced; and after \chordson, they are double-spaced.

Note that if your songs are in a master file that gets loaded into multiple book types (both chorded and non-chorded), then you will probably want to create your own conditional macros for this similar to the following:

\ifchorded
\newcommand{\stopchords}{\chordsoff}
\newcommand{\resumechords}{\chordson}
\else
\newcommand{\stopchords}{}
\newcommand{\resumechords}{}
\fi


Then you can use \stopchords and \resumechords instead of \chordsoff and \chordson to affect the chord book's line-spacing without affecting the lyric-only books.

Although one can globally modify \baselineadj to force single-spacing of all lines not containing chords (e.g., by writing something like "\baselineadj=-14pt"), this has the potential disadvantage of single-spacing even lines within a chorded verse that happen to not contain a chord. This can be visually confusing to some musicians. Compare the following two outputs, the first of which uses the \baselineadj approach and the second of which uses \chordson and \chordsoff:

-
Hello Kevin, welcome to TeX.sx!! Thanks for your awesome answer, it's great to see you are around. Make yourself at home! :) –  Paulo Cereda Apr 12 '13 at 11:36
Thanks, Paulo! Saw that there were was a growing pool of questions here about my (increasingly voluminous) songs package and thought I might be able to help. –  Kevin Hamlen Apr 12 '13 at 16:42