# kleemans.ch

## Guitar songbook with LaTeX

March 7, 2022

There was a time in my life when I used LaTeX for everything.

The logo in all its beauty.

Besides the obvious - papers & scripts - I also did my homework with LaTeX, game compendiums, course notes, presentations, tutoring exercises, exposees, surveys, CVs, cheat sheets and many more.

A collection of fancy graphs (extracted mainly from course notes) can be found in this blog post.

One project which I only found recently when digging through old files caught my attention - a guitar songbook in LaTeX!

I had totally forgotten and when I discovered it, I had a good laugh and thought I should do a write-up. So here we are :-)

You can download the songbook with 8 songs here.

### Creating a song book ...with LaTeX

Most of the time, a simple guitar song to play along to consists of two parts: lyrics and chords. (Sometimes also short riffs are helpful, see last paragraph.)

With LaTeX, it's possible to add chords directly to words - or more precise, to syllables - so they would "stick" to them, and you wouldn't actually have to care about aligning lines of chords with text (as mostly they're just on different lines).

With the package songbook, it was actually quite simple to start: Just add install the package and add a header to your document for different version of songbooks, and you're good to go. It would support only text, text with chords or a base layout called Overhead Transparency edition - no idea what that was :-)

Here are the different headers:

\documentclass[12pt]{book}
\usepackage{latexsym,fancyhdr}
\usepackage[compactsong,chordbk]{songbook}  %% Words & Chords edition.
%%\usepackage[wordbk]{songbook}  %% Words Only edition.
%%\usepackage[overhead]{songbook}  %% Overhead Transparency edition.

I checked out the package on CTAN and the last update seems to be from 2010, so I wasn't sure if it would still work.

To check, I created a new project on Overleaf, my favorite "LaaS" (LaTeX as a service, so no local installation is needed), and to my suprise, the original file from 2008 still compiles with the latest versions. If you're interested, you can download the file here.

Here's how (part of) and actual song looks like:

\begin{SBOpGroup}
\Ch{C}{How} many \Ch{F}{roads} must a \Ch{C}{man} walk \Ch{Am}{down},

\Ch{C}{before} you can \Ch{F}{call} him a \Ch{G7}{man}?

\Ch{C}{How} many \Ch{F}{seas} must a \Ch{C}{white} dove \Ch{Am}{sail},

\Ch{C}{before} she \Ch{F}{sleeps} in the \Ch{G7}{sand}?

And \Ch{C}{how} many \Ch{F}{times} must the \Ch{C}{can}onballs \Ch{Am}{fly,}

\Ch{C}{before} they're  \Ch{F}{for}ever \Ch{G}{banned}?
\newline
\end{SBOpGroup}

Which gets then rendered to this:

I remember having some custom fonts because I didn't like the defaults.

The output is clean as always, quite nice-looking, customizable and the chords would stick to the correct part of the lyrics.

### Aftermath

There were multiple reasons why the approach did not stick.

The most obvious was that layouting the songs was quite time-consuming, and I kept piling up drafts and copy-paste documents with songs I was playing without ever transforming them into LaTeX.

Also, every time a new song should be added, I would have to do the typesetting, then print a single page, and then add that page to the collection of pages. I wouldn't ever be able to print a casebound-like booklet or somthing similar, and that also kept me from using the system.

Another reason was that adding chords or passages with single notes was not supported (or at least I couldn't find out how). So sometimes a song would have a nice riff which couldn't be added in pure LaTeX, and some kind of picture would invalidate the reason to use LaTeX in the first place.

I now like to keep my songs in a big notebook, which is perfect for when I'm occasionally playing on my guitar.

Thanks for reading!