<< | Page list | >>
Layout for the documentclass songbook
The Songbook [rath.ca] style by Christopher Rath allows you to typeset songs with chords in LaTeX. I've created some files so that you can use this more easily within LyX.
See these screenshots:
Below is an image of only the part of the LyX-window with a verse in it and the icon you can click on to add a chord.
These are the installation notes for the documentclass Songbook and corresponding LyX files.
Download and install the Songbook-package:
- You can do a full installation of Songbook by downloading one of the following archives (about 1 MB):
Songbook-4.0.tar.gz is just a repackaged version of
SongbookRelease-4.0.tar.gz that I created since the latter archive didn't extract to a subdirectory (very annoying).
If you only need a minimal installation (without any documentation!), just download uploads:/Layouts/Songbook/songbook.sty and uploads:/Layouts/Songbook/conditionals.sty.
- Install the LaTeX package by copying the files
conditionals.sty to somewhere where LaTeX (and LyX) can find them. This can for instance be in the catalog where you are going to work, or in a catalog specified by the environment variable $TEXINPUTS.
Download and install the LyX-files
- Download uploads:/Layouts/Songbook/Songbook_lyx.tar.gz and extract it either in your personal .lyx-directory, or to where the shared LyX-files are installed (e.g. /usr/local/share/lyx). This directory will be referred to as LYX from now on.
- Reconfigure LyX and check that LyX has found the songbook package, e.g. if you enter this at the command line:
lyx -x reconfigure
+checking for document class songbook [book]... yes
- then one of the output lines should look like this
Now you can restart LyX and open a document based on the template
LYX/templates/songbook.lyx. You should also be able to build and
view this file as DVI. Finally, you might want to have a look at the
Keyboard bindings and icons
Additionally, you may want to use the keyboard binding and icon.
- To use the keyboard binding, either copy the first lines of the file
LYX/bind/myCUA.bind to whatever bind-file you are using, or set LyX to use this bind-file. Instead of copying the lines manually into the file it is also possible to use the LyX configuration dialog: Go to Tools -> Settings -> Edit -> Shortcuts, click new, select a key and enter the macro found in the binding file. If the macro does not work as expected, you can try using "command-sequence math-mode; char-forward; line-end-select; cut; math-insert \Ch; char-backward; char-backward; paste; char-forward;" instead.
- To use the icon, either copy the second last line from the file
LYX/ui/songbook.ui to whatever ui-file you are using, or set Lyx to use this ui-file.
Note : For more recent versions of LyX, the above command sequence should read (see also http://wiki.lyx.org/Tips/CommandSequences#toc7)
"command-sequence math-mode; char-forward; word-forward-select; math-insert \Ch\ ; inset-toggle; line-end; char-forward; math-insert *; inset-toggle; char-backward-select;"
- I have not implemented all the features of the songbook package. For instance, I have not included the possibility of exporting the songbook with or without chords. This ought to be easy though.
- Oops... turns out that renaming \Ch to \Chord etc afterwards wasn't such a great idea since for instance \ChX (now called \ChordX) calls \Ch ... which will call my new macro command defined in LyX instead... sigh... this means that the order of the arguments to \ChordX needs to be swapped.