%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SONG.STY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Author: Stephen Savitzky %%% $Id: song.sty,v 1.10 2008-01-20 07:37:11 steve Exp $ %%% %%% Song environment: %%% \begin{song}{title} % starts on a new page %%% % sets \theSong to title %%% \subtitle{subtitle, set in smaller type} %%% \notice{centered copyright notice} %%% \CcByNcSa % Creative Commons license %%% \dedication{centered dedication} %%% \description{description} % defines \theDescription %%% (The description is used only for liner notes, etc.; it %%% does not appear in typeset lyrics) %%% \category{keyword} % defines \theCategory %%% \key{C\; (A \capo 3)} % defines \theKey %%% \timing{mm:ss} % defines \theTiming %%% \created{yymmdd} % defines \theCrDate %%% \cvsid{$Id ...} % defines \theCVSid %%% \lyrics{lyricist} % specifies theLyricist %%% \music{composer} % specifies theComposer %%% \arranger{arranger} % specifies theArranger %%% \credits{credits} % specifies theCredits %%% \performance{performance notes} % specifies perf. notes %%% %%% \begin{note} %%% left-justified, paragraphed text set in smaller type %%% \end{note} %%% %%% lines of song separated by newline %%% \; indented single line with no extra space around it. %%% chords like th[A]is %%% \verse or \\ %%% between verses %%% \spoken{spoken parts in slanted type} %%% \begin{refrain} %%% indented refrain with verse spacing %%% \end{refrain} %%% \inset{1-line instructions in italics, indented 1em} %%% \end{song} %%% \tailnote{Note text at the bottom of the page} %%% \link{url}{anchor text} %%% %%% \vfiller{n} insert n lines of filler to balance %%% columns in twocolumns environment %%% %%% [chord] set in a 0-width raised box %%% \chord{set as chord but not raised} %%% Chords are set in math mode (to get superscripts and special chars.) %%% The following chord elements are defined: %%% \flat modified b %%% \sharp modified # %%% \dim subscript circle %%% \aug superscript plus %%% \maj {\rm maj} %%% \sus4 {\rm sus}4 (also 2) %%% sometimes changed to superscript to save horizontal space %%% \min prints as m %%% \add prints as & %%% \up prints as double uparrow, e.g. F(D\up3) %%% used to indicate barre chords and the like. %%% * indicates chords with B or E string raised %%% \capo {\it capo} used in, e.g. \key{F\; (D\capo3)} %%% \; em space %%% %%% %%% \file{songfile} input a song file; set \theFile to the filename %%% %%% Page styles: %%% broadside songs on un-numbered single sheets %%% songbook numbered pages set up for two-sided printing %%% boxed plain boxed headers/footers: use markXY and tagXY %%% ruled plain ruled headers/footers: use markXY and tagXY %%% shadowed plain shadow-boxed headers/footers %%% %%% \tallpage adds an extra inch to the text height %%% \widepage adds an extra inch to the text width %%% %%% Page formatting elements: %%% additional conditional code can be put in the marks %%% and tags to swap them on odd and even pages. %%% %%% \markUL{x} mark upper left defines \ULmark %%% \markUC{x} mark upper center etc. %%% \markUR{x} mark upper right %%% \markLL{x} mark lower left %%% \markLC{x} mark lower center %%% \markLR{x} mark lower right %%% %%% \tagXY{x} tag {upper,lower}{left, center,right} %%% the tags are like the marks except that in the %%% boxed styles they come underneath the boxes. %%% %%% The following rules can be redefined for shadow effects. %%% \HFTrule header/footer top box rule %%% \HFBrule header/footer bottom box rule %%% \HFLrule header/footer left rule %%% \HFRrule header/footer right rule %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Open Source/Free Software license notice: % The contents of this file may be used under the terms of the GNU % Lesser General Public License Version 2 or later (the "LGPL"). The text % of this license can be found on this software's distribution media, or % obtained from www.gnu.org/copyleft/lesser.html %%% :end license notice %%% %%% %%% Informational Components (notice, etc.) %%% \def\Centered #1{\begin{center}#1\end{center}} \let\notice=\Centered \def\SomeRightsReserved{Some Rights Reserved\footnote{\CcByNcSa}} \def\CcByNcSa{This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 US License.} \def\subtitle #1{\begin{center}\bf #1\end{center}} \def\license #1{\begin{center}\small #1\end{center}} \let\dedication=\Centered \def\ttto #1{{\sc ttto:} {\em #1\/}} \def\link#1#2{#2\footnote{$<$#1$>$}} %%% define global variables for all the header statements %%% Note that some aren't used by LaTeX; they're for other formats, too. \def\timing#1{\global\def\theTiming{#1}}\def\theTiming{} \def\category#1{\global\def\theCategory{#1}}\def\theCategory{} \def\description#1{\global\def\theDescription{#1}}\def\theDescription{} \def\key#1{\global\def\theKey{#1}}\def\theKey{} \def\created#1{\global\def\theCrDate{#1}}\def\theCrDate{} \def\cvsid#1{\global\def\theCVSid{#1}}\def\theCVSid{} \def\lyrics#1{\global\def\theLyricist{#1}}\def\theLyricist{} \def\music#1{\global\def\theComposer{#1}}\def\theComposer{} \def\arranger#1{\global\def\theArranger{#1}}\def\theArranger{} \def\credits#1{\global\def\theCredits{#1}}\def\theCredits{} \def\performance#1{\global\def\thePerformance{#1}}\def\thePerformance{} %%% %%% note, headnote, tailnote %%% \def\note{\quotation\footnotesize % \catcode`\^^M=5 % ascii return is end-line } \let\endnote=\endquotation \long\def\headnote#1{\begin{note}#1\end{note}} \long\def\tailnote#1{\vfill\begin{note}#1\end{note}} %%% %%% The song and refrain environments %%% \def\song#1{\newpage \Centered{{\Large\bf#1}} \global\def\theSong{#1} \global\def\theCategory{}\global\def\theTiming{} \global\def\theCrDate{}\global\def\theKey{} \begingroup \parskip 0pt plus 1pt \parindent 0pt \let\\=\verse \obeylines\catcode`\[=13} \def\endsong{% \addcontentsline{toc}{Song}{\hbox{{\tt \hbox to 7em{\theFile\hss}}\hbox to 2em{\hss\theTiming}\;\hbox{\theSong\hss}}} \endgroup} \def\theSong{} \global\def\theCategory{}\global\def\theTiming{} \global\def\theCrDate{}\global\def\theKey{} \def\refrain{\list{}{\listparindent 1em \itemindent\listparindent \labelwidth 0pt \rightmargin 0pt \obeylines \parsep 0pt plus 1pt}\item[]} \let\endrefrain=\endlist {\obeylines% We have to do this inside \obeylines to make it work right. \global\def\Indented#1{\begin{refrain} #1 \end{refrain}}} \def\verse{\par\medskip\par} \def\inset#1{{\hskip1em\it #1}} \def\;{\hskip 1em} \def\spoken#1{{\sl #1}} \def\vfiller#1{\vbox to #1\baselineskip{}} %%% %%% Table of contents is supposed to look like a song %%% \def\l@Song#1#2{#1\par} \def\tableofcontents{\begin{song}{LIST OF SONGS} \@starttoc{toc}\end{song}} %%% %%% \file{filename} Input a file containing a song. %%% We force a pagebreak here to ensure that the previous song %%% doesn't pick up the new filename in its header and footer. %%% %%% Turn off \documentstyle and \begin{document}...\end{document} %%% so that the song can be typeset separately if desired. \def\file#1{\newpage\begingroup \def\theFile{#1} \renewenvironment{document}{}{} \def\documentstyle[##1]##2{} \input{#1} \endgroup} \def\theFile{} %%% %%% \ignore{stuff} Ignore some stuff. %%% A crude form of extended, nestable comment %%% frequently useful for cancelling out lists of songs. %%% \long\def\ignore#1{} %%% %%% Chords. %%% Note that chords are set in math mode %%% \def\chordfont{\sf} \def\chord #1{{\footnotesize\strut$\chordfont #1$}} \def\@chord #1{\makebox[0pt][l]{\raisebox{.9em}{\chord{#1}}}} \def\dim{_\circ} \def\aug{^+} \def\maj{\mbox{maj}} \def\min{\mbox{m}} \def\sus{\mbox{sus}} \def\capo{\mbox{\ \it capo\ }} \def\up{\Uparrow} \def\add{\&} \catcode`\[=13 \def[#1]{\@chord{#1}} \catcode`\[=12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Page Styles --- these really belong in another file. %%% %%% We define left, right, and center marks and ``tags'' %%% for two-line headers and footers. The tags in both %%% headers and footers are placed on the line closest to %%% the text. %%% %% Marks \def\markUL#1{\global\def\ULmark{#1}} \def\ULmark{} \def\markUC#1{\global\def\UCmark{#1}} \def\UCmark{} \def\markUR#1{\global\def\URmark{#1}} \def\URmark{} \def\markLL#1{\global\def\LLmark{#1}} \def\LLmark{} \def\markLC#1{\global\def\LCmark{#1}} \def\LCmark{} \def\markLR#1{\global\def\LRmark{#1}} \def\LRmark{} %% Tags \def\tagUL#1{\global\def\ULtag{#1}} \def\ULtag{} \def\tagUC#1{\global\def\UCtag{#1}} \def\UCtag{} \def\tagUR#1{\global\def\URtag{#1}} \def\URtag{} \def\tagLL#1{\global\def\LLtag{#1}} \def\LLtag{} \def\tagLC#1{\global\def\LCtag{#1}} \def\LCtag{} \def\tagLR#1{\global\def\LRtag{#1}} \def\LRtag{} %% boxes \def\HFBox#1{\vbox{% Ruled box \vskip 2pt\HFTrule\hbox to\textwidth{\HFLrule\hfil#1\hfil\HFRrule}\HFBrule}} \def\HFFilling#1#2#3{% 3-part Box filling \normalsize\strut\ \makebox[0pt][l]{#1}% \hfill#2\hfill\makebox[0pt][r]{#3}\ } %% %% The macro that actually defines the headers and footers %% \def\DefineHFBoxes{% \def\@oddhead{\vbox{% \HFBox{\HFFilling\ULmark\UCmark\URmark} \vskip 1pt \hbox to \textwidth{\HFFilling\ULtag\UCtag\URtag} }}% \def\@evenhead{\vbox{% \HFBox{\HFFilling\URmark\UCmark\ULmark} \vskip 1pt \hbox to\textwidth{\HFFilling\URtag\UCtag\ULtag} }}% \def\@oddfoot{\vbox{% \hbox to \textwidth{\HFFilling\LLtag\LCtag\LRtag} \vskip 1pt \HFBox{\HFFilling\LLmark\LCmark\LRmark} }}% \def\@evenfoot{\vbox{% \hbox to \textwidth{\HFFilling\LRtag\LCtag\LLtag} \vskip 1pt \HFBox{\HFFilling\LRmark\LCmark\LLmark} }}% } %% %% Rules %% \def\DefineBoxHFrules{% Define rules for simple boxes \def\HFTrule{\hrule}\def\HFBrule{\hrule} \def\HFLrule{\vrule}\def\HFRrule{\vrule} } \def\DefineShadowHFrules{% Define rules for shadow boxes \def\HFTrule{\hrule}\def\HFBrule{\hrule height 1pt} \def\HFLrule{\vrule}\def\HFRrule{\vrule width 1pt} } \def\DefineOpenHFrules{% Define rules for simple rules \def\HFTrule{}\def\HFBrule{\hrule height .75pt} \def\HFLrule{}\def\HFRrule{} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Song-specific page styles %% %% Broadside: one song on a single sheet %% Songbook: numbered pages %% %% %% Marks and tags %% \def\DefineSongTags{% \tagUL{\sl\theCategory}\tagUR{\chord{\theKey}\makebox[.5in][r]{\sl\theTiming}} \tagLL{{\sl\theCrDate}}\tagLR{{\tt\theFile}} } \def\DefineBroadsideMarks{% \DefineSongTags\markUR{\sl\theSong}% } \def\DefineSongbookMarks{% \DefineSongTags% \markUL{\sc\leftmark}\markUC{\sl\rightmark}\markUR{\sl\thepage}% } %% %% Page styles %% \def\ps@broadside{% \DefineShadowHFrules\DefineHFBoxes\DefineBroadsideMarks% \let\@evenhead=\@oddhead\let\@evenfoot=\@oddfoot% even and odd pages same. \def\chaptermark##1{\markboth{##1}}\def\sectionmark##1{\markright{##1}}% \def\subsectionmark##1{}} \def\ps@songbook{% \DefineSimpleHFrules\DefineHFBoxes\DefineSongbookMarks% \def\chaptermark##1{\markboth{##1}{}}\def\sectionmark##1{\markright{##1}}% \def\subsectionmark##1{}} %%% %%% Page Margins %%% \headheight 2.1\baselineskip \headsep \baselineskip \footheight 2.1\baselineskip \footskip \baselineskip \topmargin 0in \textheight 9in \advance\textheight -1\headheight\advance\textheight -1\headsep \advance\textheight -1\footheight\advance\textheight -1\footskip \def\tallpage{ \topmargin -.5in \textheight 10in \advance\textheight -1\headheight\advance\textheight -1\headsep \advance\textheight -1\footheight\advance\textheight -1\footskip } \def\widepage{ \oddsidemargin 0in \evensidemargin 0in \textwidth 6.5in } \iffalse % $Log: song.sty,v $ % Revision 1.10 2008-01-20 07:37:11 steve % added \performance for (brief) performance notes % % Revision 1.9 2007-07-17 05:21:41 steve % add \credits % % Revision 1.8 2007-05-20 17:57:20 steve % snapshot, shortly before mastering ABT % mostly inserting license boilerplate. % fixed boilerplate.pl to correctly recognize C files % % Revision 1.7 2005/05/28 20:56:45 steve % add \description for brief descriptions, as in setlists and liner notes. % % Revision 1.6 2004/12/29 01:45:16 steve % add \arranger % % Revision 1.5 2004/12/29 00:58:36 steve % add \lyrics, \music % % Revision 1.4 1998/12/06 06:52:09 steve % Added publishing stuff, flktran.pl, and index.pl % % Revision 1.3 1998/04/06 07:29:12 steve % Added ttto and license; boldface subtitle. % % Revision 1.2 1994/03/04 05:50:58 steve % Added RCS information % \fi