The Song♭ook Package

Version 4.0

Christopher Rath

                       <Christopher@Rath.ca>

2002/01/02

Abstract This package provides an all purpose songbook style for L^{A}TEX2e. The

package allows for three types of output from a single input file: words and chords books for the musicians to play from, words only songbooks for the congregation to sing from, and overhead transparency masters for congregational use. The style will also print a table of contents, an index sorted by title and first line, and an index sorted by key. It attempts to handle songs in multiple keys, as well as songs in multiple languages.

Contents

I High Level Documentation 4

1 Description 4

2 Commands 5 2.1 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Primary Song♭ook Macros . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . 9 2.4 Ifthen Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.5 Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.6 Spacing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.7 String Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.8 Font Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.9 Deprecated Commands . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Usage Guidelines 14

4 Index/TOC Generation 15 4.1 Table of Contents Generation . . . . . . . . . . . . . . . . . . . . . 16 4.2 Title & First Line Index Generation . . . . . . . . . . . . . . . . . 16 4.3 Song Key Index Generation . . . . . . . . . . . . . . . . . . . . . . 16

5 Example 16

6 Dependencies 18

7 Files 18

8 See Also 19 8.1 Other Similar Packages . . . . . . . . . . . . . . . . . . . . . . . . 19

9 Bugs 19 10 Special Thanks 20

11 Author 20

12 .dtx Documentation Driver 21

II Detailed Documentation 22

13 Identification Part 22

14 Initial Code Part 22

14.1 If Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 14.1.1 Song♭ook Types . . . . . . . . . . . . . . . . . . . . . . . . 23 14.1.2 Song♭ook Subtypes . . . . . . . . . . . . . . . . . . . . . . . 23 14.1.3 Song Indicator . . . . . . . . . . . . . . . . . . . . . . . . . 23 14.1.4 Behaviour Flags . . . . . . . . . . . . . . . . . . . . . . . . 24 14.1.5 Papesize Indicators . . . . . . . . . . . . . . . . . . . . . . . 24

14.2 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 14.2.1 Chord Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 14.2.2 Title Block Fonts . . . . . . . . . . . . . . . . . . . . . . . . 25 14.2.3 Versicle Tag Fonts . . . . . . . . . . . . . . . . . . . . . . . 26 14.2.4 Marginal Notes Fonts . . . . . . . . . . . . . . . . . . . . . 26 14.2.5 Song Body Fonts . . . . . . . . . . . . . . . . . . . . . . . . 27 14.2.6 Other Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

14.3 Configurable Dimensions . . . . . . . . . . . . . . . . . . . . . . . . 27 14.3.1 Published Dimensions . . . . . . . . . . . . . . . . . . . . . 27 14.3.2 Internal Dimensions . . . . . . . . . . . . . . . . . . . . . . 29

14.4 Declaration Of Non-Core Options . . . . . . . . . . . . . . . . . . . 29 14.4.1 Papersize Options . . . . . . . . . . . . . . . . . . . . . . . 29 14.4.2 Compactsong Option . . . . . . . . . . . . . . . . . . . . . . 30

14.5 Declaration Of Core Options . . . . . . . . . . . . . . . . . . . . . 31 14.5.1 chordbk Option . . . . . . . . . . . . . . . . . . . . . . . . 31 14.5.2 wordbk Option . . . . . . . . . . . . . . . . . . . . . . . . . 34 14.5.3 overhead Option . . . . . . . . . . . . . . . . . . . . . . . . 36

14.6 Execution Of Options . . . . . . . . . . . . . . . . . . . . . . . . . 38 14.7 Package Loading Part . . . . . . . . . . . . . . . . . . . . . . . . . 38 14.8 Main Code Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

14.8.1 Constants & Variables . . . . . . . . . . . . . . . . . . . . . 39 14.8.2 Special Characters . . . . . . . . . . . . . . . . . . . . . . . 41 14.8.3 Table Of Contents & Indices . . . . . . . . . . . . . . . . . 42 14.8.4 Some Other Hooks . . . . . . . . . . . . . . . . . . . . . . . 44 14.8.5 Miscellaneous Macros . . . . . . . . . . . . . . . . . . . . . 45 14.8.6 Primary Songbook Macros . . . . . . . . . . . . . . . . . . 46 14.8.7 Obsolete Macros . . . . . . . . . . . . . . . . . . . . . . . . 58 14.8.8 Deprecated Macros . . . . . . . . . . . . . . . . . . . . . . . 58

Preface to version 4.0

What’s new in version 4.0:

• the Song♭ook style has now completed its transition to L^{A}TEX2e (I think): there is now a single .sty file which accepts options in order to invoke the different songbook styles. The Song♭ook style now also accepts and produces reasonable output for all of L^{A}TEX2e’s standard papersize options.

• the song title block (where the title, copyright info., etc. are listed) has been changed, use of the \centerline macro has been replaced with a center environment. This change is not compatible with previous versions of songbook.sty and requires you to re-verify all page breaks (mostly in words only mode). The reason for making the change is to allow long song titles to line-wrap (instead of hanging off the edge of the page), and this means that the definition of the following macros has been changed: \STitle, \CpyRt, \WAndM, and \ScriptRef. The centering of these lines is now also done within a center environment; in each the centering may now be disabled by adding an optional first parameter (any value except ‘Y’)

• since the change to the title block invalidated pagination of the previous version I have taken the opportunity to fine tune the value of \SpaceAfterSong, a value that is used primarily in wordsonly mode: the inter-song gap has

been decreased to \vspace{0ex plus10ex minus3ex} (from \vspace{0ex
plus15ex minus0ex})

• a new space command, \SpaceAfterTitleBlk, has been created to allow the space between a song’s title block and its versicles to be tuned by the user; this was a previously hardcoded value

• a bug in the SBBracket environment has been corrected: long lines were not always exhibiting their hanging indentation

• the style now supports all of L^{A}TEX2e’s standard papersizes. While the output will not be ideal for all papersizes, it does produce sane and usable results for all papersizes. I would be most appreciative if European users would send me page layout corrections for the A4, A5, and B5 sizes

• added a new environment, SBOpGroup (i.e., “an open group”), serves to group the lines of a verse or chorus together, but not indent or label them. Use of this environment allows for better control of font changes, proper indentation of wrapped lines, and automatic spacing of open groups which follow one another. I strongly suggest that SBOpGroup be used to enclose any set of lines which don’t otherwise end up in one of the songbook environments when typsetting with this package

• chordbk mode now supports one variation: compactsong. In compactsong mode the songs are laid out in two columns; note that the song title block spans the two columns. The songs are set in a smaller typeface to allow them to fit into the smaller space two column mode supplies. This mode should be considered experimental for the present time; see its description, below, for more details

• conditionals.sty has been updated with more current information and macros, as supplied by Donald Arseneau

• all of the verse-like environments now have their \baselineskip amount expressly calculated just prior to laying out their lines. This has been done in order to overcome the problem all previous versions of the songbook style had which was that linespacing differed based upon whether a particular line contained chords. Now all lines are spaced the same, regardless of whether they contain a chord. I consider the previous behaviour—where linespacing varied—to be a bug. If you really must retain the old behaviour this can be done by inserting the following code into the preamble of your document:

     \renewcommand{\sbSetsbBaselineSkipAmt}
       {\setlength{\sbBaselineSkipAmt} {\baselineskip}}

• the \SBDefaultFont command no longer needs to be specified at the top of each songbook • fixed a bug that was inhibiting the Song♭ook style from detecting blank and

empty song parameters

• the commands which had previously been listed as deprecated (i.e., to be removed in some future release) have all been removed

• the following commands have been moved from the “Obsolete Macros” section into “Deprecated Macros” section and will be removed in the next major release of the Song♭ook style: \False, \True, \ChordBk, \Overhead,

\SongEject, \WordBk, and \WordsOnly

A few minor changes were made during release testing of version 4.0. The following changes occured between version 4.0pre2 and 4.0:

• the spacing around the SBBracket environment has been tuned: \SpaceAfterSBBracket has been increased, and a new

\SpaceBeforeSBBracket amount has been added

• added missing space around the SBBracket* environment; using

\SpaceBeforeSBBracket and \SpaceAfterSBBracket

• removed unused length, \SBBracketHangAmt

• added a new \LeftMarginSBBracket length and rewrote the part of the SBBracket environment that creates the tag and left indents the versicle. The SBBracket environment now left aligns its words with those of the

SBVerse and SBChorus versicles.

Part I

High Level Documentation

1 Description

The Song♭ook document style provides a core set of functions for the production of songbooks. Three pre-defined songbook formats and one variation are provided (and they are invoked via options to the \usepackage{songbook} command) and they are typically used along with L^{A}TEX’s book class. One of the following options must be specified or the Song♭ook style will throw an error: chordbk, wordbk, or

overhead.

An empty minimal songbook looks like the following:

\documentclass{book}
\usepackage[chordbk]{songbook}
\begin{document}
\begin{song}{}{}{}{}{}{}
\end{song}
\end{document}

We’ll start by explaining the \usepackage[]{songbook} options:

chordbk chordbk a songbook suitable for musicians which gives both lyrics and words (this is the default mode of the Song♭ook document style)—one variation to this style is offered, compact song mode (see below). This option is specified

as \usepackage[chordbk]{songbook}

wordbk wordbk a words only songbook suitable for mass distribution to those singing but not playing an instrument. This option is specified as

\usepackage[wordbk]{songbook}

overhead overhead to produce overhead transparencies from songbook source files. This

option is specified as \usepackage[overhead]{songbook}

Other additional options supported by the Song♭ook style include all L^{A}TEX’s standard papersize options, and:

compactsong compactsong this option only takes effect along with chordbk. It causes the songs to be set in two columns, where the song title information spans the both columns. It is specified as

\usepackage[chordbk,compactsong]{songbook}

The version of compactsong provided in this release should be considered experimental! The formatting produced in this mode is not always desirable. An outstanding question to be answered is whether or not new songs title blocks should span both columns, and whether each song should generate a page break; in other words, should this feature set be implemented as two pieces: compactsong and compactbook. The idea would be to provide a compactsong environment, which could be judiciously used on a per song basis, and a compactbook mode which would result in a compressed songbook, where the words and chords book would look very much like a words only songbook (but with chords).

2 Commands

This section is broken into several subsections. Hopefully this makes the individual commands easier to understand by placing them in a meaningful context. Since some forward references exist, it may be necessary to read through the entire Commands section a couple of times before it makes complete sense.

This reference section will present terse command and environment descriptions; more detailed descriptions, along with examples, may be found in the implementation detail section at the bottom of this document.

Note that each subsection’s descriptions are presented in alphabetical order; while this doesn’t make the sections quite as easy to read, it makes them much more useful for reference purposes.

2.1 Environments

The Song♭ook style defines several new environments to make the formatting of songbooks easier and more consistent (and most of them have parameters). Unless otherwise noted, all of the environments are verse-like: wrapped lines are indented more than the first line is indented.

\begin{SBBracket}{⟨bracket tag⟩}⟨… stuff to enbracket… ⟩

SBBracket \end{SBBracket} is the environment used to mark certain lines of the song with a tag and bracket. An example usage is to mark the line of the song played to end the piece, if it is somehow different than the chords played if one were to repeat the song. For example:

          Be\Ch{Am}{cause} of \Ch{Dm7}{what} the...
       \end{SBChorus}
       \begin{SBBracket}{Ending}
          Give \Ch{F}{thanks,}\Ch{C/F}{} \Ch{Bb/F}{}...
       \end{SBBracket}

This is very similar to the SBOccurs environment, the difference being how the section of the song is marked.

SBBracket* There are two versions of this environment: SBBracket and SBBracket*.

They operate identically, except that the *ed version doesn’t print its tag and bracket in words only modes.

At present, \SBBracket and \SBBracket* are fragile and are not compatible with SBVerse, SBChorus, or any other environment; with the exception of the song environment.

SBChorus    \begin{SBChorus}⟨. . . the chorus. . . ⟩\end{SBChorus} is the environment to

wrap around a chorus that you wish to be indented and given a chorus tag (“Ch:”). A song with one verse and one chorus, where the chorus is sung after the verse would probably use the SBChorus environment. Whereas, if the chorus was sung first, an SBVerse environment would probably be used. The indent amount for lines that are too long is set by redefining the

\HangAmt command.

SBChorus* The SBChorus* version of this command indents but does not place a \SBChorusTag before the chorus.

SBExtraKeys    \begin{SBExtraKeys}{⟨song content⟩}\end{SBExtraKeys} is the environment

used when you wish to list the song again in another key. Typically, this environment is used along with an \STitle command. For example:

       \begin{SBExtraKeys}{
          \STitle{You Alone}{D}
          \begin{SBVerse}
             \Ch{D}{Ho}\Ch{F#m}{ly,} \Ch{G}{Ho}\Ch{D}{ly,}
             ...
          \end{SBVerse}
       }\end{SBExtraKeys}

SBOccurs    \begin{SBOccurs}{⟨the occurrence⟩}⟨. . . stuff to group. . . ⟩\end{SBOccurs} is

the environment used to mark a given line of the song with a tag and brackets. For example “1,3” would designate that this passage applies to the 1st and 3rd occurances. For example:

          Be\Ch{Am}{cause} of \Ch{Dm7}{what} the...
       \end{SBChorus}
       \begin{SBOccurs}{1,3}
          Give \Ch{F}{thanks,}\Ch{C/F}{} \Ch{Bb/F}{}...
       \end{SBOccurs}

SBOpGroup    \begin{SBOpGroup}⟨. . . stuff to group. . . ⟩\end{SBOpGroup} is the environment

in which unmarked versicles are placed; so called “open groups”.

SBSection    \begin{SBSection}⟨. . . the section. . . ⟩\end{SBSection} is very much like

L^{A}TEX’s verse environment, except that here the sections are numbered. The indent amount for lines that are too long is set using the \HangAmt command. This environment would be used in place of the \SBVerse environment for songs which are broken into pieces/sections, in place of, or in addition to, verses.

SBSection* The SBSection* version of this command indents but doesn’t place an \SBSectionCnt before the chorus. Similar to L^{A}TEX’s \section* command, the section counter is not incremented either.

SBVerse \begin{SBVerse}⟨… the chorus… ⟩\end{SBVerse} is the environment to wrap around a verse that you wish to be indented and given a verse number (\SBVerseCnt). A song with one chorus and one verse, where the verse is sung after the verse would probably use the SBChorus environment.

Whereas, if the chorus was sung first, an SBVerse environment would probably be used. The indent amount for lines that are too long is set with the

\HangAmt command.

SBVerse* The SBVerse* version of this environment indents but down not place an \SBVerseCnt before the chorus; similar to L^{A}TEX’s \section* command, the verse counter is not incremented either.

song \begin{song}{⟨1 ⟩} … {⟨6 ⟩} ⟨… the song… ⟩\end{song} is the environment which each song resides within. The parameter list is quite long, and is defined as:

1. Song title;

2. Key song is written in;

3. Copyright information;

4. Name(s) of composer and lyricist;

5. Scripture reference for the song;

6. Copyright licensing information.

The song environment takes care of making index entries, incrementing \SBSong-Cnt and page generation (if necessary). Note, this environment makes use of \every-par. See the Example section, below, for a sample one-song songbook document.

When the “copyright information” or “composer & lyricist” parameters are left empty then the string defined by the \SBUnknownTag macro used (instead of leaving whitespace in the song header.

xlatn \begin{xlatn}{⟨1 ⟩} … {⟨3 ⟩} ⟨… the translation… ⟩\end{xlatn}is the song translation environment. The parameter list is defined as:

1. Translated song title (in the foreign language);

2. Translation permission;

3. Who performed the translation.

The xlatn environment always occurs within a song environment; it resets the verse counter, causes the title and other parameter information to be displayed, and makes the appropriate index and table of contents entries. It is important for the xlatn environment to occur within a song environment, because the xlatn environment inherits the song environment’s \everypar definition.

2.2 Primary Song♭ook Macros

Along with the Song♭ook environments, these are the macros you will most often use when constructing a songbook (of any style).

\CBPageBrk    \CBPageBrk forces a new page if \ifChordBk is true.

\Ch \Ch{⟨chord⟩}{⟨syllable⟩} the chord over lyrics command definition. This is the most commonly used command in the Song♭ook style. The words-only substyle turns off the chord generation and just prints the second parameter. The ⟨chord⟩ parameter is left-justified over the ⟨syllable⟩ parameter. Any ‘#’ or ‘b’ characters in the ⟨chord⟩ parameter are replaced with ‘♯’ and ‘♭’ characters, respectively. Also, if a bass note is specified in a chord (by way of a ‘/’ character followed by the note) then it will appear in a smaller font than the rest of the ⟨chord⟩.

It is often desireable to typeset a chord—or set of chords—inside square brackets, to indicate that they are optional. A lighter weight font is probably desired, so that the brackets do not detract from the chord name, so any ‘[’ and ‘]’ characters are typeset with the font specified by the \ChBkFont macro.

To set the chord raise amount to a value that matches version 1.x and 2.x releases of the Song♭ook style, insert the following command into the preamble of your document:

       \renewcommand{\SBChordRaise}{\SBOldChordRaise}

\Chr \Chr{⟨chord⟩}{⟨syllable⟩} this command performs the same function as the \Ch command with one exception: the \Chr command inserts a rule, at the height specified by the \SBRuleRaiseAmount macro, when the chord is wider than the syllable. The default value creates an extended em-dash-like rule; a value of 0pt creates an underbar-like rule. See the Usage Guidelines section of this document, below, for a more detailed explanation.

\ChX \ChX{⟨chord⟩}{⟨syllable⟩} this command performs the same function as the \Ch command with one exception: the \ChX command causes spaces trailing the command to be ignored. See the Usage Guidelines section of this document, below, for a more detailed explanation.

\CSColBrk \CSColBrk generates a column break here if we’re in compactsong mode.

\makeKeyIndex \makeKeyIndex start creation of an index of songs by key. If you need to add your own information to this index use the \keyIndex[][] command, documented in the Detailed Documentation section, below.

\makeTitleContents \makeTitleContents start creation of a table of contents. If you need to add your own information to this index use the \titleContents[][] command, documented in the Detailed Documentation section, below.

\makeTitleIndex \makeTitleIndex start creation of a title and first line index. If you need to add your own information to this index use the \titleIndex[][] command, documented in the Detailed Documentation section, below.

\NotWOPageBrk    \NotWOPageBrk forces a new page if \ifWordsOnly is false.

\OHContPgFtr \OHContPgFtr prints a page heading continuation footer on overheads; this macro must be manually inserted where needed. \OHContPgHdr is a no-op, except

when \ifOverhead is true.

\OHContPgHdr \OHContPgHdr prints a page heading continuation header on overheads; this macro must be manually inserted where needed. \OHContPgHdr is a no-op, except when \ifOverhead is true.

\OHPageBrk    \OHPageBrk forces a new page if \ifOverhead is true.

\SBBridge \SBBridge{⟨the bridge⟩} is used to encapsulate a bridge: it causes ⟨the bridge⟩ to be set with \SBBridgeTag, using in the \SBBridgeTagFont font. In words only mode this command is a no-op.

\SBEnd \SBEnd[⟨use in words only⟩]{⟨the ending⟩} is used to encapsulate a song ending: it causes ⟨the ending⟩ to be set with the \SBEndTag, using in the \SBEndTagFont font. The first parameter is optional and if used is put in square brackets; specifying any value except ‘N’ will cause the ending to be used in words only mode. Some examples of its intended use are:

This will cause the ending to be printed in words only mode. Note how the

parameter is specified in square brackets!

            \SBEnd[Y]{Give \Ch{F}{thanks,} \ldots}

In this case the ending is a no-op in words only mode.

            \SBEnd{\Ch{A}{} \Ch{B/A}{} \Ch{D}{}}

SBIntro \SBIntro[⟨use in words only⟩]{⟨the introduction⟩} is used to encapsulate any introduction to a song: it causes ⟨the introduction⟩ to be set with an intro tag of “Intro:”, using in the \SBIntroTagFont font. The first parameter is optional and if used is put in square brackets; specifying any value except ‘N’ will cause the ending to be used in words only mode. Some examples of its intended use are:

This will cause the ending to be printed in words only mode. Note how the

parameter is specified in square brackets!

           \SBIntro[Y]{\Ch{D}{} \Ch{C}{} Ooooh}

In this case the ending is a no-op in words only mode.

           \SBIntro{{\SBLyricNoteFont Guitar and drums}}

\SBMargNote \SBMargNote{⟨marginal note⟩} is used to place a note of some kind in the margin of a songbook. In words only mode this macro is a no-op.

\SBRef \SBRef{⟨book title⟩}{⟨page or song number⟩} creates a reference in the margin to another music book, or tape. This provides a method for directing people to resources they may use to learn the song. The marginal reference only

prints when \WordsOnly is \False.

\SBem \SBem prints an em-dash (i.e., “—”) when \WordsOnly is \False. See \SBen.

\SBen \SBen prints an en-dash (i.e., “–”) when \WordsOnly is \False. This allows us to place a short rule within text in order place a chord earlier than a syllable; yet, that rule will not appear in the words-only book. The words-only version of this macro is a no-op. An example of its intended use is:

       ...flows like a ri\Ch{B/A}{\SBen ver,} flows...

\STitle \STitle{⟨song title⟩}{⟨key⟩} prints the ⟨song title⟩, preceded by the current \SBSongCnt value and followed by the ⟨key⟩ the song is given in. \STitle is most often used along with the SBExtraKeys environment. This command

resets the \SBVerseCnt and \SBSectionCnt counters.
\WBPageBrk    \WBPageBrk forces a new page if \ifWordBk is true.
\WOPageBrk    \WOPageBrk forces a new page if \ifWordsOnly is true.

2.3 Miscellaneous Commands

Not all of the commands listed here are commonly used in songbooks written using one of the Song♭ook styles. The commands are listed alphabetically.

\CpyRt \CpyRt{⟨copyright info.⟩} prints the copyright information line. This command is not usually explicitly used in a songbook. It is called by the song environment and will normally only be used there.

\FLineIdx \FLineIdx{⟨first line⟩} make an entry in the Title & First Line Index file,

“jobname.tIdx.”
\SBChorusMarkright    \SBChorusMarkright hook to allow \SBSection’s

\markright to be overridden.

\SBContinueMark \SBContinueMark conditionally produce a continuation symbol. If the contents of \rightmark will result in nothing being typeset, then don’t output the continuation mark; otherwise, output a continuation mark using the

\SBContinueTag command.
\SBSectionMarkright    \SBSectionMarkright hook to allow \SBSection’s

\markright to be overridden.

\SBVerseMarkright    \SBVerseMarkright hook to allow \SBVerse’s \markright to be overridden.

\SongMarkboth \SongMarkboth hook to allow the song environment’s \markboth to be overridden.

\STitleMarkboth    \STitleMarkboth hook to allow \STitle’s \markboth to be overridden.

\ScriptRef \ScriptRef{⟨scripture address⟩} is a scripture reference for the song. This command has its name because the Song♭ook style was written to produce songbooks for the church I am part of. This command is not usually explicitly used in a songbook. It is called by the song environment and will normally only be used there.

\WAndM \WAndM{⟨lyricist & composer⟩} prints a line telling who wrote the words and music for this song. The string “W&M:” precedes the listing of the ⟨lyricist & composer⟩ when it is printed. This command is not usually explicitly used in a songbook. It is called by the song environment and will normally only be used there.

2.4 Ifthen Commands

These \if tests are used to perform formatting that is dependent upon the type of songbook you are creating. It is these \if tests which allow a single source file to output the three songbook styles.

\ifSBinSongEnv \ifSBinSongEnv is true if we are inside of a song environment.

\ifChordBk \ifChordBk is true if we are processing a chordbk document.

\ifOverhead \ifOverhead is true if we are processing an overhead document.

\ifWordBk \ifWordBk are we processing a wordbk document?

\ifWordsOnly \ifWordsOnly is true when we are typesetting a words only document (i.e., no chords).

\ifNotWordsOnly \ifNotWordsOnly is true if we are processing a document that displays chords.

\ifCompactSongMode \ifCompactSongMode is set to true if you want songs presented in a compact mode? It is initially set to false. Set this to true or false using the

\CompactSongModetrue and \CompactSongModefalse commands, respec-

tively.

\ifSongEject \ifSongEject is set to true if we want a new page generated at the end of every song environment? A value of true means eject after every song environment (default value is true).

Papersize tests have been provided in order to detect if a particular papersize has been specified. These are only documented in the Detailed Documentation section, below, since they are not generally needed.

2.5 Counters

These are the counters used in the various environments. Although you will generally not need to use them, they do sometimes come in handy; hence, they have been documented here.

\theSBSongCnt \theSBSongCnt counter is used for numbering the songs. When a song is listed multiple times (for multiple keys) the songs number must remain the same each time.

\theSBSectionCnt \theSBSectionCnt the section counter is used for numbering sections as they occur within a song.

\theSBVerseCnt \theSBVerseCnt the verse counter is used for numbering verses as they occur within a song.

2.6 Spacing Commands

These commands define the amount of space to leave in various situations. Change their values via L^{A}TEX’s \renewcommand command.

All of these spaces are defined as L^{A}TEX commands to overcome limitations in L^{A}TEX length evaluation. For example, if \LeftMarginSBVerse were to be defined as a length (i.e., using \newlength) and then immediately set to 4em’s, the specific length would be evaluated with respect to the current font. This may not be what is desired; instead a length evaluated with respect to the font in place at the start of an SBVerse is probably what is desired. This can only be done by making these lengths L^{A}TEX commands instead of lengths.

\HangAmt \HangAmt amount to indent when a line wraps.

LeftMarginSBBracket    \LeftMarginSBBracket is the amount of left margin to leave when the \SBBracket

environment is in effect.

\LeftMarginSBChorus    \LeftMarginSBChorus is the amount of left margin to leave when the \SBChorus

environment is in effect.

LeftMarginSBSection    \LeftMarginSBSection is the amount of left margin to leave when the \SBSection

environment is in effect.

\LeftMarginSBVerse    \LeftMarginSBVerse is the amount of left margin to leave when the \SBVerse

environment is in effect.

\SBChordRaise \SBChordRaise the distance to raise the chords above the baseline of the text they sit over.

\SBRuleRaiseAmount \SBRuleRaiseAmount the distance to raise the rule (as specified by \SBIntersyllableRule) which fills the space between adjoining syllables.

\SpaceAboveSTitle \SpaceAboveSTitle is the amount of vertical space left by the STitle command before it prints the song title line.

\SpaceAfterTitleBlk \SpaceAfterTitleBlk is the space inserted by the song environment between the title block and the versicles.

\SpaceAfterChorus    \SpaceAfterChorus is the vertical space to leave after an SBChorus.
\SpaceAfterOpGroup    \SpaceAfterOpGroup is the vertical space to leave after an SBOpGroup.
\SpaceAfterSection    \SpaceAfterSection is the vertical space to leave after an SBSection.
\SpaceAfterSBBracket    \SpaceAfterSBBracket is the vertical space to leave after an SBBracket.
\SpaceAfterSong    \SpaceAfterSong is the vertical space to leave after a song.

\SpaceAfterVerse    \SpaceAfterVerse is the vertical space to leave after an SBVerse.
\SpaceBeforeSBBracket    \SpaceBeforeSBBracket is the vertical space to leave before an SBBracket.
It is worth noting that the \SpaceAfterChorus, \SpaceAfterOpGroup,
\SpaceAfterSection, and \SpaceAfterSong, \SpaceAfterVerse macros all al-

low negative glue to be inserted; that is, the space may be shrunk as well as expanded. If this proves problematic (due to sections being visibly pushed into each other, the old spacing (as in versions 1.x and 2.x) can be restored by resetting these macros to 0ex. For example:

\renewcommand{\SpaceAfterChorus} {\vspace{0ex}}
\renewcommand{\SpaceAfterOpGroup}{\vspace{0ex}}
\renewcommand{\SpaceAfterSection}{\vspace{0ex}}
\renewcommand{\SpaceAfterSong}   {\vspace{0ex}}
\renewcommand{\SpaceAfterVerse}  {\vspace{0ex}}

2.7 String Constants

These constants are provided so that users may easily customize the appearance of formatted songs and songbooks. Use the \renewcommand command to change the value of these constants.

\OHContPgFtrTag    \OHContPgFtrTag tag is inserted by the \OHContPgFtr command. The default
value for this is “continued on next page\ldots”.
\OHContPgHdrTag    \OHContPgHdrTag tag is inserted by the \OHContPgHdr command. The default
value for this is “\theSBSongCnt\ --- \theSongTitle, continued\ldots”.

\SBBridgeTag \SBBridgeTag the Bridge Tag to insert before the start of a bridge. The default value for this is “Bridge:”.

\SBChorusTag \SBChorusTag the Chorus Tag to insert before the first line of a chorus. The default value for this is “Ch:”.

\SBContinueTag    \SBContinueTag the Continue Tag to insert in an

\SBContinueMark. The default value for this is “cont\ldots”.

\SBEndTag \SBEndTag the End Tag to insert before the start of an ending (in an \SBEnd command). The default value for this is “End:”.

\SBIntersyllableRule \SBIntersyllableRule the command(s) to draw the rule between adjoining syllables.

\SBIntroTag \SBIntroTag the Intro Tag to insert before the start of an introduction (in an \SBIntro command). The default value for this is “Intro:”.

\SBPubDom \SBPubDom the string to insert which indicates song is in the public domain. The default value for this is “Public Domain”. If you want to localize this string in the song title block, be sure to use this public interface: the \CpyRt macro uses \SBPubDom to determine whether or not to print the copyright symbol

(\begin{matrix}c \\ ◯ \end{matrix}).

\SBUnknownTag \SBUnknownTag the WAndM string to insert when either the author/artist or the copyright holder is unknown. The default value for this is “Unknown”.

\SBWAndMTag \SBWAndMTag the tag to insert before the words and music entry printed in the song header. The default value for this is “W\&M:”.

2.8 Font Handling

Of all the font selection Song♭ook macros, only one is commonly used by someone writing a songbook: \SBLyricNoteFont. All the other font macros are only used by an author to over-ride default behaviour, via the \renewcommand command.

\ChBassFont \ChBassFont sets the font for the bass note in chords as printed by the \Ch, \Chr and \ChX commands.

\ChBkFont \ChBkFont sets the font for square brackets typeset inside \Ch commands (and its variants).

\ChFont \ChFont sets the font for chords as printed by the \Ch, \Chr, and \ChX commands.

\CpyRtFont \CpyRtFont sets the font used to print the copyright line produced by the \CpyRt command.

\CpyRtInfoFont \CpyRtInfoFont sets the font used to print the ⟨copyright licensing information⟩ parameter of the song environment; which appears after the ⟨copyright information⟩ parameter under the ⟨song title.⟩

\SBBracketTagFont    \SBBracketTagFont sets the font used to create the tag for an SBBracket envi-

ronment.

\SBBridgeTagFont \SBBridgeTagFont sets the font used to create the tag for an SBBridge environment.

\SBChorusTagFont    \SBChorusTagFont sets the font used to print the chorus tag, \SBChorusTag.

\SBDefaultFont \SBDefaultFont sets the default font for the songbook. As of version 4.0 there is no need for you to specify this command yourself.

\SBEndTagFont    \SBEndTagFont sets the font used to print the tag, \SBEndTag, for the \SBEnd

command.

\SBIntroTagFont \SBIntroTagFont sets the font used to print the introduction tag, \SBIntroTag.

\SBLyricNoteFont \SBLyricNoteFont sets the font used in comments placed within the lyrics giving musical direction. This is the only font command commonly used by the writer of a songbook.

\SBMargNoteFont \SBMargNoteFont sets the font used in the marginal reference printed by the

\SBMargNote command.

\SBOccursBrktFont \SBOccursBrktFont sets the font used to create the large left and right square brackets which delimit an SBOccurs environment.

\SBOccursTagFont    \SBOccursTagFont sets the font used to create the \SBOccurs tag.

\SBRefFont \SBRefFont sets the font used in the marginal reference printed by the \SBRef command.

\SBVerseNumberFont    \SBVerseNumberFont sets the font used to print the \SBVerseCnt in front of

verses in an SBVerse environment.

\SBSectionNumberFont    \SBSectionNumberFont sets the font used to print the \SBSectionCnt in front

of sections in an SBSection environment.

\STitleFont \STitleFont sets the font used to print the song title, as generated by the \STitle command.

\STitleKeyFont \STitleKeyFont sets the font used to print the key a song is written in, as generated by the \STitle command.

\STitleNumberFont    \STitleNumberFont sets the font used to print the \SBSongCnt in front of the

song title, as generated by the \STitle command.

\ScriptRefFont \ScriptRefFont sets the font used to print the scripture reference generated by the \ScriptRef command.

\WandMFont \WandMFont sets the font used to print the lyricist and composer line generated by the \WandM command.

2.9 Deprecated Commands

The following commands will be discontinued in some future release of the Song♭ook style:

\ChordBk is set to \True if we’re producing words and chord books. Set to \False, otherwise. Superceded by the \ifChordBk if.

\False is a constant used in TEX \if expressions. This command is now unnecessary.

\Overhead is set to \True if we’re producing overhead transparencies. Set to \False, otherwise. Superceded by the \ifOverhead if.

\SongEject is a flag indicating whether or not the \song environment should end the current page when the environment ends: \True means end the page when the \song environment ends; \False means don’t end the page. Superceded by the \ifSongEject if.

\True is a constant used in TEX \if expressions. This command is now unnecessary.

\WordBk is the flag which tells us whether we’re producing a songbook with just words that is not a set of overhead masters. Superceded by the \ifWordBk if.

\WordsOnly is the flag which tells us whether we’re producing a songbook with just words, or set of overhead masters. Superceded by the \ifWordsOnly if.

3 Usage Guidelines

This section gives some guidelines for use of the commands and environments offered by the Song♭ook style. These are not absolute standards, merely the suggestions that I have come up with after entering some 450 songs into a Song♭ook style based songbook. These guidelines rarely justify themselves, try things out and decide for yourself whether they’re right or wrong.

1. Make each line of a song its own paragraph. This means that the songbook file is mostly double spaced. This allows the file to more easily survive encounters with users who edit the songbook source using a non-text-editor, such as WordPerfect.

2. Use of the \Ch command:

• Always try to attach a chord to a single syllable. If you need to include more than one syllable with the chord then include extra text in units of syllables (whenever possible). For example:

    Do: \Ch{G}{Halle}luia
    Don’t: \Ch{G}{Hall}eluia

• Always include punctuation along with a syllable that has been included in a \Ch command. For example:

    Do: \Ch{G}{Lord!}
    Don’t: \Ch{G}{Lord}!

• Only place a single chord within a \Ch command. For example:

    Do: \Ch{[}{}\Ch{G}{} \Ch{D}{}\Ch{]}{}
    Don’t: \Ch{[G D]}{}

3. Extension of syllables. Syllables may be extended at either/or both ends. Each end should be done in a different way:

(a) One usually needs to make a syllable longer because the chord it is tied to is too long. This type of extension should be done using the \Chr command.

    Do: \Chr{G\#m7/C}{Ho}\Ch{C}{ly}
    Don’t: \Ch{G\#m7/C}{Ho\SBem}\Ch{C}{ly}

(b) Extending the beginning (i.e., delaying the start) of a syllable is generally required because the chord change needs to occur between syllables. For example, when the chord change is on the beat and the syllable is sung off-beat. Use \SBen and \SBem for this purpose.

    Do: none Ho\Ch{D}{\SBen ly}

4. Typographic conventions. L^{A}TEX knows about certain ligatures; that is, it groups certain sequences of letters into a single character unit. ff is one of these ligatures and is typeset in a special way; however this cannot occur if the f’s are split by a \Ch command. Therefore, if at all possible, never split up the following character sequences with the \Ch command:

ff, fi, ffi, fl, ffl.
Do: \Ch{C}{diffi}cult
Don’t: \Ch{C}{dif}ficult

5. Ordering of songs in the songbook. In order to allow L^{A}TEX2e to fill pages in as natural a manner as possible, it is best to order the songs within the songbook based upon a wordbk formatted songbook. In that way, the words-only songbooks will contain optimally filled columns. Start by placing the longest songs first, only inserting shorter songs to cause page breaks at logical intervals.

6. Overheads that occupy more than one page. When in overhead mode, if a song spills over onto a second page (or beyond), it is helpful to print an extra header at the top of the page identifying which song the extra page belongs to. This is accomplished with the \OHContPgHdr macro. For example, one would insert the following lines where the new page is to occur:

       \OHContPgFtr
       \OHPageBrk
       \OHContPgHdr

4 Index/TOC Generation

The Song♭ook style provides facilities for title/first line index, song key index and table of contents generation. While this facility is not yet completely developed, it is much better than it was in early Song♭ook releases, and it produces very usable output!

4.1 Table of Contents Generation

Steps to follow in order to produce a table of contents:

1. Add a \makeTitleContents command to the preamble of your songbook.

2. Run L^{A}TEX2e on the songbook source.

3. Make your own copy of sampleToc.tex and customize its header and footer definitions (so they match your songbook’s). Then change the name of the file being \inputed to match your table of contents file.

4. Run L^{A}TEX2e on your copy of sampleToc.tex.

4.2 Title & First Line Index Generation

Steps to follow in order to produce a title and first line index:

1. Add a \makeTitleIndex command to the preamble of your songbook.

2. Run L^{A}TEX2e on the songbook source.

3. Run the ./mksbtdx shell script on the .tIdx file that was produced by the previous step. Do this by typing “mksbtdx jobname” at a UNIX command line. For example, the index file for sample-sb.tex was produced by typing

  “mksbtdx sample-sb”.

4. Make your own copy of sampleTdx.tex and customize its header and footer definitions (so they match your songbook’s). Then change the name of the file being \inputed to match your index file. (./mksbtdx told you this file’s name).

5. Run L^{A}TEX2e on your copy of sampleTdx.tex.

4.3 Song Key Index Generation

Steps to follow in order to produce a song key index:

1. Add a \makeKeyIndex command to the preamble of your songbook.

2. Run L^{A}TEX2e on the songbook source.

3. Run the ./mksbkdx shell script on the .kIdx file that was produced by the previous step. Do this by typing “mksbkdx jobname” at a UNIX command line. For example, the key index file for sample-sb.tex was produced by

  typing “mksbkdx sample-sb”.

4. Make your own copy of sampleKdx.tex and customize its header and footer definitions (so they match your songbook’s). Then change the name of the file being \inputed to match your index file. (./mksbkdx told you this file’s name).

5. Run L^{A}TEX2e on your copy of sampleKdx.tex.

5 Example

Here is an example songbook; where the the songbook contains exactly one song.

\documentstyle[12pt]{book}
\usepackage[chordbk]{songbook}                %% Words & Chords edition.
%%
% C.C.L.I. license number definition; for copyright licensing info.

%%
\newcommand{\CCLInumber}{\#999999}
\newcommand{\CCLIed}{(CCLI \CCLInumber)}
\newcommand{\NotCCLIed}{}
\newcommand{\PGranted}{}
\newcommand{\PPending}{(Permission Pending)}
%%
% Turn on index and table of contents.
%%
\makeTitleIndex         %% Title and First Line Index.
\makeTitleContents      %% Table of Contents.
\makeKeyIndex           %% Song Key Index.
\begin{document}
%%
% Songbook begins.
%%
\begin{song}{What A Mighty God We Serve}{C}
  {\SBPubDom}
  {Unknown}
  {Isaiah 9:6}
  {\NotCCLIed}
  \renewcommand{\RevDate}{February~11,~1993}
  \SBRef{Give Thanks}{Hosanna! Music Tape HM-7}
  \SBRef{Hosanna! Music Book~I}{\#93}
  \begin{SBOpGroup}
    \Ch{C}{What} a mighty God we serve,
    What a mighty God we \Ch{G7}{serve},
    \Ch{C}{An}gels bow before Him,
    \Ch{C}{Hea}ven and earth adore Him,
    \Ch{C}{What} a mighty \Ch{G7}{God} we \Ch{C}{serve!}\Ch{[}{}\Ch{F}{}
      \Ch{C}{}\Ch{]}{}
  \end{SBOpGroup}
  \begin{SBVerse}
    O \Ch{C}{Zion,} O \Ch{F}{Zion,} that \Ch{G7}{bring}est good \Ch{C}{tid}ings,
    Get thee \Ch{F}{up} into the \Ch{G7}{High} Moun\Ch{C}{tains}
    Je\Ch{C}{ru}salem, Je\Ch{F}{ru}salem, that \Ch{G7}{bring}est good \Ch{C}{tid}ings
    Lift up thy \Ch{F}{voice} with \Ch{G7}{all} thy \Ch{C}{strength}
    Lift it \Ch{F}{up,} be not afraid;
    Lift it \Ch{C}{up,} be not afraid
    Say \Ch{Am}{unto} the \Ch{C}{ci}ties of \Ch{G7}{Judah,}
    ``Behold your \Ch{C}{God,}\Ch{C7}{} Behold your \Ch{F}{God,}
    Be\Ch{C}{hold} \Ch{G7}{your} \Ch{C}{God!''}
  \end{SBVerse}
\CBPageBrk
  \begin{SBExtraKeys}{%
    \STitle{What A Mighty God We Serve}{D}
    \begin{SBOpGroup}
      \Ch{D}{What} a mighty God we serve,
      What a mighty God we \Ch{A7}{serve},
      \Ch{D}{An}gels bow before Him,

       \Ch{D}{Hea}ven and earth adore Him,
       \Ch{D}{What} a mighty \Ch{A7}{God} we \Ch{D}{serve!}\Ch{[}{}\Ch{G}{}
         \Ch{D}{}\Ch{]}{}
     \end{SBOpGroup}
     \begin{SBVerse}
       O \Ch{D}{Zion,} O \Ch{G}{Zion,} that \Ch{A7}{bring}est good \Ch{D}{tid}ings,
       Get thee \Ch{G}{up} to into the \Ch{A7}{High} Moun\Ch{D}{tains}
       Je\Ch{D}{ru}salem, Je\Ch{G}{ru}salem, that \Ch{A7}{bring}est good
         \Ch{D}{tid}ings
       Lift up thy \Ch{G}{voice} with \Ch{A7}{all} thy \Ch{D}{strength}
       Lift it \Ch{G}{up} be not afraid,
       Lift it \Ch{D}{up} be not afraid
       Say \Ch{Bm}{unto} the \Ch{D}{ci}ties of \Ch{A7}{Judah,}
       ``Behold your \Ch{D}{God,}\Ch{D7}{} Behold your \Ch{G}{God,}
       Be\Ch{D}{hold} \Ch{A7}{your} \Ch{D}{God!''}
     \end{SBVerse}
   }\end{SBExtraKeys}
 \end{song}
 \end{document}
 \bye

6 Dependencies

The Song♭ook style is dependent upon four other L^{A}TEX2e styles: conditional.sty,

calc.sty, ifthen.sty, and multicol.sty. Conditional.sty is supplied with

this package. Calc.sty, ifthen.sty, and multicol.sty are part of the L^{A}TEX2e distribution.

Embedding chords within a songbook can be accomplished with the texchord.sty package; which is supplied in the contrib directory of the Song♭ook distribution.

7 Files

conditionals.sty Donald Arseneau’s conditional tests. mksbkdx A shell script around makeindex to sort the song key index. mksbtdx A shell script around makeindex to sort the title & first line index. relnotes.txt The Song♭ook package release notes. sample-sb.tex A sample songbook. sampleKdx.tex Song key index for the sample songbook. sampleTdx.tex Title & first line index for the sample songbook. sampleToc.tex TOC for the sample songbook. songbook.ist The Song♭ook package makeindex .ist file. songbook.dtx The base style file. songbook.inx The install script used to create songbook.sty.

8 See Also

Some resources you will find helpful when coding songbooks:

• L^{A}TEX A Document Preparation System, by Leslie Lamport

• The L^{A}TEX Companion, by Goossens, Mittlebach, & Samarin

   • The Song♭ook homepage, at URL http://rath.ca/Misc/Songbook/

• The TEX book, by Donald Knuth

8.1 Other Similar Packages

There are a number of song and songbook formatting packages available which attempt to provide similar functionality to the Song♭ook package (although, IMHO, my package is better). Similar L^{A}TEX2e packages (of which the author is aware) include:

chord.sty a song formatting package based on L^{A}TEX’s article style; written by

     Olivier Biot (http://www.biot.yucom.be/).

Chordpack a utility for typesetting chordpro chord files in TeX; written by

     Daniel Polansky (http://www.fi.muni.cz/~xpolansk/home.html) and
     available at http://www.fi.muni.cz/~xpolansk/chordpack.

gchords.sty a TeX packages for typesetting guitar chord diagrams; written by

     Kasper Peeters (http://www.damtp.cam.ac.uk/user/kp229/) and avail-
     able at http://www.damtp.cam.ac.uk/user/kp229/gchords/.

Guitar.sty L^{A}TEX macros for typesetting guitar chords over song texts; writ-

     ten by Martin Vth (http://www.mathematik.uni-wuerzburg.de/~vaeth/)

and available from

     http://www.mathematik.uni-wuerzburg.de/~vaeth/download/.

GuitarTeX a graphical tool for editing chordpro chord files and printing them in TeX; written by Joachim Miltz and available from

     http://www.rz-home.de/~jmiltz/guitartex/.

song.sty a song formatting package based on L^{A}TEX’s book style; written by Jens

     T. Berger Thielemann (http://www.stud.ifi.uio.no/~jensthi/).

9 Bugs

In the specific case where a \Ch, \Chr, or \ChX macro begins a paragraph that isn’t inside one of Song♭ook’s versicle environments, that line may not indent properly in the chordbk substyle (specifically, a long, wrapped line won’t have its extra indentation). I have been unable to identify the reason for the problem, although it is easily reproducible. The best way to avoid this problem is through use of the \SBOpGroup environment. If that isn’t possible, the problem may often be overcome by starting such lines with an \mbox{} command; this inserts an empty (i.e., zero width) mbox at the start of the line. For example:

     \mbox{}\Ch{G}{Great} is the Lord \Ch{A}{even} beyond the
       \Ch{D}{borders} of I\Chr{F#m}{srae}\Ch{Bm7}{l;}

The \emph macro is not completely compatible with \Ch and its friends. The specific problem is that sharps can not be specified via ‘#’ within an \emph macro. The following snippet,

     \emph{for the \Ch{G/A}{King} of \Ch{F#}{kings.}}

will fail with the L^{A}TEX2e message,

   ! Illegal parameter number in definition of \\reserved\@a.
   <to be read again>

The error message can be supressed by replacing ‘#’ with ‘##’, however this results in a double-sharp being typeset. The problem can be worked-around by replacing the snippet with:

     \emph{for the \Ch{G/A}{King} of} \Ch{F#}{\emph{kings.}}

10 Special Thanks

Thanks to Donald Arseneau for writing the conditionals.sty file, and for helping write the \Chord macro. Donald, you are one of the faithful who is always quick to reply with correct answers to questions posted to comp.text.tex. Thanks again.

Thanks also to Philip Hirschhorn whose \Chord macro I ultimately used in versions 1.0–2.3 of the Song♭ook style, and to Olivier Boit who constructed a similar chord macro which I used to enhance Philip’s code for version 3.0

A quick thank you to Herbert Martin Dietze <herbert@fh-wedel.de> for noting that SBVerse* and its cousins were missing from the .sty file, and then coding up an acceptable SBVerse* which I could quickly use as a model for the other two missing environments.

11 Author

Christopher Rath  christopher@rath.ca  (613) 824-4584

1371 Major Rd. Orleans, ON Canada K1E 1H3

12 .dtx Documentation Driver

There is one last administrative detail to take care of before beginning the detailed review: the insertion of the documentation driver (i.e., the code that builds the documentation .dvi file.

1 ⟨∗driver⟩

 2 \documentclass{ltxdoc}
 3 \RequirePackage{calc}
 4 \EnableCrossrefs
 5 \CodelineIndex
 6 \RecordChanges                  % Gather update information
 7 %\OnlyDescription  % comment out for implementation details
 8 %\OldMakeindex     % use if your MakeIndex is pre-v2.9
 9 \setlength\hfuzz{15pt}  % dont make so many
10 \hbadness=7000          % over and under full box warnings
11 \def\MacroFont{\fontencoding\encodingdefault
12 \fontfamily\ttdefault
13 \fontseries\mddefault
14 \fontshape\updefault
15 \footnotesize}%

16

17 \voffset=-1.00in
18 \topmargin=0.5in
19 \headheight=0.0in
20 \headsep=0.20in
21 \textheight=9.4in
22 \footskip=0.4in

23

24 \newenvironment{ParameterList}
25 {\par\hskip 1.5em Parameters:\begin{list}{}
26  {\setlength{\topsep}{0pt}
27  \setlength{\parsep}{0pt}
28  \setlength{\itemsep}{0pt}
29  \setlength{\leftmargin}{\leftmargin + 1.5em}
30  \setlength{\parsep}{0pt}

31 } 32 }

33 {\end{list}\vskip 0.5ex

34 }

35 \newcommand{\parm}[1]{\texttt{[}\meta{#1}\texttt{]}}
36 \begin{document}
37 \setcounter{IndexColumns}{1}
38 \DocInput{songbook.dtx}
39 \end{document}

40 ⟨/driver⟩

Part II

Detailed Documentation

This section contains style implementation details along with the detailed descriptions and documentation for the Song♭ook commands and environments. It is strongly recommended that these detailed descriptions be reviewed at least once as part of becoming familiar with the Song♭ook style.

This coding style has been structured in a top down fashion which assume that macros and environments must be declared before they are first used. TEX doesn’t require this to be so, but since I’ve been coding software this way for 20 years, it’s easier for me to also maintain this structure here.

13 Identification Part

The first section in songbook.sty is what L^{A}TEX2e calls the Implementation Part. This is where Song♭ook identifies itself to the outside world. As part of this section an RCS “Id:” variable has been included as a TEX comment; the intent is that this may assist with reporting problems later.

 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 3 %%                                                      %%
 4 %%        I D E N T I F I C A T I O N   P A R T         %%
 5 %%                                                      %%
 6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 8 %%
 9 %% rcsid = @(#)$Id: songbook.dtx,v 1.5 2002/04/26 00:55:41 christopher Exp $
10 %%
11 \NeedsTeXFormat{LaTeX2e}
12 \ProvidesPackage{songbook}[2002/04/25 v4.0 All purpose Songbook style]
13 \typeout{Document Subclass: songbook 2002/04/25 v4.0 All purpose Songbook style}

14 Initial Code Part

The next section is called the Initial Code Part. This is where any dependencies in the early sections of songbook.sty has are contained. In the case of the Song♭ook style we must declare our dependence on calc.sty here because some of Song♭ook’s declarative sections themselves contain calculations. In this section we also declare the \if constructs used in the package.

14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16 %%                                                      %%
17 %%          I N I T I A L   C O D E   P A R T           %%
18 %%                                                      %%
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

21

22 %%========================================================
23 %%  E A R L Y   P A C K A G E   D E P E N D E N C I E S  %
24 %%========================================================

Page layout calculations have become overly complex and so as of version 4.0 we now require calc.sty to make them readable once again. In every instance we could probably find a way to get along without calc.sty; however, since the package is a part of the L^{A}TEX2e Base there is no logical reason to avoid its use.

25 \RequirePackage{calc}

26

14.1 If Constructs

Most of these \if contructs are needed for use in the Delaration Of Options section of songbook.sty. In each case, we create the if statement (a.k.a. the flag) and then immediately set it to a known value. Where there are several flags which act as sort of radio buttons, all of the flags are set so that none of them is selected; which has been done so that if we forget to deal with them properly in the Declaration Of Options code it will eventually manifest itself as an error.

Since the majority of the \ifs had to be declared in this section, we will go ahead and declare the remaining \ifs as well. It’s simpler to maintain them when they are all in one place.

27 %%========================================================
28 %%              I F   C O N S T R U C T S                %
29 %%========================================================

14.1.1 Song♭ook Types

At any time, only one of \ifChordBk, \ifOverhead, or \ifWordBk may be true. These \ifs correspond directly to the chordbk, overhead, and wordbk options; one of which must be used in the \usepackage{} statement used to invoke the Song♭ook style. All three flags are set to \false, and this fact is use later in order to confirm that the user had specified one of the 3 options in their document.

\ifChordBk \ifChordBk is true if the user specified the chordbk option.

\ifOverhead \ifOverhead is true if the user specified the overhead option.

\ifWordBk \ifWordBk is true if the user specified the wordbk option.

30 \newif\ifChordBk        \ChordBkfalse
31 \newif\ifOverhead       \Overheadfalse
32 \newif\ifWordBk         \WordBkfalse

14.1.2 Song♭ook Subtypes

A pair of \ifs are declared to indicate whether we are only typesetting words on the page (i.e., the flag is false if we are typesetting words and chords). We are in words only mode when the user has declared either the overhead or wordbk options. When these flags are first declared they are set to the same value, false.

\ifWordsOnly \ifWordsOnly is true if we’re in words only mode.

\ifNotWordsOnly  \ifNotWordsOnly always has a value oposite the of \ifWordsOnly. \ifNotWordsOnly

is false if we are in words only mode.

33 \newif\ifWordsOnly      \WordsOnlyfalse
34 \newif\ifNotWordsOnly   \NotWordsOnlyfalse

14.1.3 Song Indicator

\ifSBinSongEnv The \ifSBinSongEnv flag is provided to the style or a songbook’s author to detect if the current text is inside of a song environment. This flag hasn’t proven to be useful, but it doesn’t hurt anything to leave it around; so, it hasn’t been removed— who knows, there may well be a user somewhere making use of it! The song environment takes care of setting this flags status.

35 \newif\ifSBinSongEnv    \SBinSongEnvfalse

14.1.4 Behaviour Flags

There are three flags which can be set in order to effect certain behaviours from the Song♭ook style. They are not related to one another but have been grouped together since they are they only \ifs used to control Song♭ook behaviour.

\ifCompactSongMode \ifCompactSongMode is set to true if you want songs presented in a compact mode. It is initially set to false. This flag will only be set to true by the user; the style itself does not toggle this flag. Set this to true by specifying the compactsong option in the \usepackage statement.

\ifSamepageMode \ifSamepageMode indicates we want the Song♭ook style to try and keep each song together on the same page. Set this true or false using the \SamepageModetrue and \SamepageModefalse commands, respectively. Important note: this command has not been documented in the High Level Documentation section, above; \ifSamepageMode is very unreliable. The L^{A}TEX2e page breaking algorithms are not happy when this mode is used. The the song environment description, below, for a further explanation.

\ifSongEject \ifSongEject is set to true if we want a new page generated at the end of every song environment. A value of true means eject after every song environment (default value is true). Set this true or false using the \SongEjecttrue and \SongEjectfalse commands, respectively.

36 \newif\ifCompactSongMode\CompactSongModefalse
37 \newif\ifSamepageMode   \SamepageModefalse
38 \newif\ifSongEject      \SongEjecttrue

14.1.5 Papesize Indicators

This next set of flags are needed to track the papersize specified by the user in then processed in the Declaration Of Options section. This set of \ifs are mutually exclusive and only one of them should be true at any one time. They are all initially set to false; setting of a default value is done via an \ExecuteOptions{} clause, below. These flags were created for use by the Song♭ook style itself, but have been made part of the public interface to simplify page layout coding related to paper handling in a user’s own songbook.

\ifSBpaperA4  \ifSBpaperA4 is true if papersize is A4.
\ifSBpaperA5  \fSBpaperA5 is true if papersize is A5.
\ifSBpaperB5  \ifSBpaperB5 is true if papersize is B5.

\ifSBpaperLtr \ifSBpaperLtr is true if papersize is US Letter.

\ifSBpaperLgl \ifSBpaperLgl is true if papersize is US Legal.

\ifSBpaperExc \ifSBpaperExc is true if papersize is US Executive Letter.

39 \newif\ifSBpaperAfour   \SBpaperAfourfalse
40 \newif\ifSBpaperAfive   \SBpaperAfivefalse
41 \newif\ifSBpaperBfive   \SBpaperBfivefalse
42 \newif\ifSBpaperLtr     \SBpaperLtrfalse
43 \newif\ifSBpaperLgl     \SBpaperLglfalse
44 \newif\ifSBpaperExc     \SBpaperExcfalse

14.2 Fonts

Fonts are specified up-front in this section in order to simplify the \DeclareOption{} clauses that follow (i.e., those clauses need only make changes against these baseline settings). The fonts sizes and selections initially declared herein are those necessary for chordbk songbooks.

Fonts are handled by way of L^{A}TEX2e commands defined using the \newcommand command. This was done specifically so that traditional L^{A}TEX2e font selection occurs in the context the Song♭ook font command is used. I may have completely misunderstood how L^{A}TEX2e does its font selection, in which case my implementation choice here is pointless; however, until proven otherwise… here it is.^{1} Change these font specifiers via L^{A}TEX2e’s \renewcommand.

45 %%========================================================
46 %%                      F O N T S                        %
47 %%========================================================

14.2.1 Chord Fonts

These font selectors are used to determine how chords are printed in words and chords songbooks:

\ChBassFont \ChBassFont sets the font for the bass note in chords as printed by the \Ch, \Chr, and \ChX commands.

\ChBkFont \ChBkFont sets the font for square brackets typeset by \Ch, \Chr, and \ChX commands.

\ChFont \ChFont sets the font for chords as printed by the \Ch, \Chr, and \ChX commands. This used to be set to \bf\sf (i.e., cmss12 at 14.4pt).

48 \newcommand{\ChBassFont}{\normalsize\bf\sf}     % = cmss12 at 12.0pt
49 \newcommand{\ChFont}{\large\fontfamily{\sfdefault}%
50 \fontseries{sbc}\fontshape{n}\selectfont}     %=cmssbc12 at 14.4pt
51 \newcommand{\ChBkFont}{\ChFont\fontseries{m}    %
52 \selectfont}                                  % =cmssm12 at 14.4pt

14.2.2 Title Block Fonts

These font selectors are used to select the fonts used in the Title Block that occurs that the start of each song:

\CpyRtFont \CpyRtFont sets the font used to print the copyright symbol produced by the \CpyRt command.

\CpyRtInfoFont \CpyRtInfoFont sets the font used to print the copyright licensing information parameter of the \song environment; which appears after the copyright information parameter under the song title.

\STitleFont \STitleFont sets the font used to print the song title, as generated by the \STitle command.

\STitleKeyFont \STitleKeyFont sets the font used to print the key a song is written in, as generated by the \STitle command.

\STitleNumberFont  \STitleNumberFont sets the font used to print the \SBSongCnt in front of the

song title, as generated by the \STitle command. This is one of two Song♭ook font commands that are implemented using a real L^{A}TEX2e \font command; this turned out to be the easiest manner in which to obtain the desired fonts. In order to make the \STitleNumberFont’s behaviour the the same as the other Song♭ook font commands, the implementation is done indirectly; whereby the \font command is inserted into the \STitleNumberFont command so that it may be changed by the user in the same way as the other font commands in this package.

\ScriptRefFont \ScriptRefFont sets the font used to print the scripture reference generated by the \ScriptRef command.

1Given that doc.dtx uses fonts in this fashion, I feel I’m in pretty good company.

\WandMFont \WandMFont sets the font used to print the lyricist and composer line generated by the \WandM command.

53 \newcommand{\CpyRtFont}{\footnotesize}          % = cmr10  at 10pt
54 \newcommand{\CpyRtInfoFont}{\tiny}              % = cmss8  at  8pt
55 \newcommand{\STitleFont}{\large\bf\sf}          % = cmss12 at 14.4pt
56 \newcommand{\STitleKeyFont}{\large}             % = cmr12  at 14.4pt
57 \font\STNFont=cmtt12 at 20pt
58 \newcommand{\STitleNumberFont}{\STNFont}        % = cmtt12 at 20pt
59 \newcommand{\ScriptRefFont}{\footnotesize}      % = cmr10  at 10pt
60 \newcommand{\WandMFont}{\footnotesize}          % = cmr10  at 10pt

14.2.3 Versicle Tag Fonts

These font selectors are used to select the fonts used to tag verses, choruses, bridges, and other elements with which a song is constructed (e.g., verse numbers, “Ch:” chorus indicator, etc.):

\SBBracketTagFont  \SBBracketTagFont sets the font used to create the tag for an SBBracket envi-

ronment.

\SBBridgeTagFont \SBBridgeTagFont sets the font used to create the tag for an SBBridge environment.

\SBChorusTagFont  \SBChorusTagFont sets the font used to print the chorus tag, \SBChorusTag.
\SBEndTagFont  \SBEndTagFont sets the font used to print the tag, \SBEndTag, for the \SBEnd

command.

\SBIntroTagFont \SBIntroTagFont sets the font used to print the introduction tag, \SBIntroTag.

\SBOccursBrktFont \SBOccursBrktFont sets the font used to create the large left and right square brackets used to delimit the \SBOccurs environment.

\SBOccursTagFont  \SBOccursTagFont sets the font used to create the \SBOccurs tag.
\SBVerseNumberFont  \SBVerseNumberFont sets the font used to print the \SBVerseCnt in front of verses

in an SBVerse environment.

\SBSectionNumberFont  \SBSectionNumberFont sets the font used to print the \SBSectionCnt in front of

sections in an SBSection environment.

61 \newcommand{\SBBracketTagFont}{\small\bf\sf}    % = cmss10 at 10.0pt
62 \newcommand{\SBBridgeTagFont}{\SBEndTagFont}    % = cmss10 at 10.9pt
63 \newcommand{\SBChorusTagFont}{\small\bf\sf}     % = cmss10 at 10.9pt
64 \newcommand{\SBEndTagFont}{\small\bf\sf}        % = cmss10 at 10.9pt
65 \newcommand{\SBIntroTagFont}{\SBEndTagFont}     % = cmss10 at 10.9pt
66 \font\SBOBFont=cmss17 at 30pt
67 \newcommand{\SBOccursBrktFont}{\SBOBFont}       % = cmss17 at 30pt
68 \newcommand{\SBOccursTagFont}{\small\bf\sf}     % = cmss10 at 10.0pt
69 \newcommand{\SBVerseNumberFont}{\small\bf\sf}   % = cmss10 at 10.9pt
70 \newcommand{\SBSectionNumberFont}{\small\bf\sf} % = cmss10 at 10.9pt

71

14.2.4 Marginal Notes Fonts

These font selectors are used to select the fonts used when Song♭ook commands make notations in the margin of the songbook:

\SBMargNoteFont \SBMargNoteFont sets the font used in the marginal reference printed by the

\SBMargNote command.

\SBRefFont \SBRefFont sets the font used in the marginal reference printed by the \SBRef command.

72 \newcommand{\SBMargNoteFont}{\scriptsize}       % = cmti8  at  8pt
73 \newcommand{\SBRefFont}{\SBMargNoteFont}        % = cmti8  at  8pt

14.2.5 Song Body Fonts

These font selector command are used to select fonts which are used within the body of songs:

\SBDefaultFont \SBDefaultFont sets the default font for the songbook. We will insert an occurrence of this command at the top of the songbook using the \AtBeginDocument{} clause, below.

\SBLyricNoteFont \SBLyricNoteFont sets the font used in comments placed within the lyrics giving musical direction. This is the only font command commonly used by the writer of a songbook. For example, to tag a line to be sung only by the Cantor and another by everyone, one would write:

      {\SBLyricNoteFont (Cantor)} Give thanks to the Lord.
      {\SBLyricNoteFont (All)} His love endures forever.
74 \newcommand{\SBDefaultFont}{\fontfamily{\rmdefault}%
75 \large}                                       % = cmr12  at 14.4pt
76 \newcommand{\SBLyricNoteFont}{\footnotesize\sf} % = cmss10 at 10pt

14.2.6 Other Fonts

The remaining font selector commands:

\SBOHContTagFont  \SBOHContTagFont sets the font used to print the \OHContPgFtr and \OHContPgHdr.
77 \newcommand{\SBOHContTagFont}{\small\bf\sf\itshape} % = cmss10 at 10.9pt

78

14.3 Configurable Dimensions

In this section we define the spaces to leave in various situations.

All of these spaces are defined as L^{A}TEX2e commands to overcome limitations in length evaluation. For example, if \LeftMarginSBVerse were to be defined as a length, and then immediately set to 4ems the specific length would be evaluated with respect to the current font. This is not be what is desired; instead a length evaluated with respect to the font in place at the start of an SBVerse is what is desired. This can only be done by making these lengths L^{A}TEX2e commands.

79 %%========================================================
80 %%    C O N F I G U R A B L E   D I M E N S I O N S      %
81 %%========================================================

14.3.1 Published Dimensions

While the bulk of the declared dimensions have been created to make the Song♭ook style more user configurable, there are also some dimensions which were created for internal use. This first section describes the user configurable dimensions:

\HangAmt \HangAmt is the amount to indent when a line wraps. This has been defined using \newcommand instead of \newlength so that any unit definitions are evaluated at the time the \HangAmt command is used.

\LeftMarginSBBracket  \LeftMarginSBBracket is the amount of left margin left in front of SBBrackets

and SBBracket*s in the songbook. The value for this variable has been chosen such that the song-words for SBVerses, SBChoruses, and SBBrackets all align against the same left margin when printing standard words & chords songbooks.

\LeftMarginSBChorus \LeftMarginSBChorus is the amount of left margin left in front of named choruses

in the songbook. In most cases \LeftMarginSBChorus, \LeftMarginSBSection,

and \LeftMarginSBVerse should all be the same value.

\LeftMarginSBSection \LeftMarginSBSection is the amount of left margin left in front of sections in the songbook.

\LeftMarginSBVerse \LeftMarginSBVerse is the amount of left margin left in front of verses in the songbook.

\SBChordRaise \SBChordRaise is the distance to raise the chords above the baseline of the text they sit over.

\SBRuleRaiseAmount \SBRuleRaiseAmount is the distance to raise the rule (as specified by \SBIntersyllableRule) which fills the space between adjoining syllables.

\SpaceAboveSTitle  \SpaceAboveSTitle is the space skipped by the \STitle macro before it prints

the song title.

\SpaceAfterTitleBlk \SpaceAfterTitleBlk is the space inserted by the song environment between the title block and the versicles.

\SpaceAfterChorus \SpaceAfterChorus is the vertical space to leave after an SBChorus environment.

\SpaceAfterOpGroup  \SpaceAfterOpGroup is the vertical space to leave after an SBOpGroup environ-

ment.

\SpaceAfterSBBracket  \SpaceAfterSBBracket is the vertical space to leave after an SBBracket environ-

ment. This has proven troublesome to choose (see also \SpaceBeforeSBBracket because the list environment that produces the versicle inside of the SBBracket environment is itself enclosed inside of a math construct (which requires the list to have its vertical spacing supressed—otherwise the vertical line forming the left bracket encloses unnecessary whitespace). The vertical spacing around a list is created by way of some nontrivial macros and can’t simply be copied into some other context. Thus, the choice of values for \SpaceAfterSBBracket and \SpaceBeforeSBBracket have been rather arbitrarily chosen.

\SpaceAfterSection  \SpaceAfterSection is the vertical space to leave after an SBSection environ-

ment.

\SpaceAfterSong \SpaceAfterSong is the vertical space to leave after a song.

\SpaceAfterVerse \SpaceAfterVerse is the vertical space to leave after an SBVerse environment.

\SpaceBeforeSBBracket  \SpaceBeforeBBracket is the vertical space to leave before an SBBracket envi-

ronment. None of the other versicles have an extra space inserted before them. See \SpaceAfterSBBracket for further explanation.

82 \newcommand{\HangAmt}            {1.5em}
83 \newcommand{\LeftMarginSBBracket}{2.85em}
84 \newcommand{\LeftMarginSBChorus} {4em}
85 \newcommand{\LeftMarginSBSection}{\LeftMarginSBChorus}
86 \newcommand{\LeftMarginSBVerse}  {\LeftMarginSBChorus}
87 \newcommand{\SBChordRaise}       {2.25ex}
88 \newcommand{\SBOldChordRaise}    {2.90ex}
89 \newcommand{\SBRuleRaiseAmount}  {0.57ex}
90 \newcommand{\SpaceAboveSTitle}   {0.5in}
91 \newcommand{\SpaceAfterTitleBlk} {-1.75ex}
92 \newcommand{\SpaceAfterChorus}   {\vspace{0ex plus0ex  minus3ex}}
93 \newcommand{\SpaceAfterOpGroup}  {\vspace{0ex plus0ex  minus3ex}}
94 \newcommand{\SpaceAfterSBBracket}{\vspace{2ex plus1ex  minus1ex}}
95 \newcommand{\SpaceAfterSection}  {\vspace{0ex plus0ex  minus3ex}}
96 \newcommand{\SpaceAfterSong}     {\vspace{0ex plus10ex minus3ex}}
97 \newcommand{\SpaceAfterVerse}    {\vspace{0ex plus0ex  minus3ex}}
98 \newcommand{\SpaceBeforeSBBracket}{\vspace{1ex plus1ex  minus1ex}}

99

14.3.2 Internal Dimensions

These variables are used internally within Song♭ook macros. They are not part of the published songbook.sty interface; but can be used to tune some of its functions.

\chSpaceTolerance \chMiniSpace The \chSpaceTolerance and \chMiniSpace lengths are used in the \Chr macro.
\sbBaselineSkipAmt  \sbBaselineSkipAmt is used internally in SBVerse, SBChorus, and all the other

versicle environments; where hanging indentation has been accomplished using a specially defined list environment. The value of \sbBaselineSkipAmt is recalculated immediately before each being used in each hanging indent list.

100 \newlength{\chSpaceTolerance}   \setlength{\chSpaceTolerance}{1.5mm}
101 \newlength{\chMiniSpace}        \setlength{\chMiniSpace}     {0.3mm}
102 \newlength{\sbBaselineSkipAmt}  \setlength{\sbBaselineSkipAmt}{0pt}

103

14.4 Declaration Of Non-Core Options

In the Declaration Of Options section of the .sty file we deal with the various options which a user may specify in the options part of the \usepackage{songbook} command. Since the Song♭ook style accepts standard L^{A}TEX2e papersize options, we deal with those in addition to the style’s own options. The documentation of these options is broken into two parts: the core options (chordbk, wordbk, & overhead), and the non-core options (all the rest).

The L^{A}TEX2e documentation specifies that the options will be processed in the order in which they are listed in the .sty file. We take advantage of this fact and cause all of the options except the core three (chordbk, wordbk, & overhead) to simply set flags which indicate they were user-specified. The core options then do all the work.

104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106 %%                                                      %%
107 %%     D E C L A R A T I O N   O F   O P T I O N S      %%
108 %%                                                      %%
109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

111

14.4.1 Papersize Options

Paper selection options inherited from Book Class. We process these first in order to remember what paper size the user has selected; before processing the Song♭ook’s own options.

The code in each of these \DeclareOption{} clauses sets the \SBpaper… flags to unambiguously indicate which papersize the user specified.

112 %%=======================================================%
113 %%          P A P E R S I Z E   O P T I O N S            %
114 %%=======================================================%
a4paper
115 \DeclareOption{a4paper}{% Paper size: 210mm x 297mm
116 \SBpaperAfourtrue
117 \SBpaperAfivefalse
118 \SBpaperBfivefalse
119 \SBpaperLtrfalse
120 \SBpaperLglfalse
121 \SBpaperExcfalse

122 }

123

a5paper
124 \DeclareOption{a5paper}{% Paper size: 148mm x 210mm
125 \SBpaperAfourfalse
126 \SBpaperAfivetrue
127 \SBpaperBfivefalse
128 \SBpaperLtrfalse
129 \SBpaperLglfalse
130 \SBpaperExcfalse

131 }

132

b5paper
133 \DeclareOption{b5paper}{% Paper size: 176mm x 250mm
134 \SBpaperAfourfalse
135 \SBpaperAfivefalse
136 \SBpaperBfivetrue
137 \SBpaperLtrfalse
138 \SBpaperLglfalse
139 \SBpaperExcfalse

140 }

141

letterpaper
142 \DeclareOption{letterpaper}{% Paper size: 8.5in x 11in
143 \SBpaperAfourfalse
144 \SBpaperAfivefalse
145 \SBpaperBfivefalse
146 \SBpaperLtrtrue
147 \SBpaperLglfalse
148 \SBpaperExcfalse

149 }

150

legalpaper
151 \DeclareOption{legalpaper}{% Paper size: 8.5in x 14in
152 \SBpaperAfourfalse
153 \SBpaperAfivefalse
154 \SBpaperBfivefalse
155 \SBpaperLtrfalse
156 \SBpaperLgltrue
157 \SBpaperExcfalse

158 }

159

executivepaper
160 \DeclareOption{executivepaper}{% Paper size: 7.25in x 10.5in
161 \SBpaperAfourfalse
162 \SBpaperAfivefalse
163 \SBpaperBfivefalse
164 \SBpaperLtrfalse
165 \SBpaperLglfalse
166 \SBpaperExctrue

167 }

168

14.4.2 Compactsong Option

This option tells the Song♭ook style to present the songs in a compact form. For chordbk mode this means presenting the songs in two columns per page using a smaller font. When I can figure out what this option should mean for the other modes I’ll code them up. In the mean time, wordbk and overhead modes simply ignore the compactsong option. Like the papersize options, the compactsong processing here simply sets a flag; the actual code required to implement compactsong mode is embedded below inside the three core options.

169 %%=======================================================%
170 %%         C O M P A C T S O N G   O P T I O N           %
171 %%=======================================================%

compactsong
172 \DeclareOption{compactsong}{%
173 %%%
174 % Set flag to indicate the user wants compact song mode.
175 \CompactSongModetrue

176 }

177

14.5 Declaration Of Core Options

Now we deal with the Options which set up the songbook instances appropriately; i.e., a “words only”, “chords & words”, or “overhead master” book (wordbk, chordbk, & overhead). These option declarations take advantage of the fact that we have already been told what paper size to design for.

The style has been constructed on the underlying assumption that the user must specify one of the core options. To that end, we will later throw an error if none of these three options was executed (done at \AtBeginDocument time, see the top of the Main Code Part for details).

178 %%=======================================================%
179 %%      S O N G B O O K   C O R E   O P T I O N S        %
180 %%=======================================================%

14.5.1 chordbk Option

chordbk The chordbk option is executed here.

Each of the core options is structured similarly. As as result, the documentation for the first one, chordbk, will be more detailed, and the other two subsections will refer to this one.

181 \DeclareOption{chordbk}{%

Set flags to indicate that we are in chordbk mode. Set flags to indicate we are not in words-only mode. Indicate that we do want a page eject after every song.

182 \ChordBktrue
183 \WordBkfalse
184 \Overheadfalse
185 \WordsOnlyfalse
186 \NotWordsOnlytrue
187 \SongEjecttrue

188

Page Layout This first part specifies the page layout considerations.

Page layout usage recommendation: copy the appropriate page layout commands to the preamble of your own document and customize them appropriately. This will over-ride the default layout specified herein. Use a structure like this one to handle the three songbook types automatically for your songbooks:

     \ifChordBk
       <page layout for Words & Chords books>
     \else\ifWordBk
       <page layout for Words Only books>
     \else\ifOverhead
       <page layout for Overhead masters>
     \fi\fi\fi

The only way I found to get these page layouts successfully built was to draw the various frames in a drawing package and then use a combination of page measurements and hand calculations to ensure I had everything done correctly. One of the key concepts that had not been evident to me until just recently was that on even pages the \marginparsep and \marginparwidth variables exist inside the \evensidemargin; this fact is not explicitly mentioned in any L^{A}TEX manual I have read, not even in “The L^{A}TEX Companion”!

The negative \hoffset and \voffset are to overcome the DVI driver default left and top margins of 1in, and all page layout commands herein assume these offsets have been “unset” in this fashion.

189 \voffset=-1.00in
190 \hoffset=-1.00in

191

Papersize-dependant processing. In general we don’t change anything except the page layout, however for smaller page sizes the some of the fonts are reduced to ensure that the songs fit reasonably onto the page.

192 \ifSBpaperAfour
193  \topmargin=0.5in
194  \headheight=0.21in
195  \headsep=0.2in
196  \textheight=10.0in
197  \footskip=0.19in

198 %

199  \oddsidemargin=0.618in
200  \evensidemargin=1.4in
201  \textwidth=6.25in
202  \marginparsep=0.2in
203  \marginparwidth=0.8in
204 \else\ifSBpaperAfive
205  \topmargin=6.0mm
206  \headheight=5.334mm
207  \headsep=2.666mm
208  \textheight=185.17mm
209  \footskip=4.826mm

210 %

211  \oddsidemargin=12.0mm
212  \evensidemargin=30.0mm
213  \textwidth=106.0mm
214  \marginparsep=3.68mm
215  \marginparwidth=20.32mm

Downsize the fonts to allow song to fit into the smaller A5 papersize.

216  \renewcommand{\ChBassFont}{\small\bf\sf}        % = cmss12 at 11.0pt
217  \renewcommand{\ChFont}{\normalsize\fontfamily{\sfdefault}%
218  \fontseries{sbc}\fontshape{n}\selectfont}     %=cmssbc12 at 12.0pt
219  \renewcommand{\ChBkFont}{\ChFont\fontseries{m}  %
220  \selectfont}                                  % =cmssm12 at 12.0pt
221  \renewcommand{\SBDefaultFont}{\normalsize}      % = cmr12  at 12.0pt
222  \renewcommand{\SBOccursBrktFont}{\large\bf\sf}  % = cmss10 at 10.9pt
223 \else\ifSBpaperBfive
224  \topmargin=10.0mm
225  \headheight=5.334mm
226  \headsep=5.0mm
227  \textheight=214.84mm
228  \footskip=4.826mm

229 %

230  \oddsidemargin=20.0mm
231  \evensidemargin=34.0 mm
232  \textwidth=122.0mm
233  \marginparsep=3.68mm
234  \marginparwidth=20.32mm

Downsize the fonts to allow song to fit into the smaller B5 papersize.

235  \renewcommand{\ChBassFont}{\small\bf\sf}        % = cmss12 at 11.0pt
236  \renewcommand{\ChFont}{\normalsize\fontfamily{\sfdefault}%
237  \fontseries{sbc}\fontshape{n}\selectfont}     %=cmssbc12 at 12.0pt
238  \renewcommand{\ChBkFont}{\ChFont\fontseries{m}  %
239  \selectfont}                                  % =cmssm12 at 12.0pt
240  \renewcommand{\SBDefaultFont}{\normalsize}      % = cmr12  at 12.0pt
241  \renewcommand{\SBOccursBrktFont}{\large\bf\sf}  % = cmss10 at 10.9pt
242 \else\ifSBpaperLtr
243  \topmargin=0.5in
244  \headheight=0.21in
245  \headsep=0.20in
246  \textheight=9.4in

247  \footskip=0.19in

248 %

249  \oddsidemargin=0.75in
250  \evensidemargin=1.5in
251  \textwidth=6.25in
252  \marginparsep=0.2in
253  \marginparwidth=0.8in
254 \else\ifSBpaperLgl
255  \topmargin=0.5in
256  \headheight=0.21in
257  \headsep=0.20in
258  \textheight=12.4in
259  \footskip=0.19in

260 %

261  \oddsidemargin=0.75in
262  \evensidemargin=1.5in
263  \textwidth=6.25in
264  \marginparsep=0.2in
265  \marginparwidth=0.8in
266 \else\ifSBpaperExc
267  \topmargin=0.25in
268  \headheight=0.21in
269  \headsep=0.165in
270  \textheight=9.435in
271  \footskip=0.19in

272 %

273  \oddsidemargin=0.5in
274  \evensidemargin=1.25in
275  \textwidth=5.5in
276  \marginparsep=0.2in
277  \marginparwidth=0.8in
278 \fi\fi\fi\fi\fi\fi

279

Enable ragged bottom.

280 \raggedbottom

281

CompactSong Processing Downsize fonts to allow song to fit into half the space (i.e., two column mode); although the title will not be reset since it will be presented unchanged from normal chordbk mode.

282 \ifCompactSongMode
283  \renewcommand{\ChBassFont}{\small\bf\sf}        % = cmss12 at 11.0pt
284  \renewcommand{\ChFont}{\normalsize\fontfamily{\sfdefault}%
285  \fontseries{sbc}\fontshape{n}\selectfont}     %=cmssbc12 at 12.0pt
286  \renewcommand{\ChBkFont}{\ChFont\fontseries{m}  %
287  \selectfont}                                  % =cmssm12 at 12.0pt
288  \renewcommand{\SBDefaultFont}{\normalsize}      % = cmr12  at 12.0pt
289  \renewcommand{\SBOccursBrktFont}{\large\bf\sf}  % = cmss10 at 10.9pt

290

Multicol specific changes.

291  \setlength{\columnsep}{0.25in}

292

Remove side-margin, since marginal notes are not allowed when using multicol.sty.

293  \addtolength{\textwidth}     {\marginparsep + \marginparwidth}
294  \addtolength{\evensidemargin}{-\marginparsep - \marginparwidth}
295  \setlength  {\marginparsep}  {0in}
296  \setlength  {\marginparwidth}{0in}

297

Reduce minimum spacing amount used in \Chr macro (since we’re now using a smaller font for lyrics and chords.

298  \setlength{\chSpaceTolerance}{1.0mm}

299

Remove the extra space before Verses, etc.

300  \renewcommand{\HangAmt}            {1.5em}
301  \renewcommand{\LeftMarginSBChorus} {2em}
302  \renewcommand{\LeftMarginSBSection}{\LeftMarginSBChorus}
303  \renewcommand{\LeftMarginSBVerse}  {\LeftMarginSBChorus}
304 \fi

305 }

306

14.5.2 wordbk Option

wordbk The wordbk option is executed here.

307 \DeclareOption{wordbk}{%

Set flags to indicate we are in wordbk mode. Set flags to indicate we are in words-only mode. Indicate that we do not want a page eject after every song.

308 \ChordBkfalse
309 \WordBktrue
310 \Overheadfalse
311 \WordsOnlytrue
312 \NotWordsOnlyfalse
313 \SongEjectfalse

314

Set fonts for wordbk use.

315 \renewcommand{\SBDefaultFont}{\normalsize}
316 \font\mySTNFont=cmtt12 at 17pt
317 \renewcommand{\STitleNumberFont}{\mySTNFont}
318 \renewcommand{\CpyRtFont}{\scriptsize}
319 \renewcommand{\WandMFont}{\scriptsize}
320 \renewcommand{\ScriptRefFont}{\scriptsize}
321 \renewcommand{\SBOccursBrktFont}{\large\bf\sf}

322

Reset a few of the song spacing amounts.

323 \renewcommand{\SpaceAboveSTitle}   {0.25in}
324 \renewcommand{\LeftMarginSBChorus} {1.5em}
325 \renewcommand{\LeftMarginSBSection}{\LeftMarginSBChorus}
326 \renewcommand{\LeftMarginSBVerse}  {\LeftMarginSBChorus}

327

See the page layout comment in the \DeclareOption{chordbk} section, above, for usage recommendations w.r.t. page layout commands.

The negative \hoffset and \voffset are to overcome the DVI driver default left and top margins of 1in, and all page layout commands herein assume these offsets have been “unset” in this fashion.

328 \voffset=-1.00in
329 \hoffset=-1.00in

330

Papersize-dependant processing.

331 \ifSBpaperAfour
332  \topmargin=0.5in
333  \headheight=0.21in
334  \headsep=0.2in
335  \textheight=10.0in
336  \footskip=0.19in

337 %

338  \oddsidemargin=0.618in
339  \evensidemargin=0.4in
340  \textwidth=7.25in
341  \marginparsep=0.0in
342  \marginparwidth=0.0in
343 \else\ifSBpaperAfive
344  \topmargin=6.0mm
345  \headheight=5.334mm
346  \headsep=2.666mm

347  \textheight=185.17mm
348  \footskip=4.826mm

349 %

350  \oddsidemargin=12.0mm
351  \evensidemargin=6.0mm
352  \textwidth=130.0mm
353  \marginparsep=0.0mm
354  \marginparwidth=0.0mm
355 \else\ifSBpaperBfive
356  \topmargin=10.0mm
357  \headheight=5.334mm
358  \headsep=5.0mm
359  \textheight=214.84mm
360  \footskip=4.826mm

361 %

362  \oddsidemargin=20.0mm
363  \evensidemargin=10.0mm
364  \textwidth=146.0mm
365  \marginparsep=0.0mm
366  \marginparwidth=0.0mm
367 \else\ifSBpaperLtr
368  \topmargin=0.5in
369  \headheight=0.21in
370  \headsep=0.10in
371  \textheight=9.4in
372  \footskip=0.29in

373 %

374  \oddsidemargin=0.75in
375  \evensidemargin=0.5in
376  \textwidth=7.25in
377  \marginparsep=0.0in
378  \marginparwidth=0.0in
379 \else\ifSBpaperLgl
380  \topmargin=0.5in
381  \headheight=0.21in
382  \headsep=0.20in
383  \textheight=12.4in
384  \footskip=0.19in

385 %

386  \oddsidemargin=0.75in
387  \evensidemargin=0.5in
388  \textwidth=7.25in
389  \marginparsep=0.0in
390  \marginparwidth=0.0in
391 \else\ifSBpaperExc
392  \topmargin=0.25in
393  \headheight=0.21in
394  \headsep=0.165in
395  \textheight=9.435in
396  \footskip=0.19in

397 %

398  \oddsidemargin=0.5in
399  \evensidemargin=0.25in
400  \textwidth=6.5in
401  \marginparsep=0.0in
402  \marginparwidth=0.0in
403 \fi\fi\fi\fi\fi\fi

404

Set ragged-right margins.

405 \raggedright

406

Do CompactSong processing, which at this time is nothing except resetting the compactsong flag back to false; to ensure that no compactsong processing occurs. We take time to print a warning message for the user to remind them that the compactsong option will not have any effect at this time.

407 \ifCompactSongMode
408  \typeout{``compactsong'' mode not implemented for Wordbk mode.}
409  \CompactSongModefalse

410 \fi

411 }

412

14.5.3 overhead Option

overhead The wordbk option is executed here.

413 \DeclareOption{overhead}{%

Set flags to indicate we are in overhead mode. Set flags to indicate we are in words-only mode. Indicate that we do want a page eject after every song.

414 \ChordBkfalse
415 \WordBkfalse
416 \Overheadtrue
417 \WordsOnlytrue
418 \NotWordsOnlyfalse
419 \SongEjecttrue

420

Set fonts for overhead use. Before doing any font stuff, change the regular sans serif font to demi-bold condensed.

421 \def\@mss{cmssdc10}
422 \renewcommand{\SBDefaultFont}{\LARGE\bf\sf}
423 \renewcommand{\STitleNumberFont}{\Large\sf}
424 \renewcommand{\STitleFont}{\LARGE\sf}
425 \renewcommand{\CpyRtFont}{\normalsize\rm}
426 \renewcommand{\CpyRtInfoFont}{\normalsize\rm}
427 \renewcommand{\WandMFont}{\normalsize\rm}
428 \renewcommand{\ScriptRefFont}{\normalsize\rm}
429 \renewcommand{\SBLyricNoteFont}{\normalsize\rm}
430 \renewcommand{\SBChorusTagFont}{\Large\sf}
431 \renewcommand{\SBVerseNumberFont}{\Large\sf}
432 \renewcommand{\SBSectionNumberFont}{\Large\sf}
433 \renewcommand{\SBOccursTagFont}{\Large\sf}
434 \renewcommand{\SBOccursBrktFont}{\huge\sf}
435 \renewcommand{\SBBracketTagFont}{\Large\sf}
436 \renewcommand{\SBOHContTagFont}{\Large\sf\itshape}

437

Reset a few of the song spacing amounts.

438 \renewcommand{\SpaceAboveSTitle}   {0.25in}
439 \renewcommand{\LeftMarginSBBracket}{2.25em}
440 \renewcommand{\LeftMarginSBChorus} {1.5em}
441 \renewcommand{\LeftMarginSBSection}{\LeftMarginSBChorus}
442 \renewcommand{\LeftMarginSBVerse}  {\LeftMarginSBChorus}

443

Reset the . For some reason I’m not getting good results with the default value.

444 \renewcommand{\baselinestretch}{.9}

445

See the page layout comment in the \DeclareOption{chordbk} section, above, for usage recommendations w.r.t. page layout commands.

General note re: \textwidth and overhead tranparencies: it is my personal experience that with font sizes used in overhead mode, a \textwidth of greater than 6in produces too wide an image for use in all situations. Depending upon how you intend to use your overheads, you may be able to use a wider image, however if you are uncertain I strongly recommend you stick with the 6in \textwidth that is specified herein.

The negative \hoffset and \voffset are to overcome the DVI driver default left and top margins of 1in, and all page layout commands herein assume these offsets have been “unset” in this fashion.

446 \voffset=-1.00in
447 \hoffset=-1.00in

448

Papersize-dependant processing.

449 \ifSBpaperAfour
450  \topmargin=0.25in
451  \headheight=0.25in
452  \headsep=0.0in
453  \textheight=10.3in
454  \footskip=0.2in

455 %

456  \oddsidemargin=1.134in
457  \evensidemargin=1.134in
458  \textwidth=6.0in
459  \marginparsep=0.0in
460  \marginparwidth=0.0in
461 \else\ifSBpaperAfive
462  \topmargin=0.0mm
463  \headheight=5.334mm
464  \headsep=0.0mm
465  \textheight=193.666mm
466  \footskip=4.826mm

467 %

468  \oddsidemargin=9.0mm
469  \evensidemargin=9.0mm
470  \textwidth=130.0mm
471  \marginparsep=0.0mm
472  \marginparwidth=0.0mm
473 \else\ifSBpaperBfive
474  \topmargin=0.666mm
475  \headheight=5.334mm
476  \headsep=0.0mm
477  \textheight=229.0mm
478  \footskip=4.826mm

479 %

480  \oddsidemargin=15.0mm
481  \evensidemargin=15.0mm
482  \textwidth=146.0mm
483  \marginparsep=0.0mm
484  \marginparwidth=0.0mm
485 \else\ifSBpaperLtr
486  \topmargin=0.25in
487  \headheight=0.25in
488  \headsep=0.0in
489  \textheight=9.75in
490  \footskip=0.2in

491 %

492  \oddsidemargin=1.25in
493  \evensidemargin=1.25in
494  \textwidth=6.0in
495  \marginparsep=0.0in
496  \marginparwidth=0.0in
497 \else\ifSBpaperLgl
498  \topmargin=0.25in
499  \headheight=0.25in
500  \headsep=0.0in
501  \textheight=12.8in
502  \footskip=0.2in

503 %

504  \oddsidemargin=1.25in
505  \evensidemargin=1.25in
506  \textwidth=6.0in
507  \marginparsep=0.0in
508  \marginparwidth=0.0in
509 \else\ifSBpaperExc
510  \topmargin=0.25in
511  \headheight=0.21in
512  \headsep=0.0in
513  \textheight=9.6in
514  \footskip=0.19in

515 %

516  \oddsidemargin=0.625in
517  \evensidemargin=0.625in
518  \textwidth=6.0in

519  \marginparsep=0.0in
520  \marginparwidth=0.0in
521 \fi\fi\fi\fi\fi\fi

522

Set ragged-botton and ragged-right margins.

523 \raggedright
524 \raggedbottom

525

Do CompactSong processing, which at this time is nothing except resetting the compactsong flag back to false; to ensure that no compactsong processing occurs. We take time to print a warning message for the user to remind them that the compactsong option will not have any effect at this time.

526 \ifCompactSongMode
527  \typeout{``compactsong'' mode not implemented for Overhead mode.}
528  \CompactSongModefalse
529 \fi

530 }

531

14.6 Execution Of Options

Here we tell the the Song♭ook style to execute the user’s declared options.

First set up a default paper size, just in case the user didn’t specify one. Then process the user specified options. It is mandatory for one of the songbook type options to be declared, but rather than delare a default we will throw an error (see below at the top of the Main Code Part).

532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
534 %%                                                      %%
535 %%       E X E C U T I O N   O F   O P T I O N S        %%
536 %%                                                      %%
537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

539

540 \ExecuteOptions{letterpaper}
541 \ProcessOptions

542

14.7 Package Loading Part

In this section of the style we load the remaining styles upon which the Song♭ook style is dependant.

543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
545 %%                                                      %%
546 %%       P A C K A G E   L O A D I N G   P A R T        %%
547 %%                                                      %%
548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

550

Donald Arseneau’s conditionals.sty. This style is bundled with the Song♭ook style (Donald has often posted the macros to the USENET comp.text.tex newsgroup, but they haven’t been formally submitted to CTAN.

551 \RequirePackage{conditionals}

552

Leslie Lamport’s & David Carlilse’s ifthen.sty. This style is part of the L^{A}TEX2e distribution.

553 \RequirePackage{ifthen}

554

If we are in compactsong mode then load Frank Mittelbach’s multicol package. We specify the date of the 1.5u release; since we make use of the \columnbreak command which was only added in 1.5u.

555 \ifCompactSongMode
556 \RequirePackage{multicol}[1999/05/25]
557 \fi

558

14.8 Main Code Part

The Main Code Part is the main part of the style. All of the “hard working” macros are detailed below.

559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
561 %%                                                      %%
562 %%              M A I N   C O D E   P A R T             %%
563 %%                                                      %%
564 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

566

The user must specify at least one of the chordbk, wordbk, or overhead options; otherwise we throw an error. This bit of code performs that check at the start of the users document.

We check to see if at least one of the core options have been specified by the user by populating an \hbox{} with the digit “1” if an option was specified. If no core option was specified then the \hbox{} will be empty and we throw an error.

\AtBeginDocument
567 \AtBeginDocument{%
568 \setbox0=\hbox{}

569 %

570 \ifChordBk\setbox0=\hbox{1}\fi
571 \ifWordBk\setbox0=\hbox{1}\fi
572 \ifOverhead\setbox0=\hbox{1}\fi

573 %

574 \ifthenelse{\wd0 = 0}
575  {\errmessage{No songbook option (i.e., type) specified.
576  Specify a songbook mode in your usepackage
577  statement; one of: [chordbk], [wordbk], or [overhead]}}
578  {\relax}

579

If the user had specified one of the required options then we continue with setting things up. At present, the only housekeeping item that needs attention is to set the default font for the songbook. We do this by inserting the \SBDefaultFont here; this lifts from the user the burden of having to remember to specifying inside the songbook.

580 \SBDefaultFont

581 }

582

14.8.1 Constants & Variables

Define Counters used herein.

583 %%========================================================
584 %%      C O N S T A N T S   &   V A R I A B L E S        %
585 %%========================================================

586

\theSBSongCnt The \theSBSongCnt counter is used for numbering the songs. When a song is listed multiple times (for multiple keys) the songs number must remain the same each time.

\theSBSectionCnt The \theSBSectionCnt counter is used for numbering sections as they occur within a song.

\theSBVerseCnt The \theSBVerseCnt counter is used for numbering verses as they occur within a song.

587 \newcounter{SBSongCnt}
588 \newcounter{SBSectionCnt}
589 \newcounter{SBVerseCnt}

590

String Constants Declare string constants.

These constants are provided so that users may easily customize the appearance of formatted songs and songbooks. Use the \renewcommand command to change the value of these constants.

\OHContPgFtrTag The \OHContPgFtrTag tag is inserted by the \OHContPgFtr command. The de-
fault value for this is “continued on next page\ldots”.
\OHContPgHdrTag The \OHContPgHdrTag tag is inserted by the \OHContPgHdr command. The de-
fault value for this is “\theSBSongCnt\ --- \theSongTitle, continued\ldots”.

\SBBridgeTag The \SBBridgeTag tag is inserted before the start of a bridge. The default value for this is “Bridge:”.

\SBChorusTag The \SBChorusTag tag is inserted before the first line of a chorus. The default value for this is “Ch:”.

\SBContinueTag The \SBContinueTag tag is inserted in an \SBContinueMark. The default value

for this is “cont\ldots”.

\SBEndTag The \SBEndTag tag is inserted before the start of an ending (in an \SBEnd command). The default value for this is “End:”.

\SBIntersyllableRule The \SBIntersyllableRule tag is actually the command(s) used to draw the rule between adjoining syllables.

\SBIntroTag The \SBIntroTag tag is inserted before the start of an introduction (in an \SBIntro command). The default value for this is “Intro:”.

\SBPubDom The \SBPubDom tag is used to indicate that a song is in the public domain. The default value for this is “Public Domain”. If you want to localize this string in the song title block, be sure to use this public interface: the \CpyRt macro uses \SBPubDom to determine whether or not to print the copyright symbol (\begin{matrix}c \\ ◯ \end{matrix}).

\SBUnknownTag The \SBUnknownTag tag is used with the \WAndM command and is the string to insert when either the author/artist or the copyright holder is unknown. The default value for this is “Unknown”.

\SBWAndMTag The \SBWAndMTag the tag is insert before the words and music entry printed in the song header. The default value for this is “W&M:”.

\Songbook The macro used to print this style’s name. The ‘b’ in the word songbook has been replace with a flat (♭).

591 \newcommand{\OHContPgFtrTag}     {continued on next page\ldots}
592 \newcommand{\OHContPgHdrTag}     {\theSBSongCnt\ --- \theSongTitle, continued\ldots}
593 \newcommand{\SBBridgeTag}        {Bridge:}
594 \newcommand{\SBChorusTag}        {Ch:}
595 \newcommand{\SBContinueTag}      {cont\ldots}
596 \newcommand{\SBEndTag}           {End:}
597 \newcommand{\SBIntersyllableRule}{\hrulefill}
598 \newcommand{\SBIntroTag}         {Intro:}

599 \newcommand{\SBPubDom}           {Public Domain}
600 \newcommand{\SBUnknownTag}       {Unknown}
601 \newcommand{\SBWAndMTag}         {W\&M:}
602 \newcommand{\Songbook}           {\textrm{Song$\flat$ook}}

603

Internal Song Variables Declare song attribute variables.

These variables are intended for consumption within the songbook style itself, so they will not be documented in the High Level Documentation section, above.

\theSongComposer \theSongComposer is the composer and lyricist of the last song.

\theSongKey \theSongKey is the key of the last song. This variable must be reset within the \STitle command, as well as at the start of the song environment, because of the way in which extra keys are handled.

\theSongLicense  \theSongLicense is the copyright license info.
\theSongTitle  \theSongTitle is the title of the last song.

\theCopyRtInfo \theCopyRtInfo is the copyright information of the last song. This includes the copyright licensing information.

\theScriptureRef \theScriptureRef is the scripture reference of the last song.

\theXlatnBy \theXlatnBy is who translated the song.

\theXlatnPerm \theXlatnPerm is the permission details for the last song translation. This variable is reset to an empty string at the start of each song environment.

\theXlatnTitle \theXlatnTitle is the title of the last song-translation. This variable is reset to an empty string at the start of each song environment.

604 \newcommand{\theSongComposer}{the Composer}
605 \newcommand{\theSongCopyRt}{the Copyright}
606 \newcommand{\theSongKey}{the Key}
607 \newcommand{\theSongLicense}{the License}
608 \newcommand{\theSongScriptRef}{the Scripture}
609 \newcommand{\theSongTitle}{the Title}
610 \newcommand{\theXlatnBy}{the Translator}
611 \newcommand{\theXlatnPerm}{the Permission}
612 \newcommand{\theXlatnTitle}{the Translation Title}

613

14.8.2 Special Characters

Some macros to ease the entry of special characters in songbooks.

614 %%=======================================================%
615 %%          S P E C I A L   C H A R A C T E R S          %
616 %%=======================================================%

617

\SBem \SBem — em-dash macro definition.

Parameters: None.

Generate an em-dash within a songbook. This macro is used to place in emdash within text when we’re not in words-only mode. This allows us to place dashes within text in order place a chord earlier than a sylable; yet, that dash will not appear in the words-only book. The words-only version of this macro is a no-op. Example of intended use:

618 \newcommand{\SBem}{\ifWordsOnly\relax\else---\fi}

619

\SBen \SBen — en-dash macro definition.

Parameters: None.

Generate an en-dash within a songbook. This macro is used to place in en-dash within text when we’re not in words-only mode; just like \SBem. The words-only version of this macro is a no-op.

620 \newcommand{\SBen}{\ifWordsOnly\relax\else--\fi}

621

\SBContinueMark \SBContinueMark — conditionally produce a continuation symbol.

Parameters: None.

If the contents of \rightmark will result in nothing being typeset, then don’t output the continuation mark; otherwise, output a continuation mark using the

\SBContinueTag command.
622 \newcommand{\SBContinueMark}{%
623 \setbox0=\hbox{\rightmark}
624 \ifthenelse{\lengthtest{\wd0 = 0pt}}
625 {\relax}%
626 {\SBContinueTag}%

627 }

628

\OHContPgFtr \OHContPgFtr — macro to print page footing continuation headers on overheads.

Parameters: None.

This macro must be manually inserted where needed. It is generally used in

conjunction with the \OHPageBrk and \OHPageHdr macros. \OHContPgFtr is a

no-op, except when \ifOverhead is true.

629 \newcommand{\OHContPgFtr}{%
630 \ifOverhead
631  \vskip .25in
632  \centerline{\SBOHContTagFont\OHContPgFtrTag}
633 \else%
634  \relax%
635 \fi}

\OHContPgHdr \OHContPgHdr — macro to print page heading continuation headers on overheads.

Parameters: None.

This macro must be manually inserted where needed. It is generally used in conjunction with the \OHPageBrk macro. \OHContPgHdr is a no-op, except when

\ifOverhead is true.
636 \newcommand{\OHContPgHdr}{%
637 \ifOverhead
638  \centerline{\SBOHContTagFont\OHContPgHdrTag}
639  \vskip .25in
640 \else%
641  \relax%
642 \fi}

643

14.8.3 Table Of Contents & Indices

The macros used to create the Key Index, the Title & First Line Index, and the Table Of Contents. Planned enhancements are the addition of a Scripture Index and a Artist Index; i.e., an index of the \ScriptRef{} and \WandM{} entries, respectively.

644 %%=======================================================%
645 %%          T A B L E   O F   C O N T E N T S            %

646 %%                                                       %
647 %%                A N D   I N D I C E S                  %
648 %%=======================================================%

\makeKeyIndex \makeKeyIndex starts the creation of an index of songs by key.

Parameters: None.

Note, this code was borrowed from latex.tex.

649 \def\makeKeyIndex{\if@filesw \newwrite\@keyIndexfile
650 \immediate\openout\@keyIndexfile=\jobname.kIdx
651 \def\keyIndex{\@bsphack\begingroup
652  \def\protect####1{\string####1\space}\@sanitize
653  \@wrKeyIndex}\typeout
654 {Writing index file \jobname.kIdx }\fi}

655

\keyIndex \keyIndex[⟨1 ⟩][⟨2 ⟩] makes an entry in the index of songs by key. Parameters: ⟨1 ⟩ Song key and title. ⟨2 ⟩ Song number.

This code was also borrowed from latex.tex.

656 \def\@wrKeyIndex#1#2{\let\thepage\relax
657 \xdef\@gtempa{\write\@keyIndexfile{\string
658  \indexentry{#1}{#2}}}\endgroup\@gtempa
659 \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}

660

661 \def\keyIndex{\@bsphack\begingroup \@sanitize\@keyIndex}

662

663 \def\@keyIndex#1#2{\endgroup\@esphack}

664

\makeTitleIndex \makeTitleIndex starts creation of a title & first line index.

Parameters: None.

This code was taken from latex.tex.

665 \def\makeTitleIndex{\if@filesw \newwrite\@titleIndexfile
666 \immediate\openout\@titleIndexfile=\jobname.tIdx
667 \def\titleIndex{\@bsphack\begingroup
668  \def\protect####1{\string####1\space}\@sanitize
669  \@wrTitleIndex}\typeout
670 {Writing index file \jobname.tIdx }\fi}

671

\titleIndex \titleIndex[⟨1 ⟩][⟨2 ⟩] makes an entry in the title & first line index. Parameters: ⟨1 ⟩ Song title or first line. ⟨2 ⟩ Song number. This code is from latex.tex.

672 \def\@wrTitleIndex#1#2{\let\thepage\relax
673 \xdef\@gtempa{\write\@titleIndexfile{\string
674  \indexentry{#1}{#2}}}\endgroup\@gtempa
675 \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}

676

677 \def\titleIndex{\@bsphack\begingroup \@sanitize\@titleIndex}

678

679 \def\@titleIndex#1#2{\endgroup\@esphack}

680

\makeTitleContents  \makeTitleContents starts creation of a table of contents.

Parameters: None.

This code is taken from latex.tex.

681 \def\makeTitleContents{\if@filesw \newwrite\@titleContentsfile
682 \immediate\openout\@titleContentsfile=\jobname.toc
683 \def\titleContents{\@bsphack\begingroup
684  \def\protect####1{\string####1\space}\@sanitize
685  \@wrTitleContents}\typeout
686 {Writing table of contents file \jobname.toc }\fi}

687

\titleContents \titleContents[⟨1 ⟩][⟨2 ⟩] makes an entry in the table of contents file. Parameters: ⟨1 ⟩ Song number. ⟨2 ⟩ Song title.

This code is stolen from latex.tex.

688 \def\@wrTitleContents#1#2{\let\thepage\relax
689 \xdef\@gtempa{\write\@titleContentsfile{\string
690  \item\ \theSBSongCnt. #1\protect\hbox{, \thepage}}}\endgroup\@gtempa
691 \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}

692

693 \def\titleContents{\@bsphack\begingroup \@sanitize\@titleContents}

694

695 \def\@titleContents#1#2{\endgroup\@esphack}

696

\FLineIdx \FLineIdx[⟨1 ⟩] adds a first line of song entry to the song & title index file (.idx). Parameters: ⟨1 ⟩ First line of song.

697 \newcommand{\FLineIdx}[1]{\titleIndex{#1@{\it #1\/}}{\theSBSongCnt}}

698

14.8.4 Some Other Hooks

The macros have been provided to allow the user additional control of songbooks created by the Song♭ook package.

699 %%=======================================================%
700 %%           S O M E   O T H E R   H O O K S             %
701 %%=======================================================%

702

\SBChorusMarkright The \SBChorusMarkright[⟨1 ⟩] hook to allow \SBSection’s \markright to be

overridden.

703 \newcommand{\SBChorusMarkright}[1]{\markright{#1}}

704

\SBVerseMarkright The \SBVerseMarkright[⟨1 ⟩] hook to allow \SBVerse’s \markright to be over-

ridden.

705 \newcommand{\SBVerseMarkright}[1]{\markright{#1}}

706

\SBSectionMarkright The \SBSectionMarkright[⟨1 ⟩] hook to allow \SBSection’s \markright to be

overridden.

707 \newcommand{\SBSectionMarkright}[1]{\markright{\alph{#1}}}

708

\SongMarkboth The \SongMarkboth[⟨1 ⟩][⟨2 ⟩] hook to allow the song environment’s \markboth to be overridden.

709 \newcommand{\SongMarkboth}[2]{\markboth{#1}{#2}}

710

\STitleMarkboth The \STitleMarkboth[⟨1 ⟩][⟨2 ⟩] hook to allow \Stitle’s \markboth to be over-

ridden.

711 \newcommand{\STitleMarkboth}[2]{\markboth{#1}{#2}}

712

14.8.5 Miscellaneous Macros

This section contains a few miscellaneous macros used by the main macros that then follow.

713 %%=======================================================%
714 %%       M I S C E L L A N E O U S   M A C R O S         %
715 %%=======================================================%

716

\CpyRt The \CpyRt[⟨1 ⟩][⟨2 ⟩][⟨3 ⟩] copyright info. macro definition. Parameters: ⟨1 ⟩ Centre this line Y/N? (optional) ⟨2 ⟩ Copyright information. ⟨3 ⟩ Copyright licensing information.

This command is not usually explicitly used in a songbook. It is called by the song environment and will normally only be used there.

The first parameter to this macro is optional and is used to surpress the centering of the Scripture reference (i.e., if the parameter is specified, and that value is not ‘Y’ then the center environment will not be created around the reference.

717 \newcommand{\CpyRt}[3][Y]{%
718 \if#1Y\begin{center}\fi
719  \if\blank{#2}%
720  \if\blank{#3}%
721  {\CpyRtFont\copyright \SBUnknownTag{} \CpyRtInfoFont}%
722  \else
723  {\CpyRtFont\copyright \SBUnknownTag{} \CpyRtInfoFont #3}%
724  \fi%
725  \else%
726  \ifthenelse{\equal{#2}{\SBPubDom}}
727  {%then
728  {\CpyRtFont #2 \CpyRtInfoFont #3}%
729  }{%else
730  {\CpyRtFont\copyright #2 \CpyRtInfoFont #3}%
731  }%fi
732  \fi%
733 \if#1Y\end{center}\fi

734 }

735

\ScriptRef The \ScriptRef[⟨1 ⟩][⟨2 ⟩] macro indicates a scripture reference. Parameters: ⟨1 ⟩ Centre this line Y/N? (optional) ⟨2 ⟩ Address of scripture reference for the song.

Used to indicate a scripture reference for the song. May either be the scripture being quoted in the song, or a scripture which supports the theology presented in the song.

The first parameter to this macro is optional and is used to surpress the centering of the Scripture reference (i.e., if the parameter is specified, and that value is not ‘Y’ then the center environment will not be created around the reference.

736 \newcommand{\ScriptRef}[2][Y]{%
737 \if#1Y\begin{center}\fi
738  {\ScriptRefFont #2}%
739 \if#1Y\end{center}\fi

740 }

741

\WAndM The \WAndM[⟨1 ⟩][⟨2 ⟩] macro indicates Words and Music authorship. Parameters: ⟨1 ⟩ Centre this line Y/N? (optional) ⟨2 ⟩ Name(s) of the composer and lyricist.

This command is not usually explicitly used in a songbook. It is called by the song environment and will normally only be used there.

The first parameter to this macro is optional and is used to surpress the centering of the composer & lyricist (i.e., if the parameter is specified, and that value is not ‘Y’ then the center environment will not be created around the composer & lyricist.

742 \newcommand{\WAndM}[2][Y]{%
743 \if#1Y\begin{center}\fi
744  \if\blank{#2}%
745  {\WandMFont\SBWAndMTag ~\SBUnknownTag}%
746  \else
747  {\WandMFont\SBWAndMTag ~#2}%
748  \fi
749 \if#1Y\end{center}\fi

750 }

751

\sbSetsbBaselineSkipAmt  \sbSetsbBaselineSkipAmt sets the \sbBaselineSkipAmt length.

Parameters: None.

This command is only used internally within the songbook style. It is invoked just prior to any use of the sbBaselineSkipAmt length and it calculated the proper value based upon all the fonts chosen at that particular moment in time. It does this by creating an \hbox{} that contains one letter with a chord overtop of it; the height and depth of that \hbox{} added together then become the baseline skip.

752 \newcommand{\sbSetsbBaselineSkipAmt}{
753 \ifChordBk%
754  \setbox0=\hbox{\strut\raise\SBChordRaise\hbox{\ChFont\sbChord{}A\relax\strut}A}%
755  \setlength{\sbBaselineSkipAmt}{\ht0 + \dp0}%
756 \else%
757  \setlength{\sbBaselineSkipAmt}{\baselineskip}%
758 \fi%

759 }

760

14.8.6 Primary Songbook Macros

The macros in this section comprise those most often used by Song♭ook users.

761 %%=======================================================%
762 %%    P R I M A R Y   S O N G B O O K   M A C R O S      %
763 %%=======================================================%

764

\STitle \STitle[⟨1 ⟩][⟨2 ⟩][⟨3 ⟩] is the song title macro. Parameters: ⟨1 ⟩ Centre this line Y/N? (optional) ⟨2 ⟩ Song’s title. ⟨3 ⟩ Song’s Key.

Before printing the title we reset the \SBVerseCnt and \SBSectionCnt counters back to zero. This is for songs which are printed in more than one key, because the verse count always begins at “1.” for each key.

The first parameter to this macro is optional and is used to surpress the centering of the title (i.e., if the parameter is specified, and that value is not ‘Y’ then the center environment will not be created around the title.

This macro also makes an entry in the table of contents.

765 \newcommand{\STitle}[3][Y]{%
766 \setcounter{SBVerseCnt}{0}%
767 \setcounter{SBSectionCnt}{0}%
768 \keyIndex{{\protect\sbChord#3\protect\relax} -- #2}{\theSBSongCnt}%
769 \vspace{\SpaceAboveSTitle}%
770 \if#1Y\begin{center}\fi
771  {\STitleNumberFont\theSBSongCnt}{\STitleFont\ --- #2}%
772  \ifWordsOnly\relax\else{\STitleKeyFont\ [{\sbChord#3\relax}]}\fi%

773 \if#1Y\end{center}\fi
774 \STitleMarkboth{#2}{\relax}%

775 }

776

song song[⟨1 ⟩]… [⟨6 ⟩] is the environment within which a song is entered. Parameters: ⟨1 ⟩ Title of song. ⟨2 ⟩ Key song is written in. ⟨3 ⟩ Copyright information. ⟨4 ⟩ Name(s) of composer and lyricist. ⟨5 ⟩ Scripture reference for the song. ⟨6 ⟩ Copyright licensing information.

The song environment encapsulates a song, including multiple appearances for multiple keys and translations. We increment the song counter and then cause the title and other parameter information to be displayed.

777 \newenvironment{song}[6]{                       % Comment markers to negate
778 \SongMarkboth{\relax}{\relax}                 % the newline.
779 \SBinSongEnvtrue                              %
780 \renewcommand{\SBinSongEnv}{\True}            %
781 \ifWordsOnly                                  %
782  \setlength{\parindent}{0pt}                 %
783 \fi                                           %

Store each of the parameters in a macro to make them easily accessible later. This isn’t as useful as it should be due to my inability to properly detect in the title block macros whether or not the parameter is nil or blank when one of these \the macros is passed instead of the native parameter itself.

We clear the translation macros now, since the xlatn environment is only valid inside a song environment, and we are now declaring a new song.

784 \renewcommand{\theSongComposer}{#4}           %
785 \renewcommand{\theSongCopyRt}{#3}             %
786 \renewcommand{\theSongKey}{#2}                %
787 \renewcommand{\theSongLicense}{#6}            %
788 \renewcommand{\theSongScriptRef}{#5}          %
789 \renewcommand{\theSongTitle}{#1}              %
790 \renewcommand{\theXlatnBy}{}                  %
791 \renewcommand{\theXlatnPerm}{}                %
792 \renewcommand{\theXlatnTitle}{}               %

793 %

794 \addtocounter{SBSongCnt}{1}                   %
795 \titleIndex{\theSongTitle}{\theSBSongCnt}     %
796 \titleContents{\theSongTitle}{\theSongKey}    %

Try to keep the song title and all its contents on the same page; if that is what is desired.

797 \ifSamepageMode%
798  \begin{samepage}%
799 \fi%

Whereever you see a parameter used directly, and not the parameter macro just set, above, it is because I haven’t figured out how the receiving macro can deal with accepting its input via a macro (and not via the native parameter). In general this is because the receiving macro is attempting to detect and empty or blank parameter.

The second parameter is used directly here when \STitle is invoked (instead of \theSongKey), because I can’t figure out how to cause the sharp and flat substitution to occur within the context of the \renewcommand statement, above.

800 \begin{center}
801  \STitle[N]{\theSongTitle}{#2}\\
802  \vspace{-.5ex}
803  \CpyRt[N]{#3}{#6}\\
804  \vspace{-.5ex}

805  \WAndM[N]{#4}\\
806  \if\given{#5}%
807  \vspace{-.75ex}
808  \ScriptRef[N]{\theSongScriptRef}\\
809  \fi%
810 \end{center}%
811 \vspace{\SpaceAfterTitleBlk}

If we’re in compactsong mode then put us into multicols{2} mode.

812 \ifCompactSongMode
813  \begin{multicols*}{2}
814  \raggedcolumns
815 \fi
816 \SBDefaultFont%

817 }%

818 {\ifSamepageMode%
819  \end{samepage}%
820 \fi%

Close up the figure.

821 \ifCompactSongMode
822  \end{multicols*}
823 \fi
824 \ifSongEject%
825  \vfill\pagebreak%
826 \else%
827  \SpaceAfterSong\pagebreak[1]%
828 \fi%
829 \renewcommand{\SBinSongEnv}{\False}%
830 \SBinSongEnvfalse%

831 }

832

xlatn xlatn[⟨1 ⟩][⟨2 ⟩][⟨3 ⟩] is the song-translation environment. Parameters: ⟨1 ⟩ Title of the translated song. ⟨2 ⟩ Translation permission. ⟨3 ⟩ Who performed the translation.

The xlatn environment always occurs within a song environment. We reset the verse counter then cause the title and other parameter information to be displayed.

833 \newenvironment{xlatn}[3]{% Comment marker negates the newline.
834  \renewcommand{\theXlatnBy}{#3}%
835  \renewcommand{\theXlatnPerm}{#2}%
836  \renewcommand{\theXlatnTitle}{#1}%

837 %

838  \titleIndex{\theXlatnTitle}{\theSBSongCnt}%
839  \titleContents{\theXlatnTitle}{\theSongKey}%

840 %

841  \begin{center}
842  \STitle[N]{\theXlatnTitle}{\theSongKey}\\
843  \CpyRt[N]{\theSongCopyRt}{\theSongLicense}\\
844  \if\nil{#2}%
845  \relax%
846  \else%
847  \vspace{-.5ex}
848  {\CpyRtFont\theXlatnPerm}\\
849  \fi
850  \if\nil{#3}%
851  \relax%
852  \else%
853  \vspace{-.5ex}
854  {\CpyRtFont\theXlatnBy}\\
855  \fi
856  \end{center}%

857 %

858  \setcounter{SBVerseCnt}{0}%
859  \setcounter{SBSectionCnt}{0}%
860 }{\relax}

861

\sbChord \sbChord changes a sequence of characters into a chord. Parameters: ⟨1 ⟩ Chord.

The original version of this function was written by Philip Hirschhorn

<psh@math.mit.edu> or <phirschhorn@lucy.wellesley.edu>.

Scan the sequence of characters in Chord. Replace ‘#’ characters with ♯’s and ‘b’ characters with ♭. This produces more realistic looking chord symbols (which also take up less space than their phoney counterparts). We also look for ‘/’ characters, and insert a \ChBassFont command into the stream when a ‘/’ is found. This makes the bass note of the chord to appear in a smaller font.

862 \def\sbChord#1{%
863 \ifx#1\relax%
864  \let\next=\relax%
865 \else%
866  \ifx#1##% double sharp because we're inside a \def
867  $\sharp$%
868  \else%
869  \ifx#1b%
870  $\flat$%
871  \else%
872  \ifx#1/%
873  \ChBassFont /%
874  \else%
875  \ifx#1[%
876  \bgroup\ChBkFont [\egroup%
877  \else%
878  \ifx#1]%
879  \bgroup\ChBkFont ]\egroup%
880  \else%
881  #1%
882  \fi%
883  \fi%
884  \fi%
885  \fi%
886  \fi%
887  \let\next=\sbChord%
888 \fi%
889 \next%

890 }

891

\Ch \ChX \Chr \Ch[⟨1 ⟩][⟨2 ⟩] is the chord over lyrics macro. \ChX is the Chord over lyrics macro, but deleting trailing spaces. \Chr is the Chord over lyrics macro, but inserting a rule, when necessary.

Parameters: ⟨1 ⟩ Chord. ⟨2 ⟩ Syllable that chord is to be left justified over.

The words-only style file turns off the chord generation and just prints the second parameter.

The \ChX version of this macro is used for the benefit of the words only style to ensure that spaces following the macro are removed. For example, an interword space containing a couple of extra chords would be written as (this is not usually necessary, but sometimes there is no other way to elliminate spurious white space from a words only songbook):

               \ChX{D7}{ing} \ChX{E}{} \ChX{D}{} \Ch{A}{You}

The \Chr version of this macro inserts a rule, at the height specified by the \SBRuleRaiseAmount macro, when the chord is wider than the syllable. The default value creates an extended em-dash-like rule; a value of 0pt creates an underbar-like rule. More details about the \Chr command follow below, just preceeding its definition.

This code is based on macros from Olivier Biot’s (http://www.biot.yucom.be/) chord.sty file. Changes made by me:

• removed annoying space between \SBIntersyllableRules when they butt up against one another

• changed the default \ChordRaise value to something closer to what my previous version of the \Ch command used to set

• renamed the commands: \@ to \Ch, and \@@ to \Chr

• renamed the variables used to adjust \Ch’s behaviour, to ensure no conflict exists with Olivier’s macro.

892 \newcommand{\Ch}[2]{{%
893 \ifChordBk%
894  \setbox1=\hbox{\ChFont\sbChord#1\relax\strut}%
895  \setbox0=\hbox{#2}%
896  \ifdim\wd1<\wd0%
897  \strut\raise\SBChordRaise\copy1\kern-\wd1\copy0%
898  \else%
899  \strut\copy0\kern-\wd0\strut\raise\SBChordRaise\copy1%
900  \fi%
901 \else%
902  #2%
903 \fi}}

904

The \ChX code.

905 \newcommand{\ChX}[2]{%
906 \ifWordsOnly%
907  \if\nil{#2}%
908  \ignorespaces%
909  \else%
910  #2%
911  \fi%
912 \else%
913  \Ch{#1}{#2}%
914 \fi}

915

The \Chr code and a detailed macro description & definition.

We start with some internal scratch variables. Any value they have prior to \Chr’s execution will be discarded each time.

916 \newlength{\chCriticDim}
917 \newlength{\chSpaceDim}
     DEF\Chr#1#2
     BEGIN
       \box1 == \hbox{... #1 --> Chord ...}
       \box0 == \hbox{... #2 --> Syllable ...}
       \chCriticDim == \wd0 - \chSpaceTolerance - 2 \chMiniSpace
       IFF \wd1 > \chCriticDim
         \chCriticDim == \wd1 - \wd0 - \chSpaceTolerance - 2 \chMiniSpace
         IFF \chCriticDim > 0mm
           \chSpaceDim == \wd1 - \wd0 + \chSpaceTolerance
         ELSE
           \chSpaceDim == \chSpaceTolerance
         FFI
         \chCriticDim == \chSpaceDim - 2 \chSpaceTolerance
         \raise \SBChordRaise \copy1 \kern - \wd1
         IFF \wd0 == 0mm
           \kern - 2 \chMiniSpace
         FFI
         \copy0
         \hbox to \chCriticDim{\hss\raise\SBRuleRaiseAmount
                             \hbox to \chSpaceDim{\SBIntersyllableRule}\hss}
       ELSE
         \raise \SBChordRaise \copy1 \kern - \wd1 \copy0

       FFI
     END

918 \newcommand{\Chr}[2]{{%
919 \ifChordBk
920  \setbox1=\hbox{\ChFont\sbChord#1\relax\strut}%
921  \setbox0=\hbox{#2}%
922  \setlength{\chCriticDim}{\wd0 - \chSpaceTolerance}%
923  \advance\chCriticDim by 2\chMiniSpace%
924  \ifdim\wd1>\chCriticDim%
925  \chCriticDim \wd1%
926  \advance\chCriticDim by -\wd0%
927  \advance\chCriticDim by -\chSpaceTolerance%
928  \advance\chCriticDim by -2\chMiniSpace%
929  \ifdim\chCriticDim>0mm%
930  \chSpaceDim \wd1%
931  \advance\chSpaceDim by -\wd0%
932  \advance\chSpaceDim by \chSpaceTolerance%
933  \else%
934  \chSpaceDim\chSpaceTolerance%
935  \fi%
936  \chCriticDim \chSpaceDim%
937  \advance\chCriticDim by 2\chMiniSpace%
938  \strut\raise\SBChordRaise\copy1\kern-\wd1\ifdim\wd0=0mm\kern-2\chMiniSpace\fi%
939  \copy0\hbox to\chCriticDim{\hss%
940  \raise\SBRuleRaiseAmount\hbox to\chSpaceDim{\SBIntersyllableRule}\hss}%
941  \else%
942  \strut\raise\SBChordRaise\copy1\kern-\wd1%
943  \copy0%
944  \fi%
945 \else%
946  #2%
947 \fi}%

948 }

949

\SBMargNote \SBMargNote[⟨1 ⟩] creates a Song♭ook marginal note. Parameters: ⟨1 ⟩ Text of note to place in margin.

Used to place a note of some kind in the margin of a songbook, or within a footnote when in CompactSong mode. In words only mode this macro is a no-op.

950 \newcommand{\SBMargNote}[1]{%
951 \ifWordsOnly%
952  \relax%
953 \else\ifCompactSongMode%
954  \footnote{{\SBMargNoteFont{#1}}}%
955 \else%
956  \marginpar{{\begin{flushleft}\SBRefFont{#1}\end{flushleft}}}%
957 \fi\fi}

958

\SBRef \SBRef creates a song reference in the margin. Parameters: ⟨1 ⟩ Songbook/CD/tape name. ⟨2 ⟩ Page/Song number within book referenced by ⟨1 ⟩, or tape/CD publisher info.

Used to indicate a source for the full SATB music for this song, or what CD/cassette the song can be found on. In words only mode this macro is a no-op. This normally appears in the margin of the songbook, but in CompactSong mode the information appears in a footnote that is always numbered ‘0’ (even if there is more than one reference in a song.

959 \newcommand{\SBRef}[2]{%
960 \ifWordsOnly%
961  \relax%
962 \else\ifCompactSongMode%

963  \footnotetext[0]{{\SBRefFont{\em #1}, {#2}.}}%
964 \else%
965  \marginpar{{\begin{flushleft}\SBRefFont{\em #1}, {#2}.\end{flushleft}}}%
966 \fi\fi}

967

SBVerse SBVerse* The SBVerse and SBVerse* environments encapsulate a verse.

Parameters: None.

Very much like L^{A}TEX’s verse environment, except that here the verses are numbered. The indent amount for lines that are too long is set with the \HangAmt command (see the constant definitions at the top of this document).

A version of this command which indents but down not place an \SBVerseCnt before the chorus is available as SBVerse*. Similar to L^{A}TEX’s \section* command, the verse counter is not incremented either.

968 \newenvironment{SBVerse}{%
969 \sbSetsbBaselineSkipAmt%
970 \bgroup%
971 \addtocounter{SBVerseCnt}{1}%
972 \SBVerseMarkright{\theSBVerseCnt}%
973 \begin{list}{{\SBVerseNumberFont\theSBVerseCnt .}}
974  {\setlength {\leftmargin}   {\LeftMarginSBVerse + \HangAmt}
975  \setlength{\itemindent}   {-\HangAmt}
976  \setlength{\listparindent}{-\HangAmt}
977  \setlength{\parsep}       {0pt}
978  \setlength{\baselineskip} {\sbBaselineSkipAmt}

979 }%

980  \item}
981 {\end{list}%
982 \egroup%
983 \SpaceAfterVerse}

984

The SBVerse* code. Coding of this environment courtesy of Herbert Martin

 Dietze <herbert@fh-wedel.de>.
985 \newenvironment{SBVerse*}{%
986 \sbSetsbBaselineSkipAmt%
987 \bgroup%
988 \begin{list}{{\SBVerseNumberFont }}
989  {\setlength {\leftmargin}   {\LeftMarginSBVerse + \HangAmt}
990  \setlength{\itemindent}   {-\HangAmt}
991  \setlength{\listparindent}{-\HangAmt}
992  \setlength{\parsep}       {0pt}
993  \setlength{\baselineskip} {\sbBaselineSkipAmt}

994 }%

995  \item}
996 {\end{list}%
997 \egroup%
998 \SpaceAfterVerse}

999

SBSection SBSection* The SBSection and SBSection* environments encapsulate a section.

Parameters: None.

Very much like L^{A}TEX’s verse environment, except that here the sections are numbered. The indent amount for lines that are too long is set with the \HangAmt command (see the constant definitions at the top of this file).

A version of this command which indents but doesn’t place an \SBSectionCnt before the chorus is available as SBSection*. Similar to L^{A}TEX’s \section* command, the section counter is not incremented either.

1000 \newenvironment{SBSection}{%
1001 \sbSetsbBaselineSkipAmt%
1002 \bgroup%
1003 \addtocounter{SBSectionCnt}{1}%
1004 \SBSectionMarkright{SBSectionCnt}

1005 \begin{list}{{\SBSectionNumberFont\alph{SBSectionCnt})}}
1006  {\setlength {\leftmargin}   {\LeftMarginSBSection + \HangAmt}
1007  \setlength{\itemindent}   {-\HangAmt}
1008  \setlength{\listparindent}{-\HangAmt}
1009  \setlength{\parsep}       {0pt}
1010  \setlength{\baselineskip} {\sbBaselineSkipAmt}

1011 }%

1012  \item}
1013 {\end{list}%
1014 \egroup%
1015 \SpaceAfterSection}

1016

The SBSection* code. Coding of this environment courtesy of Herbert Martin

  Dietze <herbert@fh-wedel.de>.
1017 \newenvironment{SBSection*}{%
1018 \sbSetsbBaselineSkipAmt%
1019 \bgroup%
1020 \begin{list}{{\SBSectionNumberFont }}
1021  {\setlength {\leftmargin}   {\LeftMarginSBSection + \HangAmt}
1022  \setlength{\itemindent}   {-\HangAmt}
1023  \setlength{\listparindent}{-\HangAmt}
1024  \setlength{\parsep}       {0pt}
1025  \setlength{\baselineskip} {\sbBaselineSkipAmt}

1026 }%

1027  \item}
1028 {\end{list}%
1029 \egroup%
1030 \SpaceAfterSection}

1031

\SBChorus \SBChorus* The SBChorus and SBChorus* environments encapsulate a chorus.

Parameters: None.

Very much like L^{A}TEX’s verse environment, except that here a \SBChorusTag tag is inserted to demark the start of the chorus. The indent amount for lines that are too long is set with the \HangAmt command (see the constant definitions at the top of this file).

A version of this command which indents but does not place a \SBChorusTag before the chorus is available as SBChorus*.

1032 \newenvironment{SBChorus}{%
1033 \sbSetsbBaselineSkipAmt%
1034 \bgroup%
1035 \SBChorusMarkright{\SBChorusTag}
1036 \begin{list}{{\SBChorusTagFont\SBChorusTag}}
1037  {\setlength {\leftmargin}   {\LeftMarginSBChorus + \HangAmt}
1038  \setlength{\itemindent}   {-\HangAmt}
1039  \setlength{\listparindent}{-\HangAmt}
1040  \setlength{\parsep}       {0pt}
1041  \setlength{\baselineskip} {\sbBaselineSkipAmt}

1042 }%

1043  \item}
1044 {\end{list}%
1045 \egroup%
1046 \SpaceAfterChorus}

1047

The SBChorus* code. Coding of this environment courtesy of Herbert Martin

  Dietze <herbert@fh-wedel.de>.
1048 \newenvironment{SBChorus*}{%
1049 \sbSetsbBaselineSkipAmt%
1050 \bgroup%
1051 \begin{list}{{\SBChorusTagFont }}
1052  {\setlength {\leftmargin}   {\LeftMarginSBChorus + \HangAmt}
1053  \setlength{\itemindent}   {-\HangAmt}
1054  \setlength{\listparindent}{-\HangAmt}
1055  \setlength{\parsep}       {0pt}

1056  \setlength{\baselineskip} {\sbBaselineSkipAmt}

1057 }%

1058  \item}
1059 {\end{list}%
1060 \egroup%
1061 \SpaceAfterChorus}

1062

\SBOpGroup \SBOpGroup identifies an open chorus/verse.

Parameters: None.

This environment is akin to SBChorus, except that no tag and no indentation is performed. This environment serves two purposes:

1. Identify a verse or chorus that is unmarked (by way of a tag) and the left margin of the block is not indented.

2. Puts the verse or chorus in a list environment so that wrapping lines are properly indented.

1063 \newenvironment{SBOpGroup}{%
1064 \sbSetsbBaselineSkipAmt%
1065 \bgroup%
1066 \begin{list}{\hbox{}}
1067  {\setlength {\leftmargin}   {\HangAmt}
1068  \setlength{\itemindent}   {-\HangAmt}
1069  \setlength{\listparindent}{-\HangAmt}
1070  \setlength{\topsep}       {0pt}
1071  \setlength{\parsep}       {0pt}
1072  \setlength{\labelwidth}   {0pt}
1073  \setlength{\labelsep}     {0pt}
1074  \setlength{\baselineskip} {\sbBaselineSkipAmt}

1075 }%

1076  \item}
1077 {\end{list}%
1078 \egroup%
1079 \SpaceAfterOpGroup}

1080

\SBBridge  \SBBridge[⟨1 ⟩] identifies a bridge.

Parameters:

⟨1 ⟩ The Bridge. This command is used to encapsulate a bridge that occurs in a song. In words

only mode this command is a no-op.

1081 \newcommand{\SBBridge}[1]{%
1082 \ifWordsOnly%
1083  \relax%
1084 \else%
1085  \sbSetsbBaselineSkipAmt%
1086  \bgroup%
1087  \begin{list}{{\SBBridgeTagFont\SBBridgeTag}}
1088  {\setlength {\leftmargin}  {\LeftMarginSBChorus}%
1089  \setlength{\parsep}      {0pt}
1090  \setlength{\baselineskip}{\sbBaselineSkipAmt}

1091 }%

1092  \item #1
1093  \end{list}%
1094  \egroup\par
1095 \fi}

1096

\SBEnd \SBEnd[⟨1 ⟩][⟨2 ⟩] identifies a song ending. Parameters: ⟨1 ⟩ Display in words only? (optional) ⟨2 ⟩ The Ending.

This command is used to encapsulate the ending of a song. If the first parameter is not specified, or if it is ‘N’, then in words only mode this command is a no-op.

1097 \newcommand{\SBEnd}[2][N]{%
1098 \ifthenelse{\equal{\ifWordsOnly Y\fi}{Y}
1099  \and \equal{N}{#1}}%
1100 {\relax}%
1101 {\sbSetsbBaselineSkipAmt%
1102 \bgroup%
1103  \begin{list}{{\SBEndTagFont\SBEndTag}}
1104  {\setlength {\leftmargin}  {\LeftMarginSBChorus}
1105  \setlength{\parsep}      {0pt}
1106  \setlength{\baselineskip}{\sbBaselineSkipAmt}

1107 }%

1108  \item #2
1109  \end{list}%
1110  \egroup\par}

1111 }

1112

\SBIntro \SBIntro[⟨1 ⟩][⟨2 ⟩] identifiesd an introduction. Parameters: ⟨1 ⟩ Display in words only? (optional) ⟨2 ⟩ The Introduction.

This command is used to encapsulate an introduction to a song. If the first parameter is not specified, or if it is ‘N’, then in words only mode this command is a no-op.

1113 \newcommand{\SBIntro}[2][N]{%
1114 \ifthenelse{\equal{\ifWordsOnly Y\fi}{Y}
1115  \and \equal{N}{#1}}%
1116 {\relax}%
1117 {\sbSetsbBaselineSkipAmt%
1118 \bgroup%
1119  \begin{list}{{\SBIntroTagFont\SBIntroTag}}%
1120  {\setlength {\leftmargin}  {\LeftMarginSBChorus}%
1121  \setlength{\parsep}      {0pt}
1122  \setlength{\baselineskip}{\sbBaselineSkipAmt}

1123 }%

1124  \item #2
1125  \vspace{-\topsep}%\vspace{-\partopsep}%
1126  \end{list}%
1127  \egroup\par}%

1128 }

1129

SBBracket SBBracket* The SBBracket[⟨1 ⟩] and SBBracket[⟨1 ⟩] environments encapsulates a bracketed

versicle.

Parameters:

⟨1 ⟩ Some tag is inserted before the bracket to indicate the significance of the bracketed area.

There are two versions of this environment: SBBracket and SBBracket*. They operate identically, except that the *ed version doesn’t print its tag and bracket in words only modes.

This is a more versatile, and better formatted version of SBBridge, SBOccurs, etc.; and it is recommended that this be used in the others place.

Starting in version 4.0 of the style, the left-hand indentation of this environment has been chosen such that the SBVerse, SBChorus, and SBBracket songwords all align against the same left margin when printing standard words & chords songbooks.

1130 \newenvironment{SBBracket}[1]{%
1131 \SpaceBeforeSBBracket
1132 \sbSetsbBaselineSkipAmt%
1133 \setbox0=\hbox to \LeftMarginSBBracket{\parbox{\LeftMarginSBBracket}%

1134  {\flushright{\hspace{0pt}\SBBracketTagFont #1}}}%
1135 \hbox\bgroup%
1136  \rightskip=\LeftMarginSBBracket%
1137  $\raisebox{1.25ex}{\copy0}%
1138  \left\lbrack%
1139  \vcenter\bgroup%
1140  \begin{list}{\hbox{}}%                          %
1141  {\setlength {\leftmargin}   {\HangAmt + 0.5em}% This list
1142  \setlength{\rightmargin}  {\LeftMarginSBBracket}%
1143  \setlength{\itemindent}   {-\HangAmt}%      % been copied
1144  \setlength{\listparindent}{-\HangAmt}%      % verbatim from
1145  \setlength{\topsep}       {0pt}%            % the SBOpGroup
1146  \setlength{\parsep}       {0pt}%            % environment,
1147  \setlength{\labelwidth}   {0pt}%            % above and then
1148  \setlength{\labelsep}     {0pt}%            % modified slightly.
1149  \setlength{\baselineskip} {\sbBaselineSkipAmt}%

1150 }% %

1151  \item%

1152 }{%

1153  \end{list}%
1154  \egroup%
1155  \right.$%
1156  \rightskip=0pt
1157 \egroup
1158 \SpaceAfterSBBracket

1159 }

1160

    The SBBracket* code.
1161 \newenvironment{SBBracket*}[1]{%
1162 \SpaceBeforeSBBracket
1163 \sbSetsbBaselineSkipAmt%
1164 \ifNotWordsOnly
1165  \setbox0=\hbox to \LeftMarginSBBracket{\parbox{\LeftMarginSBBracket}%
1166  {\flushright{\hspace{0pt}\SBBracketTagFont #1}}}%
1167  \hbox\bgroup%
1168  \rightskip=\LeftMarginSBBracket%
1169  $\raisebox{1.25ex}{\copy0}%
1170  \left\lbrack%
1171  \vcenter\bgroup%

1172 \fi

1173  \begin{list}{\hbox{}}%                          %
1174  {\setlength {\leftmargin}   {\HangAmt + 0.5em}% This list
1175  \setlength{\rightmargin}  {\LeftMarginSBBracket}%
1176  \setlength{\itemindent}   {-\HangAmt}%      % been copied
1177  \setlength{\listparindent}{-\HangAmt}%      % verbatim from
1178  \setlength{\topsep}       {0pt}%            % the SBOpGroup
1179  \setlength{\parsep}       {0pt}%            % environment,
1180  \setlength{\labelwidth}   {0pt}%            % above and then
1181  \setlength{\labelsep}     {0pt}%            % modified slightly.
1182  \setlength{\baselineskip} {\sbBaselineSkipAmt}%

1183 }% %

1184  \item%

1185 }{%

1186  \end{list}%
1187 \ifNotWordsOnly
1188  \egroup%
1189  \right.$%
1190  \rightskip=0pt
1191  \egroup

1192 \fi

1193 \SpaceAfterSBBracket

1194 }

1195

SBOccurs The SBOccurs[⟨1 ⟩] environment encapsulates an occurance. Parameters: ⟨1 ⟩ Occurance number(s). For example “1,3” would designate that this passage applies to the 1^{st} and 3^{rd} occurances.

1196 \newenvironment{SBOccurs}[1]{%
1197 {\SBOccursTagFont #1\SBOccursBrktFont [}

1198 }

1199 {{\SBOccursBrktFont ]}}

1200

SBExtraKeys The SBExtraKeys[⟨1 ⟩] environment encapsulates extra song keys. Parameters: ⟨1 ⟩ This parameter actually is used to either pass or not pass all the content of the environment on to the L^{A}TEXprocessor.

Songs are frequently listed in more than one key. This is ok for books with chords, however the words only edition should only print one occurance of a song. So, any extra keys are placed in a SBExtraKey environment. This allows them to be shut off when they’re not needed.

This was coded some years ago and I probably wouldn’t do it this way again; however, it works so I’m not inclined to better it.

1201 \newenvironment{SBExtraKeys}[1]{%
1202 \ifWordsOnly%
1203  \relax%
1204 \else%

1205 #1

1206 \fi}

1207 {}

1208

\CBPageBrk \CBPageBrk[⟨1 ⟩] generates a page break here if we’re in Chordbk mode. Parameters: ⟨1 ⟩ Take effect in CompactSong mode too? (optional)

When we’re also in CompactSong mode we will only execute the page break if a parameter other than ‘N’ has been passed.

1209 \newcommand{\CBPageBrk}[1][N]{%
1210 \ifChordBk%
1211  \ifCompactSongMode
1212  \ifthenelse{\equal{#1}{N}}
1213  {\relax}
1214  {\vfill\pagebreak}
1215  \else
1216  \vfill\pagebreak

1217 \fi

1218 \fi}

1219

\CSColBrk \CSColBrk generates a column break here if we’re in compactsong mode.

Parameters: None.

1220 \newcommand{\CSColBrk}{%
1221 \ifCompactSongMode%
1222  \columnbreak%
1223 \fi}

1224

\NotWOPageBrk \NotWOPageBrk generates a page break here if we’re not in words only mode.

Parameters: None.

1225 \newcommand{\NotWOPageBrk}{%
1226 \ifWordsOnly%
1227  \relax%
1228 \else%
1229  \pagebreak
1230 \fi}

1231

\OHPageBrk \OHPageBrk generates a page break here if we’re in overhead mode. Parameters:

None.

1232 \newcommand{\OHPageBrk}{%
1233 \ifOverhead%
1234  \pagebreak
1235 \fi}

1236

\WBPageBrk \WBPageBrk generates a page break here if we’re in workbk mode.

Parameters: None.

1237 \newcommand{\WBPageBrk}{%
1238 \ifWordBk%
1239  \pagebreak
1240 \fi}

1241

\WOPageBrk \WOPageBrk generates a page break here if we’re in words only mode.

Parameters: None.

1242 \newcommand{\WOPageBrk}{%
1243 \ifWordsOnly%
1244  \pagebreak
1245 \fi}

1246

14.8.7 Obsolete Macros

The macros in this section are no longer recommended, but will continue to exist in the next version of the style. Existing users of this style should upgrade their source files to make use of the new, replacement, mechanisms offered by the style.

1247 %%=======================================================%
1248 %%            O B S O L E T E   M A C R O S              %
1249 %%=======================================================%

1250

There are no obsolete macros in this release.

14.8.8 Deprecated Macros

The macros in this section will be deleted in the next version of the style. Where these old macros conflict with new ones they have been renamed by placing a lowercase ‘o’ at the start of each macro name; this makes them easily accessible yet out of the way.

1251 %%=======================================================%
1252 %%          D E P R E C A T E D   M A C R O S            %
1253 %%=======================================================%

1254

Boolean Contants In the early releases, before I knew about L^{A}TEX’s \newif command I had coded \ifs using these contants. These should have been removed some time ago, but I had neglected placing them into this Deprecated Macros section and so hadn’t given proper notice. Consider this notice.

\False \True \ChordBk \Overhead \SongEject \WordBk \WordsOnly \SBinSongEnv  \False is defined for use in \if macro contructs and the other constants in this

style. \True is defined for use in \if macro contructs and the other constants in this style. \ChordBk tells if we are processing a chordbk.sty document. \Overhead tells if we are processing an overhead.sty document. \SongEject specifies if we want to end the current page at the end of every song environment. A value of \True means eject after every song environment.

\WordBk tells if we are processing a wordbk.sty document \WordsOnly is equal to \True if we’re in words only mode. The default value will be \False, as that is how all of the commands in this file will act. \SBinSongEnv tells if we are inside of a song environment. This is re-defined as we enter and exit the song environment.

1255 \newcommand{\False}{0}
1256 \newcommand{\True}{1}
1257 \newcommand{\ChordBk}{\False}
1258 \newcommand{\Overhead}{\False}
1259 \newcommand{\SongEject}{\True}
1260 \newcommand{\WordBk}{\False}
1261 \newcommand{\WordsOnly}{\False}
1262 \newcommand{\SBinSongEnv}{\False}

1263

End of songbook.sty file.

1264 \endinput

1265