From 745e653e93eb72011e9d2eff4a595e696e4141d0 Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Sat, 11 Oct 2008 18:18:28 +0200 Subject: [PATCH] import of the songbook source tree. --- LICENSE | 339 +++++ README | 15 + changelog | 72 ++ chordbook.tex | 113 ++ license.tex | 40 + lyricbook.tex | 112 ++ make-index | 112 ++ makefile | 109 ++ songs.sty | 3334 +++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 4246 insertions(+) create mode 100644 LICENSE create mode 100644 README create mode 100644 changelog create mode 100644 chordbook.tex create mode 100644 license.tex create mode 100644 lyricbook.tex create mode 100755 make-index create mode 100644 makefile create mode 100644 songs.sty diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d511905c --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README b/README new file mode 100644 index 00000000..f94355bf --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +Chordbook Compilation Chain (v0.2) + +This package provides a compilation toolchain for latex +chordbook. Some modifications have been done to the different files in +order to match my desire. The main goal of this package is to have a +simple make that allow to build a good looking chordbook without the +all the c code to compile as provided in the original songs +distribution. + +Currently this package is distribued with a chordbook written and +desinged by one of my co-worker at the lab. It is provided with +respect to its Creative Commons Licence. + +All other files are subject to the GNU GPLv2 except if another licence +is precised. diff --git a/changelog b/changelog new file mode 100644 index 00000000..19795f24 --- /dev/null +++ b/changelog @@ -0,0 +1,72 @@ +2008-10-06 Alexandre Dupas alexandre.dupas@gmail.com + + * songs : removed \ifdefined \fi. + + * lyricbook.tex : added renewcommand{gtab}{} in order to hide tab + information. + +2008-10-05 Alexandre Dupas alexandre.dupas@gmail.com + + * songs : import songs from the last version of Crep's chordbook. + + * chordbook.tex : defined macro to allow image and tab integration. + + * lyricbook.tex : defined macro to allow image integration. + +2008-10-04 Alexandre Dupas alexandre.dupas@gmail.com + + * make-index : simplified algorithm to produce the index file. The + programm depends less on the type of the index (authors or title). + It produces the same listing in alphabetical order. Also removed + the ignore "La/Les/Le/The/etc." rules. + + * makefile : removing songs/*.sbd from the makefile as it is no + longer needed. If you still want a file with many songs in it, you + can create a directory called Various_artists and add the file in + this directory with the .sg suffix. + + * lyricbook : added graphics path. + + * chordbook : added graphics path. + + * songs : now in splitted form (thanks to Crep). + +2008-10-02 Alexandre Dupas alexandre.dupas@gmail.com + + * README : adding numbering. + + * makefile : allows multiple "main sources" files. + + * chordbook.tex : remove plain text license by inputing license.tex + + * lyricbook.tex : remove plain text license by inputing license.tex + + * license.tex : redundant license information now centralized. + +2008-10-01 Alexandre Dupas alexandre.dupas@gmail.com + + * songs.sty : quick fix to allow fretnum in \gtab command. Replaced ':' + by ',' as a separator. + +2008-09-30 Alexandre Dupas alexandre.dupas@gmail.com + + * make-index : get_first_letter_wo_article added. + + * makefile : use a variable to store the name of the index maker + + * make-index : usage() and get_first_letter() added. + + * make-index : remove the licence. + + * mk-idx.pl : renamed into make-index. + +2008-09-29 Alexandre Dupas alexandre.dupas@gmail.com + + * songs.sty (author): changing style to have /normalsize by default for + each author. + + * makefile (indexes): add rules using mk-idx.pl. + + * mk-idx.pl : script added. + + * makefile (songs): add possibility to have .sbd files to use in songs/. diff --git a/chordbook.tex b/chordbook.tex new file mode 100644 index 00000000..4615e29a --- /dev/null +++ b/chordbook.tex @@ -0,0 +1,113 @@ +% Copyright (C) 2008 Kevin W. Hamlen +% +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +% MA 02110-1301, USA. +% +% The latest version of this program can be obtained from +% http://songs.sourceforge.net. + +\documentclass[letterpaper]{article} +\usepackage[bookmarks]{hyperref} +\usepackage[chorded]{songs} +%\includeonlysongs{1} + +%my packages +\usepackage[utf8]{inputenc} +\usepackage[pdftex]{graphicx, color} +\usepackage[english,frenchb]{babel} +\usepackage{fancybox} + +\setlength{\oddsidemargin}{0in} +\setlength{\evensidemargin}{0in} +\setlength{\textwidth}{6.5in} +\setlength{\topmargin}{0in} +\setlength{\topskip}{0in} +\setlength{\headheight}{0in} +\setlength{\headsep}{0in} +\setlength{\textheight}{9.1in} +\settowidth{\versenumwidth}{1.\ } +\addtolength{\voffset}{-1cm} +\pagestyle{empty} + +\newindex{titleidx}{cbtitle} +\newauthorindex{authidx}{cbauth} + +%Remove comment to include pictures in the songbook +%\newcommand{\image}[2]{\begin{flushright} \includegraphics[width=#2cm]{#1}\end{flushright}} +\newcommand{\image}[2]{} +%\renewcommand{\gtab}[2]{} + +\graphicspath{ + {img/} +} + +%my renew +\titleprefixword{} +\renewcommand{\stitlefont}{\LARGE\bf} +\renewcommand{\printchord}[1]{\small{\it#1}} +\renewcommand{\chorusfont}{\it} +\renewcommand{\everychorus}{\textnote{Refrain:}} +\baselineadj=-2.5pt plus 1pt minus 0pt +\versesep=8pt plus 2pt minus 2pt + +\newlength{\larg} +\setlength{\larg}{14.5cm} + +\title{ +{\rule{\larg}{1mm}}\vspace{7mm} +\begin{tabular}{p{4cm} r} + & {\Huge {Carnet de bord}} \\ + & \\ + & {\Large Recueil de chansons pour guitare} +\end{tabular}\\ +\vspace{2mm} +{\rule{\larg}{1mm}} +\vspace{2mm} \\ +\begin{tabular}{p{11cm} r} + & {\large \bf Version 3.0} \\ + & {\large \today} \\ + & \\ + \small auteur : Romain Goffe & \\ + \small tel : 06 99 57 67 68 & \\ + \small contact : crep@team-on-fire.com& \\ + \small illustrations : \href{http://tux.crystalxp.net/}{CrystalXP.net} + & \\ + \hline +\end{tabular}\\ +%\begin{flushright} \includegraphics[width=7cm]{mawie-mexitux-1894} \end{flushright} +%\begin{figure} \includegraphics[width=6cm]{on-fire} \end{figure} +} +\date{} + +\begin{document} + +\maketitle +\newpage + +\input{license.tex} +\newpage + +\setlength{\colminheight}{9.5in} +\setlength{\textheight}{9.7in} + +\showindex{Index par titre des chansons}{titleidx} +\showindex{Index par titre des auteurs}{authidx} + +\begin{songs}{titleidx,authidx} + \input{songs.sbd} +\end{songs} + +\end{document} + diff --git a/license.tex b/license.tex new file mode 100644 index 00000000..b9c93a0f --- /dev/null +++ b/license.tex @@ -0,0 +1,40 @@ +%License Creative Commons +\begin{center} \textbf{Creative Commons Legal Code} \end{center} +Vous êtes libres : +\begin{itemize} +\item de reproduire, distribuer et communiquer cette création au public +\item de modifier cette création +\end{itemize} +\vspace{1cm} +Selon les conditions suivantes : +\begin{itemize} +\item Paternité. Vous devez citer le nom de l’auteur original de la manière indiquée par l’auteur de l’oeuvre ou le titulaire des + droits qui vous confère cette autorisation (mais pas d’une manière qui suggérerait qu’ils vous soutiennent ou approuvent + votre utilisation de l’oeuvre). Attribute this work : What does ”Attribute this work” mean ? The page you came from + contained embedded licensing metadata, including how the creator wishes to be attributed for re-use. You can use the + HTML here to cite the work. Doing so will also include metadata on your page so that others can find the original work + as well. +\item Pas d’Utilisation Commerciale. Vous n’avez pas le droit d’utiliser cette création à des fins commerciales. +\item Partage des Conditions Initiales à l’Identique. Si vous modifiez, transformez ou adaptez cette création, vous n’avez le +droit de distribuer la création qui en résulte que sous un contrat identique a celui-ci. +\end{itemize} + +\vspace{1cm} +\begin{tabular}{|l|} +\hline +- A chaque réutilisation ou distribution de cette création, vous devez faire\\ +apparaître clairement au public les conditions contractuelles de sa mise à\\ +disposition.\\ +- Chacune de ces conditions peut être levée si vous obtenez l’autorisation du\\ +titulaire des droits sur cette oeuvre.\\ +- Rien dans ce contrat ne diminue ou ne restreint le droit moral de l’auteur ou\\ +des auteurs.\\ +\hline +\end{tabular} +\vspace{1cm} + +Creative Commons peut être contacté a \url{http://creativecommons.org/}. + +Illustrations provenant du site \url{http://tux.crystalxp.net/}. +%\begin{flushright} \includegraphics[width=3cm]{license} \end{flushright} +% Fin de la License diff --git a/lyricbook.tex b/lyricbook.tex new file mode 100644 index 00000000..7c76e92c --- /dev/null +++ b/lyricbook.tex @@ -0,0 +1,112 @@ +% Copyright (C) 2008 Kevin W. Hamlen +% +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +% MA 02110-1301, USA. +% +% The latest version of this program can be obtained from +% http://songs.sourceforge.net. + +\documentclass[letterpaper]{article} +\usepackage[bookmarks]{hyperref} +\usepackage[lyric]{songs} +%\includeonlysongs{1} + +%my packages +\usepackage[utf8]{inputenc} +\usepackage[pdftex]{graphicx, color} +\usepackage[english,frenchb]{babel} +\usepackage{fancybox} + +\setlength{\oddsidemargin}{0in} +\setlength{\evensidemargin}{0in} +\setlength{\textwidth}{6.5in} +\setlength{\topmargin}{0in} +\setlength{\topskip}{0in} +\setlength{\headheight}{0in} +\setlength{\headsep}{0in} +\setlength{\textheight}{9.1in} +\settowidth{\versenumwidth}{1.\ } +\addtolength{\voffset}{-1cm} +\pagestyle{empty} + +\newindex{titleidx}{lbtitle} +\newauthorindex{authidx}{lbauth} + +%Remove comment to include pictures in the songbook +%\newcommand{\image}[2]{\begin{flushright} \includegraphics[width=#2cm]{#1}\end{flushright}} +\newcommand{\image}[2]{} + +\graphicspath{ + {img/} +} + +%my renew +\titleprefixword{} +\renewcommand{\stitlefont}{\LARGE\bf} +\renewcommand{\printchord}[1]{\small{\it#1}} +\renewcommand{\chorusfont}{\it} +\renewcommand{\everychorus}{\textnote{Refrain:}} +\baselineadj=-2.5pt plus 1pt minus 0pt +\versesep=8pt plus 2pt minus 2pt + +\newlength{\larg} +\setlength{\larg}{14.5cm} + +\title{ +{\rule{\larg}{1mm}}\vspace{7mm} +\begin{tabular}{p{4cm} r} + & {\Huge {Carnet de bord}} \\ + & \\ + & {\Large Recueil de chansons pour guitare} +\end{tabular}\\ +\vspace{2mm} +{\rule{\larg}{1mm}} +\vspace{2mm} \\ +\begin{tabular}{p{11cm} r} + & {\large \bf Version 3.0} \\ + & {\large \today} \\ + & \\ + \small auteur : Romain Goffe & \\ + \small tel : 06 99 57 67 68 & \\ + \small contact : crep@team-on-fire.com& \\ + \small illustrations : \href{http://tux.crystalxp.net/}{CrystalXP.net} + & \\ + \hline +\end{tabular}\\ +%\begin{flushright} \includegraphics[width=7cm]{mawie-mexitux-1894} \end{flushright} +%\begin{figure} \includegraphics[width=6cm]{on-fire} \end{figure} +} +\date{} + +\begin{document} + +\maketitle +\newpage + +\input{license.tex} +\newpage + +\setlength{\colminheight}{9.5in} +\setlength{\textheight}{9.7in} + +\showindex{Index par titre des chansons}{titleidx} +\showindex{Index par titre des auteurs}{authidx} + +\begin{songs}{titleidx,authidx} + \input{songs.sbd} +\end{songs} + +\end{document} + diff --git a/make-index b/make-index new file mode 100755 index 00000000..b74b909e --- /dev/null +++ b/make-index @@ -0,0 +1,112 @@ +#!/usr/bin/perl -w +# +# Generate indexes files for the Crep's chorbook compilation. This is a much +# simplified version from the original C programm that parse the input. +# +# Usage: mk-idx.pl SRC +# SRC should be an .sxd file generated by latex during a first compilation +# of the file. +# + +use warnings; +use strict; + +sub uppercase($) +{ + my $letter = shift; + $letter =~ tr/a-zàéèëê/A-ZAEEEE/; + return $letter; +} + +sub get_first_letter($) +{ + my $string = shift; + $string =~ /([\w\d])/; + my $letter = $1; + $letter = "0-9" if ( $letter =~ /\d/ ); # group every numer into one category + return uppercase $letter; +} + +#sub get_first_letter_wo_article($) +#{ +# my $string = shift; +# my $letter; +# if( $string =~ /^(The |L\'|Les |Le |La |Une |Un )/ ) # if there is an article before the name +# { +# $string =~ /$1([\w\d])/; +# $letter = $1; +# } +# else +# { +# $string =~ /([\w\d])/; +# $letter = $1; +# } +# $letter = "0-9" if ( $letter =~ /\d/ ); # group every numer into one category +# return uppercase $letter; +#} + +sub usage +{ + print "usage: make-index source\n"; + exit 1; +} + +# Process command line +usage() unless @ARGV; +my $file = shift; + +# Open file and store data before closing the file +open( FILE, $file ) or die("unable to open $file"); +my @data = ; +close( FILE ); + +#process data +my %table; + +my $type = shift @data; # first line determines the type of the index (AUTHOR or TITLE) + +if( $type =~ /AUTHOR/ ) +{ + ; +} +elsif( $type =~ /TITLE/ ) +{ + shift @data; # ignore the second line (in my test cases, it contains "%prefix" which should probably be ignored. +} + +while( @data ) +{ + my $item = shift @data; + chomp $item; + my $index = shift @data; + chomp $index; + my $link = shift @data; + chomp $link; + + # Get the first letter or number of the current item + my $first_letter = get_first_letter $item; + + $table{$first_letter} = {} unless exists $table{$first_letter}; + + my $ref = { num => $index, link => $link }; + + $table{$first_letter}{$item} = [] unless exists $table{$first_letter}{$item}; + + push @{$table{$first_letter}{$item}}, $ref; +} + +# Create the index formated file +foreach my $letter ( sort keys %table ) +{ + print '\begin{idxblock}{'.$letter."}\n"; + foreach my $item (sort keys %{$table{$letter}} ) + { + print '\idxentry{'; + print $item; + print '}{'; + my @refs = @{$table{$letter}{$item}}; + print join ("\\\\", map { "\\hyperlink{$_->{link}}{$_->{num}}" } @refs); + print '}'."\n"; + } + print '\end{idxblock}'."\n"; +} diff --git a/makefile b/makefile new file mode 100644 index 00000000..5fa79aac --- /dev/null +++ b/makefile @@ -0,0 +1,109 @@ +# Copyright (c) 2008 Alexandre Dupas +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +SRC := $(wildcard *.tex) + +SOURCES := $(shell egrep -l '^[^%]*\\begin\{document\}' *.tex) + +CIBLE = $(SOURCES:%.tex=%) + +PDF = $(CIBLE:%=%.pdf) +PSF = $(CIBLE:%=%.ps.gz) + +SONGS = songs.sbd +SONGS_SRC = $(shell ls songs/*/*.sg) + +MAKE_INDEX=./make-index + +# Get dependencies (that can also have dependencies) +define get_dependencies + deps=`perl -ne '($$_)=/^[^%]*\\\(?:include|input)\{(.*?)\}/;@_=split /,/; foreach $$t (@_) { print "$$t "}' $<` +endef + +# Get inclusion only files (that can not have dependencies) +define get_inclusions + incl=`perl -ne '($$_)=/^[^%]*\\\(?:newauthorindex|newindex)\{.*\}\{(.*?)\}/;@_=split /,/; foreach $$t (@_) { print "$$t.sbx "}' $<` +endef + +define get_prereq + prep=`perl -ne '($$_)=/^[^%]*\\\(?:newauthorindex|newindex)\{.*\}\{(.*?)\}/;@_=split /,/; foreach $$t (@_) { print "$$t.sxd "}' $<` +endef + +############################################################ +### Cibles + +default: pdf + +ps: LATEX = latex +ps: $(PSF) + gv $< + +pdf: LATEX = pdflatex +pdf: $(PDF) + xpdf $< + +clean: + @rm -f $(SRC:%.tex=%.d) + @rm -f $(CIBLE:%=%.aux) + @rm -f $(CIBLE:%=%.toc) + @rm -f $(CIBLE:%=%.out) $(CIBLE:%=%.log) $(CIBLE:%=%.nav) $(CIBLE:%=%.snm) + @rm -f $(CIBLE:%=%.dvi) + @rm -f $(SONGS) + @rm -f *.sbx *.sxd + +cleanall: clean + @rm -f $(PDF) $(PSF) + +depend: + +############################################################ + +$(PSF): LATEX = latex +$(PSF): %.ps.gz: %.ps + gzip -f $< + +%.ps: %.dvi + dvips -o $@ $< + +%.dvi: %.tex %.aux + $(LATEX) $< + +$(PDF): LATEX = pdflatex +$(PDF): %.pdf: %.tex %.aux + $(LATEX) $< + +%.aux: %.tex + $(LATEX) $< + +%.sbx: %.sxd + $(MAKE_INDEX) $< > $@ + +%.d: %.tex + @$(get_dependencies) ; echo $< $@: $$deps > $@ + @$(get_inclusions) ; echo $(patsubst %.tex,%.pdf,$<) : $$incl >> $@ ; + @$(get_prereq) ; echo $$prep : $(patsubst %.tex,%.aux,$<) >> $@ + +include $(SOURCES:%.tex=%.d) + +# songbook related rules +# that is not all but no other rules are easy to move around +%.aux: $(SONGS) + +$(SONGS): $(SONGS_SRC) + @cat $(SONGS_SRC) > $@ + + diff --git a/songs.sty b/songs.sty new file mode 100644 index 00000000..6297209e --- /dev/null +++ b/songs.sty @@ -0,0 +1,3334 @@ +%% +%% This is file `songs.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% songs.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2008 by Kevin W. Hamlen +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3a of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3a or later is part of all distributions of LaTeX version +%% 2004/10/01 or later. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{songs} + [2008/03/27 v2.6 Songs package] +\newif\ifSB@etex +\ifx\eTeXversion\undefined\else + \ifx\eTeXversion\relax\else + \SB@etextrue + \IfFileExists{etex.sty}{\RequirePackage{etex}}{} + \fi +\fi +\newif\ifSB@pdf\SB@pdffalse +\ifx\pdfoutput\undefined\else + \ifx\pdfoutput\relax\else + \ifnum\pdfoutput<\@ne\else + \SB@pdftrue + \fi + \fi +\fi +\newif\ifSB@preamble +\SB@preambletrue +\newif\ifSB@test +\newcommand\SB@temp{} +\newcommand\SB@tempii{} +\newcommand\SB@tempiii{} +\newcommand\SB@tempiv{} +\newcommand\SB@tempv{} +\newdimen\SB@dimen +\newdimen\SB@dimenii +\newdimen\SB@dimeniii +\newdimen\SB@dimeniv +\newdimen\SB@dimenv +\newbox\SB@box +\newbox\SB@boxii +\newbox\SB@boxiii +\newtoks\SB@toks +\newcount\SB@cnt +\newcount\SB@cntii +\newskip\SB@skip +\RequirePackage{keyval} +\newcommand\lyricfont{\normalfont\normalsize} +\newcommand\stitlefont{% + \ifslides\sffamily\Huge\else\sffamily\slshape\Large\fi% +} +\newcommand\versefont{} +\newcommand\chorusfont{} +\newcommand\notefont{} +\newcommand\scripturefont{% + \usefont{OT1}{pzc}{mb}{it}% + \shiftdblquotes{-1.1\p@}\z@{-2\p@}\z@% +} +\newcommand\printscrcite[1]{{\sffamily\small#1}} +\newcommand\versejustify{\justifyleft} +\newcommand\chorusjustify{\justifyleft} +\newcommand\notejustify{% + \advance\baselineskip\p@\relax% + \leftskip\z@skip\rightskip\z@skip% + \parfillskip\@flushglue\parindent\z@% +} +\newcommand\placenote[1]{% + \leftskip\z@skip\rightskip\@flushglue\SB@cbarshift% + \noindent#1\par% +} +\newcommand\songnumstyle[1]{\arabic{#1}} +\newcommand\versenumstyle[1]{\arabic{#1}} +\newcommand\printsongnum[1]{\sffamily\bfseries\LARGE#1} +\newcommand\printversenum[1]{\lyricfont#1.\ } +\newcommand\placeversenum[1]{% + \hskip-\leftskip\hskip-\parindent\relax% + \box#1% +} +\newcommand\everyverse{} +\newcommand\everychorus{} +\newcommand\printchord[1]{\sffamily\slshape\large#1} +\newcommand\chordlocals{} +\newskip\versesep +\versesep123456789sp\relax +\newskip\baselineadj +\baselineadj\z@skip +\parindent.25in +\newlength\idxheadwidth +\setlength\idxheadwidth{1.5cm} +\newlength\songnumwidth +\settowidth\songnumwidth{\printsongnum{999.}} +\newlength\versenumwidth +\settowidth\versenumwidth{\printversenum{9\kern1em}} +\newlength\cbarwidth +\setlength\cbarwidth\p@ +\newlength\sbarheight +\setlength\sbarheight\p@ +\newcount\vvpenalty\vvpenalty-100 +\newcount\ccpenalty\ccpenalty-100 +\newcount\vcpenalty\vcpenalty-100 +\newcount\cvpenalty\cvpenalty-100 +\newcount\spenalty\spenalty0 +\newcommand\songmark{} +\newcommand\versemark{} +\newcommand\chorusmark{} +\newcommand\extendprelude{\showrefs\showauthors} +\newcommand\extendpostlude{\songcopyright\ \songlicense\unskip} +\newlength\colminheight +\setlength\colminheight{123456789sp} +\newdimen\SB@colwidth +\DeclareOption{slides}{\slides} +\newcommand\slides{% + \slidestrue% + \def\lyricfont{\normalfont\huge}% + \def\chorusfont{\slshape}% + \def\versejustify{\justifycenter}% + \let\chorusjustify\versejustify + \def\placenote##1{\justifycenter\noindent##1\par}% + \scriptureoff% + \onesongcolumn% + \ifSB@preamble\ifSB@chordedspec\else\SB@chordsoff\fi\fi% + \spenalty-\@M% + \setlength\cbarwidth\z@% + \setlength\sbarheight\z@% +} +\newcommand\justifyleft{% + \leftskip\parindent% + \ifSB@inverse\advance\leftskip\versenumwidth\fi% + \SB@cbarshift% + \parindent-\parindent% +} +\newcommand\justifycenter{% + \centering\SB@cbarshift\rightskip\leftskip% + \def\placeversenum##1{% + \hskip-\leftskip\hskip-\parindent\relax% + \hangindent-\wd##1\hangafter\m@ne% + \box##1\hfil% + }% +} +\newcommand\SB@outer{\outer} +\DeclareOption{unouter}{\let\SB@outer\relax} +\DeclareOption{rawtext}{\rawtexttrue\indexesoff} +\DeclareOption{nopdfindex}{\pdfindexfalse} +\DeclareOption{noshading}{\SB@colorboxesfalse} +\DeclareOption{noindexes}{\indexesoff} +\newcommand\indexeson{% + \ifSB@preamble% + \SB@genindexestrue% + \else% + \ifSB@genindexes\else\SB@warnigen\fi% + \fi% + \songindexestrue% +} +\newcommand\indexesoff{% + \ifSB@preamble\SB@genindexesfalse\fi% + \songindexesfalse% +} +\newif\ifSB@measurespec +\newif\ifSB@chordedspec +\DeclareOption{chorded}{\chordson} +\DeclareOption{lyric}{\chordsoff} +\newcommand\chordson{\SB@chordedspectrue\SB@chordson} +\newcommand\chordsoff{\SB@chordedspectrue\SB@chordsoff} +\newcommand\SB@chordson{% + \ifrawtext% + \SB@errrtopt% + \else% + \chordedtrue\lyricfalse% + \let\SB@bracket\SB@chord% + \let\SB@rechord\SB@@rechord% + \let\SB@ch\SB@ch@on% + \ifSB@measurespec% + \ifmeasures\SB@measureson\else\SB@measuresoff\fi% + \else% + \SB@measureson% + \fi% + \SB@setbaselineskip% + \fi% +} +\newcommand\SB@chordsoff{% + \chordedfalse\lyrictrue% + \def\SB@bracket##1]{\ignorespaces}% + \let\SB@rechord\relax% + \let\SB@ch\SB@ch@off% + \ifSB@measurespec% + \ifmeasures\SB@measureson\else\SB@measuresoff\fi% + \else% + \SB@measuresoff% + \fi% + \SB@setbaselineskip% +} +\DeclareOption{showmeasures}{\measureson} +\DeclareOption{nomeasures}{\measuresoff} +\newcommand\measureson{\SB@measurespectrue\SB@measureson} +\newcommand\measuresoff{\SB@measurespectrue\SB@measuresoff} +\newcommand\SB@measureson{% + \measurestrue% + \let\SB@mbar\SB@makembar% + \ifchorded% + \let\SB@mch\SB@mch@on% + \else% + \let\SB@mch\SB@mch@m% + \fi% + \ifSB@inverse\SB@loadactives\fi% + \ifSB@inchorus\SB@loadactives\fi% +} +\newcommand\SB@measuresoff{% + \measuresfalse% + \let\SB@mbar\@gobbletwo% + \ifchorded% + \let\SB@mch\SB@ch@on% + \else% + \let\SB@mch\SB@ch@off% + \fi% + \ifSB@inverse\SB@loadactives\fi% + \ifSB@inchorus\SB@loadactives\fi% +} +\DeclareOption{transposecapos}{\transcapostrue} +\DeclareOption{noscripture}{\SB@omitscriptrue} +\newcommand\scriptureon{\SB@omitscripfalse} +\newcommand\scriptureoff{\SB@omitscriptrue} +\DeclareOption{twosongcolumns}{\SB@numcols\tw@} +\DeclareOption{onesongcolumn}{\SB@numcols\@ne} +\newcommand\songcolumns[1]{% + \SB@cnt#1\relax% + \ifnum\SB@cnt<\@ne\SB@errcol\else% + \ifnum\SB@cnt=\SB@numcols\else% + \ifSB@preamble\else\SB@clearpage\fi% + \fi% + \SB@toks{}% + \SB@cntii0 % + \loop% + \expandafter\SB@alloccol\csname SB@cbox\the\SB@cntii\endcsname% + \advance\SB@cntii\@ne% + \ifnum\SB@cntii<\SB@cnt\repeat% + \expandafter\def\expandafter\SB@forallcols% + \expandafter##\expandafter1\expandafter{\the\SB@toks}% + \SB@setcbox% + \SB@numcols\SB@cnt% + \SB@colwidth-\columnsep% + \multiply\SB@colwidth\SB@numcols% + \advance\SB@colwidth\columnsep% + \advance\SB@colwidth\textwidth% + \divide\SB@colwidth\SB@numcols% + \fi% +} +\newcommand\SB@alloccol[1]{% + \ifx#1\undefined\newbox#1\else\ifx#1\relax\newbox#1\fi\fi% + \SB@toks\expandafter{\the\SB@toks##1#1}% +} +\newcommand\onesongcolumn{\songcolumns\@ne} +\newcommand\twosongcolumns{\songcolumns\tw@} +\newcommand\songlist{} +\newcommand\includeonlysongs[1]{% + \ifSB@songsenv\SB@errpl\else% + \partiallisttrue% + \renewcommand\songlist{#1}% + \fi% +} +\newcommand\noversenumbers{% + \renewcommand\printversenum[1]{}% + \setlength\versenumwidth\z@% +} +\ifSB@etex + \newcommand\repchoruses{\repchorustrue} +\else + \newcommand\repchoruses{\SB@erretex} +\fi +\newcommand\norepchoruses{\repchorusfalse} +\newcommand\sepverses{% + \vvpenalty-\@M% + \ccpenalty-100 % + \vcpenalty\vvpenalty% + \cvpenalty\vvpenalty% +} +\AtBeginDocument{ + \ifchorded + \SB@maxcoldiff.8in + \else + \SB@maxcoldiff2in + \fi + \ifdim\colminheight=123456789sp + \ifchorded + \setlength\colminheight\z@ + \else\ifslides + \setlength\colminheight\z@ + \else + \setlength\colminheight\textheight + \fi\fi + \fi + \SB@setversesep + \songcolumns\SB@numcols + \SB@preamblefalse +} +\newbox\SB@songbox +\newcount\SB@numcols\SB@numcols\tw@ +\newcount\SB@colnum +\newcommand\SB@colbox{} +\newcommand\SB@forallcols[1]{} +\newdimen\SB@maxcoldiff +\newcommand\SB@maxmin[3]{\ifdim#1#2#3#1#3\fi} +\newcommand\SB@emitpage{% + \unvbox\voidb@x% + \SB@dimenii\textheight% + \SB@dimeniii\colminheight% + \ifinner\else% + \kern\z@% + \advance\SB@dimenii-\pagetotal% + \advance\SB@dimeniii-\pagetotal% + \fi% + \SB@maxmin\SB@dimeniii<\z@% + \SB@forallcols\SB@epfindmax% + \SB@maxmin\SB@dimeniii>\SB@dimenii% + \let\SB@temp\@gobble% + \hbox{\SB@forallcols\SB@epmakecol}% + \vfil\break% + \ifinner\else\vskip\vsize\relax\fi% +} +\newcommand\SB@epfindmax[1]{% + \ifvoid#1\else% + \global\setbox#1\vbox{\unvbox#1}% + \fi% + \SB@dimen\ht#1% + \ifdim\dp#1>\maxdepth% + \advance\SB@dimen\dp#1% + \advance\SB@dimen-\maxdepth% + \fi% + \SB@maxmin\SB@dimeniii<\SB@dimen% +} +\newcommand\SB@epmakecol[1]{% + \SB@dimen\SB@dimeniii% + \advance\SB@dimeniii-\SB@maxcoldiff% + \ifdim\ht#1<\SB@dimeniii\SB@dimen\ht#1\fi% + \advance\SB@dimeniii2\SB@maxcoldiff% + \ifdim\ht#1>\SB@dimeniii\SB@dimen\ht#1\fi% + \advance\SB@dimeniii-\SB@maxcoldiff% + \SB@maxmin\SB@dimen>\SB@dimenii% + \ifdim\dp#1>\maxdepth% + \advance\SB@dimen-\dp#1% + \advance\SB@dimen\maxdepth% + \fi% + \SB@dimeniv\SB@dimenii% + \advance\SB@dimeniv-\SB@dimen% + \SB@temp\columnsep\let\SB@temp\hskip% + \ifvoid#1\hskip\SB@colwidth\else% + \raise\SB@dimeniv\vbox to\SB@dimen{\unvbox#1}% + \fi% +} +\newcommand\SB@setcbox{% + \global\expandafter\let\expandafter\SB@colbox% + \csname SB@cbox\the\SB@colnum\endcsname% +} +\newcommand\SB@clearpage{% + \SB@testfalse% + \SB@forallcols\SB@cpnonvoid% + \ifSB@test\SB@emitpage\fi% + \ifinner\else\ifdim\pagetotal>\z@% + \vskip\z@skip% + \nointerlineskip% + \null% + \nointerlineskip% + \fi\fi% + \global\SB@colnum0 % + \SB@setcbox% +} +\newcommand\SB@cpnonvoid[1]{\ifvoid#1\else\SB@testtrue\fi} +\newcommand\SB@nextcol{% + \ifnum\SB@numcols=\@ne% + \SB@clearpage% + \else% + \global\advance\SB@colnum\@ne% + \ifnum\SB@colnum=\SB@numcols% + \SB@emitpage% + \global\SB@colnum0 % + \fi% + \SB@setcbox% + \fi% +} +\newcommand\SB@selectcol{% + \begingroup% + \SB@cnt\vbadness% + \vbadness\@M\vfuzz\maxdimen% + \splitmaxdepth\maxdepth\splittopskip\topskip% + \SB@dimen\textheight% + \ifinner\else\advance\SB@dimen-\pagetotal\fi% + \setbox\SB@box\vbox{\unvcopy\SB@colbox\unvcopy\SB@songbox\vfil}% + \setbox\SB@boxii\vsplit\SB@box to\SB@dimen% + \ifvoid\SB@box% + \ifnum\badness>\SB@cnt\SB@trynxtcol\fi% + \else% + \SB@trynxtcol% + \fi% + \endgroup% +} +\newcommand\SB@trynxtcol{% + \SB@cntii\SB@colnum% + \advance\SB@cntii\@ne% + \SB@dimenii\ifnum\SB@cntii=\SB@numcols% + \textheight\else\SB@dimen% + \fi% + \setbox\SB@box\vbox{\unvcopy\SB@songbox\vfil}% + \setbox\SB@boxii\vsplit\SB@box to\SB@dimenii% + \ifvoid\SB@box% + \ifnum\badness>\SB@cnt\SB@tryspan\else\SB@nextcol\fi% + \else% + \SB@tryspan% + \fi% +} +\newcommand\SB@tryspan{% + \setbox\SB@box\vbox{\unvcopy\SB@colbox\unvcopy\SB@songbox\vfil}% + \setbox\SB@boxii\vsplit\SB@box to\SB@dimen% + \ifnum\badness>\SB@cnt\SB@trynxtpg\else% + \SB@testfalse% + \SB@cntii\SB@colnum% + \loop% + \advance\SB@cntii\@ne% + \ifnum\SB@cntii<\SB@numcols% + \setbox\SB@boxii\vsplit\SB@box to\SB@dimenii% + \ifnum\badness>\SB@cnt\SB@testtrue\fi% + \repeat% + \ifvoid\SB@box% + \ifSB@test\SB@trynxtpg\fi% + \else% + \SB@trynxtpg% + \fi% + \fi% +} +\newcommand\SB@trynxtpg{% + \setbox\SB@box\vbox{\unvcopy\SB@songbox\vfil}% + \SB@forallcols\SB@tnpsplit% + \ifvoid\SB@box% + \loop\SB@nextcol\ifnum\SB@colnum>0 \repeat% + \else% + \SB@trydblpg% + \fi% +} +\newcommand\SB@tnpsplit[1]{% + \setbox\SB@boxii\vsplit\SB@box to\textheight% +} +\newcommand\SB@trydblpg{% + \if@twoside% + \SB@forallcols\SB@tnpsplit% + \ifvoid\SB@box% + \loop\SB@nextcol\ifnum\SB@colnum>0 \repeat% + \ifodd\count0 % + \loop\SB@nextcol\ifnum\SB@colnum>0 \repeat% + \fi% + \fi% + \fi% +} +\newcommand\SB@dosubmitsong{% + \SB@selectcol% + \begingroup% + \splitmaxdepth\maxdepth\splittopskip\topskip% + \setbox\SB@box\vbox{% + \unvbox\SB@colbox% + \unvbox\SB@songbox% + \vfil% + }% + \loop% + \SB@dimen\textheight% + \ifinner\else\advance\SB@dimen-\pagetotal\fi% + \setbox\SB@boxii\copy\SB@box% + \global\setbox\SB@colbox\vsplit\SB@box to\SB@dimen% + \edef\SB@temp{\splitfirstmark}% + \ifx\SB@temp\@empty\else\mark{\splitfirstmark}\fi% + \edef\SB@temp{\splitbotmark}% + \ifx\SB@temp\@empty\else\mark{\splitbotmark}\fi% + \ifvoid\SB@box\else% + \SB@nextcol% + \ifrepchorus\ifvoid\SB@chorusbox\else\SB@insertchorus\fi\fi% + \repeat% + \global\setbox\SB@colbox\vbox{\unvbox\SB@boxii\unskip}% + \endgroup% +} +\newcommand\SB@submitsong{% + \ifSB@songsenv% + \ifpartiallist% + \edef\SB@tempii{\songnumstyle{songnum}}% + \@for\SB@temp:=\songlist\do{% + \ifx\SB@temp\SB@tempii% + \expandafter\newbox\csname songbox@\SB@temp\endcsname% + \global\expandafter\setbox\csname songbox@\SB@temp\endcsname% + \box\SB@songbox% + \ifrepchorus\ifvoid\SB@chorusbox\else% + \expandafter\newbox\csname chbox@\SB@temp\endcsname% + \global\expandafter\setbox\csname chbox@\SB@temp\endcsname% + \box\SB@chorusbox% + \fi\fi% + \fi% + }% + \setbox\SB@songbox\box\voidb@x% + \setbox\SB@chorusbox\box\voidb@x% + \else% + \SB@dosubmitsong% + \fi% + \else% + \unvbox\SB@songbox% + \fi% +} +\newcommand\SB@finalizesonglist{% + \ifpartiallist% + \@for\SB@temp:=\songlist\do{% + \expandafter\ifx\csname songbox@\SB@temp\endcsname\relax\else% + \setbox\SB@songbox% + \expandafter\box\csname songbox@\SB@temp\endcsname% + \expandafter\ifx\csname chbox@\SB@temp\endcsname\relax% + \repchorusfalse% + \else% + \repchorustrue% + \setbox\SB@chorusbox% + \expandafter\box\csname chbox@\SB@temp\endcsname% + \fi% + \SB@dosubmitsong% + \fi% + }% + \fi% +} +\newcommand\SB@insertchorus{{% + \vbadness\@M\vfuzz\maxdimen% + \setbox\SB@boxii\copy\SB@box% + \setbox\SB@boxii\vsplit\SB@boxii to\maxdimen% + \edef\SB@temp{\splitfirstmarks\SB@nocmarkclass}% + \ifx\SB@temp\SB@nocmark\else% + \edef\SB@temp{\splitfirstmarks\SB@cmarkclass}% + \ifx\SB@temp\SB@cmark% + \SB@dimen4096\p@% + \SB@dimenii\maxdimen% + \SB@dimeniii\SB@dimen% + \loop% + \SB@dimeniii.5\SB@dimeniii% + \setbox\SB@boxii\copy\SB@box% + \setbox\SB@boxii\vsplit\SB@boxii to\SB@dimen% + \edef\SB@temp{\splitfirstmarks\SB@cmarkclass}% + \ifx\SB@temp\SB@cmark% + \SB@dimenii\SB@dimen% + \advance\SB@dimen-\SB@dimeniii% + \else% + \advance\SB@dimen\SB@dimeniii% + \fi% + \ifdim\SB@dimeniii>2\p@\repeat% + \setbox\SB@boxii\vsplit\SB@box to\SB@dimenii% + \global\setbox\SB@box\vbox{% + \unvbox\SB@boxii\unskip% + \SB@inversefalse\SB@prevversetrue\SB@stanzabreak% + \SB@putbox\unvcopy\SB@chorusbox% + \SB@inversetrue\SB@prevversefalse\SB@stanzabreak% + \unvbox\SB@box% + }% + \else\ifx\SB@temp\SB@lastcmark% + \global\setbox\SB@box\vbox{% + \unvbox\SB@box% + \unskip% + \ifnum\spenalty<-9999\unpenalty\unskip\fi% + \ifdim\sbarheight>\z@% + \unskip\unpenalty% + \setbox\SB@boxii\lastbox% + \unskip\unpenalty% + \fi% + \setbox\SB@boxii\lastbox% + \unskip\unskip% + \SB@inversefalse\SB@prevversetrue\SB@stanzabreak% + \marks\SB@nocmarkclass{\SB@nocmark}% + \unvcopy\SB@chorusbox% + \vskip\versesep\vskip2\p@\@plus4\p@% + \nointerlineskip\box\SB@boxii% + \ifdim\sbarheight>\z@% + \nobreak\vskip2\p@\@plus\p@% + \hrule\@height\sbarheight\@width\SB@colwidth% + \vskip-\p@% + \fi% + \ifnum\spenalty<-9999\vfil\break\fi% + \vfil% + }% + \fi\fi% + \fi% +}} +\newcommand\nextcol{\ifpartiallist\else\SB@nextcol\fi} +\newcounter{songnum} +\newcounter{versenum} +\newcommand\SB@lop[1]{\expandafter\SB@@lop\the#1\SB@@lop#1} +\newcommand\SB@@lop{} +\def\SB@@lop\\#1\\#2\SB@@lop#3#4{\global#4{#1}\global#3{\\#2}} +\newcommand\SB@emptylist{} +\def\SB@emptylist{\\} +\newcommand\SB@ifempty[3]{% + \edef\SB@temp{\the#1}% + \ifx\SB@temp\SB@emptylist#2\else#3\fi% +} +\newtoks\SB@titlelist +\newtoks\SB@titletail +\newcommand\songtitle{} +\newcommand\resettitles{% + \global\SB@titletail\SB@titlelist% + \nexttitle% +} +\newcommand\nexttitle{% + \SB@ifempty\SB@titletail{% + \global\let\songtitle\relax% + }{% + \SB@lop\SB@titletail\SB@toks% + \edef\songtitle{\the\SB@toks}% + }% +} +\newcommand\foreachtitle[1]{% + \ifx\songtitle\relax\else% + \loop#1\nexttitle\ifx\songtitle\relax\else\repeat% + \fi% +} +\newif\ifSB@songsenv\SB@songsenvfalse +\newif\ifSB@insong\SB@insongfalse +\newif\ifSB@inscripture\SB@inscripturefalse +\newif\ifSB@inverse\SB@inversefalse +\newif\ifSB@inchorus\SB@inchorusfalse +\newcommand\SB@rawrefs{} +\newcommand\songauthors{} +\newcommand\songcopyright{} +\newcommand\songlicense{} +\newcommand\songrefs{% + \expandafter\SB@parsesrefs\expandafter{\SB@rawrefs}% +} +\newcommand\SB@prevsong{0} +\newcommand\setlicense{\gdef\songlicense} +\newcommand\SB@clearbskeys{} +\newcommand\newsongkey[2]{% + \expandafter\gdef\expandafter\SB@clearbskeys\expandafter% + {\SB@clearbskeys#2}% + \define@key{beginsong}{#1}% +} +\newsongkey{sr}{\def\SB@rawrefs{}}{\def\SB@rawrefs{#1}} +\newsongkey{by}{\def\songauthors{}}{\def\songauthors{#1}} +\newsongkey{cr}{\def\songcopyright{}}{\def\songcopyright{#1}} +\newsongkey{li}{\setlicense{}}{\setlicense{#1}} +\newsongkey{index}{}{\indexentry{#1}} +\newsongkey{ititle}{}{\indextitleentry{#1}} +\newcommand\beginsong[1]{% + \ifSB@insong% + \SB@errboo% + \ifSB@inverse\endverse\fi% + \ifSB@inchorus\endchorus\fi% + \endsong% + \fi% + \ifSB@inscripture% + \SB@errbor\endscripture% + \fi% + \SB@insongtrue% + \SB@parsetitles{#1}% + \SB@clearbskeys% + \@ifnextchar[\SB@bskvfmt\SB@@beginsong% +} +\newcommand\SB@@beginsong{% + \@ifnextchar\bgroup\SB@bsoldfmt\SB@@@beginsong% +} +\newcommand\SB@bsoldfmt[3]{% + \SB@bskvfmt[sr={#1},by={#2},cr={#3}]% +} +\newcommand\SB@bskvfmt{} +\def\SB@bskvfmt[#1]{% + \setkeys{beginsong}{#1}% + \SB@@@beginsong% +} +\newcommand\SB@@@beginsong{% + \global\SB@stanzafalse% + \setbox\SB@chorusbox\box\voidb@x% + \SB@gotchorusfalse% + \resettitles% + \SB@addtoindexes\songtitle\SB@rawrefs\songauthors% + \nexttitle% + \foreachtitle{\expandafter\SB@addtotitles\expandafter{\songtitle}}% + \resettitles% + \setbox\SB@songbox\vbox\bgroup% + \hsize\SB@colwidth% + \leftskip\z@skip\rightskip\z@skip% + \parfillskip\@flushglue\parskip\z@skip% + \SB@raggedright% + \global\SB@transposefactor0 % + \global\SB@cr@{\\}% + \setcounter{versenum}{1}% + \SB@prevversetrue% + \meter44% + \lyricfont% + \SB@setbaselineskip% +} +\def\endsong{% + \ifSB@insong% + \ifSB@inverse% + \SB@erreov\endverse% + \fi% + \ifSB@inchorus% + \SB@erreoc\endchorus% + \fi% + \global\SB@skip\versesep% + \unskip% + \ifrepchorus\ifvoid\SB@chorusbox\else% + \ifSB@prevverse\ifvnumbered% + \marks\SB@cmarkclass{\SB@lastcmark}% + \fi\fi% + \fi\fi% + \egroup% + \setbox\SB@songbox\vbox{% + \songmark% + \hsize\SB@colwidth% + \leftskip\z@skip\rightskip\z@skip% + \parfillskip\@flushglue\parskip\z@skip\parindent\z@% + \ifdim\sbarheight>\z@% + \hrule\@height\sbarheight\@width\SB@colwidth% + \nobreak\vskip5\p@% + \fi% + \ifpdfindex\begingroup% + \ifx\pdfbookmark\undefined\else% + \ifx\pdfbookmark\relax\else% + \resettitles% + \pdfbookmark[\ifnum\arabic{section}=0 1\else2\fi]% + {\songnumstyle{songnum}. \songtitle}% + {song\arabic{SB@songsnum}-\songnumstyle{songnum}}% + \fi\fi% + \endgroup\fi% + \vbox{\makeprelude}% + \nobreak\vskip\SB@skip% + \vskip2\p@\@plus4\p@% + \unvbox\SB@songbox% + \nobreak\vskip\SB@skip% + \vskip2\p@\@plus4\p@% + \nointerlineskip% + \vbox{\makepostlude}% + \ifdim\sbarheight>\z@% + \nobreak\vskip2\p@\@plus\p@% + \nointerlineskip% + \hbox{\vrule\@height\sbarheight\@width\SB@colwidth}% + \nobreak% + \vskip-\p@\relax% + \fi% + \ifnum\spenalty<-9999\vfil\break\fi% + }% + \SB@insongfalse% + \SB@submitsong% + \edef\SB@prevsong{\songnumstyle{songnum}}% + \stepcounter{songnum}% + \else% + \ifSB@inscripture% + \SB@erreor\endscripture% + \else% + \SB@erreot% + \fi% + \fi% +} +\newcommand\SB@setbaselineskip{% + \SB@dimen\f@size\p@% + \baselineskip\SB@dimen\relax% + \ifchorded% + \setbox\SB@box\hbox{\printchord{ABCDEFG\shrp\flt/j7}}% + \advance\baselineskip\ht\SB@box% + \fi% + \ifslides% + \advance\baselineskip.2\SB@dimen\@plus.5\SB@dimen% + \@minus.2\SB@dimen% + \else% + \advance\baselineskip\z@\@plus.1\SB@dimen\relax% + \fi% + \advance\baselineskip\baselineadj% +} +\newcommand\SB@setversesep{% + \SB@dimen123456789sp% + \edef\SB@temp{\the\SB@dimen}% + \edef\SB@tempii{\the\versesep}% + \ifx\SB@temp\SB@tempii% + \begingroup% + \lyricfont% + \SB@dimen\f@size\p@% + \ifchorded% + \setbox\SB@box\hbox{\printchord{ABCDEFG\shrp\flt/j7}}% + \advance\SB@dimen\ht\SB@box% + \fi% + \ifslides% + \global\versesep1.2\SB@dimen\@plus.3\SB@dimen% + \@minus.3\SB@dimen% + \else% + \global\versesep.75\SB@dimen\@plus.25\SB@dimen% + \@minus.13\SB@dimen% + \fi% + \endgroup% + \fi% +} +\newcommand\makeprelude{% + \resettitles% + \ifslides% + \hbox to\hsize{% + \hfil\stitlefont\songtitle\hfil% + }% + \vskip5\p@% + \hbox to\hsize{% + \hfil% + \vbox{% + \divide\hsize\tw@\parskip\p@\relax% + \centering\small\extendprelude% + }% + \hfil% + }% + \else% + \setbox\SB@boxii\hbox{\SB@colorbox{% + \hbox to\songnumwidth{% + \printsongnum{\songnumstyle{songnum}}\hfil% + }% + }}% + \setbox\SB@box\vbox{% + \hsize\SB@colwidth% + \advance\hsize-\wd\SB@boxii% + \advance\hsize-3\p@% + \SB@raggedright\offinterlineskip\lineskip\p@% + {\stitlefont% + \songtitle\par% + \nexttitle% + \foreachtitle{(\songtitle)\par}}% + \ifdim\prevdepth=\z@\kern\p@\fi% + \parskip\p@\relax\tiny% + \extendprelude% + \kern\z@% + }% + \hbox{% + \ifdim\ht\SB@boxii>\ht\SB@box% + \box\SB@boxii% + \kern3\p@% + \vtop{\box\SB@box}% + \else% + \SB@colorbox{\vbox to\ht\SB@box{% + \hbox to\songnumwidth{% + \printsongnum{\songnumstyle{songnum}}\hfil% + }\vfil% + }}% + \kern3\p@% + \box\SB@box% + \fi% + }% + \fi% +} +\newcommand\makepostlude{% + \SB@raggedright\baselineskip\z@skip\parskip\z@skip\parindent\z@% + \tiny\extendpostlude% +} +\newcommand\showauthors{% + \setbox\SB@box\hbox{\bfseries\sfcode`.\@m\normalsize\songauthors}% + \ifdim\wd\SB@box>\z@\unhbox\SB@box\par\fi% +} +\newcommand\showrefs{% + \setbox\SB@box\hbox{\slshape\songrefs\vphantom,}% + \ifdim\wd\SB@box>\z@\unhbox\SB@box\par\fi% +} +\newcommand\SB@next{} +\newcommand\SB@donext{} +\newcommand\SB@dothis{} +\newcommand\SB@nextname{} +\newcommand\SB@appendsp[1]{#1\expandafter{\the#1 }} +\newcommand\SB@parsetitles[1]{% + \begingroup% + \global\SB@titlelist{\\}% + \SB@toks{}% + \let\\\SB@titlesep% + \let\SB@dothis\SB@pthead% + \SB@ptstart#1\SB@endparse% + \endgroup% +} +\newcommand\SB@ptstart{\futurelet\SB@next\SB@dothis} +\newcommand\SB@pthead{% + \ifcat\noexpand\SB@next\noexpand\@sptoken% + \expandafter\SB@ptsp% + \else% + \SB@toks{}% + \let\SB@dothis\SB@ptmain% + \expandafter\SB@ptmain% + \fi% +} +\newcommand\SB@ptmain{% + \ifcat\noexpand\SB@next\noexpand\@sptoken% + \let\SB@donext\SB@ptsp% + \else\ifcat\noexpand\SB@next\noexpand\bgroup% + \let\SB@donext\SB@ptbg% + \else\ifx\SB@next\SB@endparse% + \global\SB@titlelist\expandafter{\the\SB@titlelist\\}% + \let\SB@donext\@gobble% + \else% + \ifx\SB@next\\% + \SB@toks{}% + \let\SB@dothis\SB@pthead% + \fi% + \let\SB@donext\SB@ptstep% + \fi\fi\fi% + \SB@donext% +} +\newcommand\SB@ptstep[1]{% + \global\SB@titlelist\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\SB@titlelist\the\SB@toks#1}% + \SB@toks{}% + \SB@ptstart% +} +\newcommand\SB@ptbg[1]{\SB@ptstep{{#1}}} +\newcommand\SB@ptsp{ + \SB@appendsp\SB@toks% + \afterassignment\SB@ptstart% + \let\SB@next= } +\newcommand\SB@titlesep{SB@titlesep} +\newcommand\SB@endparse{% + \SB@Error{Title parsing failed}{This error should not occur.}% +} +\newcommand\SB@parsesrefs[1]{% + \begingroup% + \let\SB@temp\relax% + \let\SB@tempii\relax% + \afterassignment\SB@prloop% + \let\SB@tempiii= #1\SB@endparse\relax\relax% + \endgroup% +} +\newcommand\SB@prloop{\futurelet\SB@next\SB@prstep} +\newcommand\SB@testdigit[1]{% + \SB@testfalse% + \ifx0#1\SB@testtrue\fi% + \ifx1#1\SB@testtrue\fi% + \ifx2#1\SB@testtrue\fi% + \ifx3#1\SB@testtrue\fi% + \ifx4#1\SB@testtrue\fi% + \ifx5#1\SB@testtrue\fi% + \ifx6#1\SB@testtrue\fi% + \ifx7#1\SB@testtrue\fi% + \ifx8#1\SB@testtrue\fi% + \ifx9#1\SB@testtrue\fi% +} +\newcommand\SB@prstep{% + \ifcat\noexpand\SB@tempii\noexpand\@sptoken% + \ifcat\noexpand\SB@tempiii A% + \ifcat\noexpand\SB@temp A~% + \else\ifx\SB@temp;% + \penalty-5\hskip.5em\relax% + \else% + \SB@testdigit\SB@temp% + \ifSB@test\nobreak\ \else\SB@tempii\fi% + \fi\fi% + \else\ifcat\noexpand\SB@temp A% + \SB@testdigit\SB@tempiii% + \ifSB@test\nobreak\ \else\SB@tempii\fi% + \else\ifx\SB@temp;% + \ifcat\noexpand\SB@next\noexpand\@sptoken% + \SB@testdigit\SB@tempiii% + \ifSB@test\penalty-5\hskip.5em\relax\else\SB@tempii\fi% + \else% + \SB@tempii% + \fi% + \else% + \SB@tempii% + \fi\fi\fi% + \else\ifx\SB@tempii-% + \ifx\SB@temp-\SB@tempii\else% + \ifx\SB@tempiii-\SB@tempii\else--\fi% + \fi% + \else\ifx\SB@temp,% + \SB@testdigit\SB@tempii% + \ifSB@test\nobreak\thinspace\fi% + \SB@tempii% + \else% + \SB@tempii% + \fi\fi\fi% + \let\SB@temp= \SB@tempii% + \let\SB@tempii= \SB@tempiii% + \ifx\SB@tempiii\SB@endparse\else% + \afterassignment\SB@prloop% + \fi% + \let\SB@tempiii= % +} +\newcommand\brk{% + \ifhmode\penalty-5 % + \else\ifSB@inchorus% + \ifdim\cbarwidth=\z@% + \ifrepchorus\marks\SB@cmarkclass{}\fi% + \SB@breakpoint{-50}% + \else% + \egroup% + \ifrepchorus\ifSB@gotchorus\else% + \global\setbox\SB@chorusbox\vbox{% + \unvbox\SB@chorusbox% + \SB@chorusbar\SB@box% + \unvcopy\SB@box% + \SB@breakpoint{-50}% + }% + \fi\fi% + \SB@chorusbar\SB@box% + \unvbox\SB@box% + \SB@breakpoint{-50}% + \SB@chorustopfalse% + \SB@@beginchorus% + \fi% + \else% + \SB@breakpoint{-50}% + \fi\fi% +} +\newcommand\rep[1]{% + (\raise.25ex\hbox{% + \fontencoding{OMS}\fontfamily{cmsy}\selectfont\char\tw@% + }#1)% +} +\newif\ifSB@stanza +\newcommand\SB@stanzabreak{% + \ifhmode\par\fi% + \ifSB@stanza% + \SB@breakpoint{% + \ifSB@inverse% + \ifSB@prevverse\vvpenalty\else\cvpenalty\fi% + \else% + \ifSB@prevverse\vcpenalty\else\ccpenalty\fi% + \fi% + }% + \vskip\versesep% + \fi% +} +\newcommand\SB@breakpoint[1]{% + \nobreak% + \ifdim\colminheight=\z@\vfil\else% + \SB@dimen\textheight% + \advance\SB@dimen-\colminheight% + \vskip\z@\@plus\SB@dimen% + \fi% + \penalty#1% + \ifdim\colminheight=\z@\vfilneg\else% + \vskip\z@\@plus-\SB@dimen% + \fi% +} +\newcommand\SB@putbox[2]{% + \begingroup% + \SB@dimen\dp#2% + #1#2% + \setbox\SB@box\hbox{\lyricfont p}% + \ifdim\SB@dimen<\dp\SB@box% + \advance\SB@dimen-\dp\SB@box% + \vskip-\SB@dimen% + \fi% + \setbox\SB@box\box\voidb@x% + \endgroup% +} +\newcommand\SB@obeylines{% + \let\par\SB@outerpar% + \obeylines% + \let\par\SB@par% + \let\@par\SB@@par% +} +\newcommand\SB@par{% + \endgraf% + \ifSB@inchorus\ifdim\cbarwidth>\z@\nobreak\fi\fi% +} +\newcommand\SB@@par{\let\par\SB@par\par} +\newcommand\SB@outerpar{} +\AtEndOfPackage{% + \SB@outer\expandafter\def\expandafter\SB@outerpar% + \expandafter{\SB@par}% +} +\newcommand\SB@makecond[1]{% + \SB@@makecond\SB@condyes{#1}{only}% + \SB@@makecond\SB@condno{#1}{never}% +} +\newcommand\SB@@makecond[3]{% + \@ifundefined{begin#2#3}{% + \expandafter\edef\csname begin#2#3\endcsname{% + \noexpand#1% + \expandafter\noexpand\csname if#2\endcsname% + \expandafter\noexpand\csname begin#2#3\endcsname% + \expandafter\noexpand\csname end#2#3\endcsname% + }% + }{}% + \@ifundefined{end#2#3}{% + \expandafter\let\csname end#2#3\endcsname\@empty% + }{}% +} +\SB@makecond{chorded} +\SB@makecond{lyric} +\SB@makecond{slides} +\SB@makecond{partiallist} +\SB@makecond{songindexes} +\SB@makecond{measures} +\SB@makecond{pdfindex} +\SB@makecond{rawtext} +\SB@makecond{transcapos} +\SB@makecond{vnumbered} +\newcommand\SB@condyes[1]{% + #1\expandafter\@gobbletwo\else\expandafter\SB@iffalse\fi% +} +\newcommand\SB@condno[1]{% + #1\expandafter\SB@iffalse\else\expandafter\@gobbletwo\fi% +} +\newcommand\SB@iffalse[2]{% + \begingroup% + \let#1\iffalse% + \let#2\fi% + \catcode`\^^M9 % + \expandafter\endgroup\iffalse% +} +\newdimen\SB@parindent +\newcommand\SB@everypar{} +\newcommand\SB@raggedright{% + \SB@parindent\parindent% + \raggedright% + \parindent\SB@parindent% +} +\newif\ifvnumbered +\newif\ifSB@prevverse +\newcommand\beginverse{% + \ifSB@insong% + \ifSB@inverse% + \SB@errbvv\endverse% + \fi% + \ifSB@inchorus% + \SB@errbvc\endchorus% + \fi% + \else% + \SB@errbvt\beginsong{Unknown Song}% + \fi% + \ifrepchorus\ifvoid\SB@chorusbox\else% + \SB@gotchorustrue% + \ifSB@prevverse\ifvnumbered% + \marks\SB@cmarkclass{\SB@cmark}% + \fi\fi% + \fi\fi% + \begingroup% + \SB@loadactives% + \@ifstar{\global\vnumberedfalse\SB@@beginverse}% + {\global\vnumberedtrue\SB@@beginverse}% +} +\newcommand\SB@@beginverse{% + \endgroup% + \SB@inversetrue% + \SB@stanzabreak% + \versemark\nobreak% + \global\SB@stanzatrue% + \SB@ifempty\SB@cr@\memorize{\replay[]}% + \setbox\SB@box\vbox\bgroup% + \ifvnumbered% + \def\SB@everypar{% + \setbox\SB@box\hbox{% + \printversenum{\versenumstyle{versenum}}% + }% + \ifdim\wd\SB@box<\versenumwidth% + \setbox\SB@box% + \hbox to\versenumwidth{\unhbox\SB@box\hfil}% + \fi% + \ifchorded\vrule\@height\baselineskip\@width\z@\@depth\z@\fi% + \placeversenum\SB@box% + \gdef\SB@everypar{}% + }% + \else% + \def\SB@everypar{% + \ifchorded\vrule\@height\baselineskip\@width\z@\@depth\z@\fi% + \gdef\SB@everypar{}% + }% + \fi% + \everypar{\SB@everypar\everypar{}}% + \interlinepenalty\@M% + \versefont\versejustify% + \SB@loadactives% + \SB@obeylines% + \penalty12345 % + \everyverse\relax% +} +\def\endverse{% + \ifSB@insong% + \ifSB@inverse% + \egroup% + \SB@putbox\unvbox\SB@box% + \SB@inversefalse% + \ifvnumbered\stepcounter{versenum}\fi% + \SB@prevversetrue% + \else\ifSB@inchorus% + \SB@errevc\endchorus% + \else% + \SB@errevo% + \fi\fi% + \else% + \SB@errevt% + \fi% +} +\newif\ifSB@chorustop +\newbox\SB@chorusbox +\newif\ifSB@gotchorus +\ifSB@etex + \@ifundefined{newmarks}{ + \@ifundefined{newmark}{ + \mathchardef\SB@cmarkclass83 + \mathchardef\SB@nocmarkclass84 + }{ + \newmark\SB@cmarkclass + \newmark\SB@nocmarkclass + } + }{ + \newmarks\SB@cmarkclass + \newmarks\SB@nocmarkclass + } +\fi +\newcommand\SB@cmark{} +\def\SB@cmark{SB@cmark} +\newcommand\SB@lastcmark{} +\def\SB@lastcmark{SB@lastcmark} +\newcommand\SB@nocmark{} +\def\SB@nocmark{SB@nocmark} +\newcommand\beginchorus{% + \ifSB@insong + \ifSB@inverse% + \SB@errbcv\endverse% + \fi% + \ifSB@inchorus% + \SB@errbcc\endchorus% + \fi% + \else% + \SB@errbct\beginsong{Unknown Song}% + \fi% + \SB@inchorustrue% + \SB@chorustoptrue% + \vnumberedfalse% + \SB@stanzabreak% + \chorusmark% + \ifrepchorus% + \ifSB@gotchorus\else\ifSB@prevverse\else% + \global\setbox\SB@chorusbox\vbox{% + \unvbox\SB@chorusbox% + \SB@stanzabreak% + \chorusmark% + }% + \fi\fi% + \fi% + \global\SB@stanzatrue% + \replay[]% + \SB@@beginchorus% + \everychorus\relax% +} +\newcommand\SB@@beginchorus{% + \ifrepchorus\marks\SB@cmarkclass{}\fi% + \setbox\SB@box\vbox\bgroup% + \interlinepenalty\@M% + \ifchorded% + \def\SB@everypar{% + \vrule\@height\baselineskip\@width\z@\@depth\z@% + \gdef\SB@everypar{}% + }% + \everypar{\SB@everypar\everypar{}}% + \fi% + \chorusfont\chorusjustify% + \SB@loadactives% + \SB@obeylines% + \penalty12345 % +} +\def\endchorus{% + \ifSB@insong% + \ifSB@inchorus% + \egroup% + \SB@inchorusfalse% + \setbox\SB@box\vbox{% + \SB@chorusbar\SB@box% + \SB@putbox\unvbox\SB@box% + } + \ifrepchorus\ifSB@gotchorus\else% + \global\setbox\SB@chorusbox\vbox{% + \unvbox\SB@chorusbox% + \unvcopy\SB@box% + }% + \fi\fi% + \unvbox\SB@box% + \SB@prevversefalse% + \else\ifSB@inverse% + \SB@errecv\endverse% + \else% + \SB@erreco% + \fi\fi% + \else% + \SB@errect% + \fi% +} +\newcommand\SB@cbarshift{% + \ifSB@inchorus\ifdim\cbarwidth>\z@% + \advance\leftskip\cbarwidth% + \advance\leftskip5\p@\relax% + \fi\fi% +} +\newcommand\SB@chorusbar[1]{% + \ifdim\cbarwidth>\z@% + \SB@dimen\ht#1% + \SB@dimenii\dp#1% + \advance\SB@dimen% + \ifSB@chorustop\ifchorded\else2\fi\fi\SB@dimenii% + \SB@skip\SB@dimen\relax% + \SB@computess\SB@skip1\@plus#1% + \SB@computess\SB@skip{-1}\@minus#1% + \nointerlineskip\null\nobreak% + \leaders\vrule\@width\cbarwidth\vskip\SB@skip% + \ifSB@chorustop\ifchorded\else% + \advance\SB@skip-\SB@dimenii% + \fi\fi% + \vskip-\SB@skip% + \fi% +} +\newcommand\SB@computess[4]{% + \begingroup% + \vbadness\@M\vfuzz\maxdimen% + \SB@dimen4096\p@% + \setbox\SB@box\vbox spread#2\SB@dimen{\unvcopy#4}% + \ifnum\badness=0 % + \global\advance#1\z@#31fil\relax% + \else% + \SB@dimenii\SB@dimen% + \loop% + \SB@dimenii.5\SB@dimenii% + \ifnum\badness<100 % + \advance\SB@dimen\SB@dimenii% + \else + \advance\SB@dimen-\SB@dimenii% + \fi% + \setbox\SB@box\vbox spread#2\SB@dimen{\unvcopy#4}% + \ifnum\badness=100 \SB@dimenii\z@\fi% + \ifdim\SB@dimenii>.1\p@\repeat% + \ifdim\SB@dimen<.1\p@\SB@dimen\z@\fi% + \global\advance#1\z@#3\SB@dimen\relax% + \fi% + \endgroup% +} +\newbox\SB@srbox +\newcommand\beginscripture[1]{% + \ifSB@insong% + \SB@errbro% + \ifSB@inverse\endverse\fi% + \ifSB@inchorus\endchorus\fi% + \endsong% + \fi% + \ifSB@inscripture% + \SB@errbrr\endscripture% + \fi% + \SB@inscripturetrue% + \ifSB@omitscrip% + \setbox\SB@box\vbox\bgroup% + \else% + \setbox\SB@srbox\hbox{\printscrcite{\SB@parsesrefs{#1}}}% + \setbox\SB@songbox\vbox\bgroup% + \hsize\SB@colwidth% + \hrule\@height\p@\@width\SB@colwidth% + \nobreak\vskip5\p@% + \SB@parindent\parindent\parindent\z@% + \parskip\z@skip\parfillskip\@flushglue% + \leftskip\SB@parindent\rightskip\SB@parindent\relax% + \scripturefont% + \baselineskip\f@size\p@\@plus\p@\relax% + \advance\baselineskip\p@\relax% + \emergencystretch.3em% + \fi% +} +\newcommand\scitehere{% + \ifSB@inscripture% + \ifvoid\SB@srbox\else% + \ifvmode% + \setbox\SB@box\lastbox% + \nointerlineskip\noindent\hskip-\leftskip% + \unhbox\SB@box\unskip% + \fi% + \unskip\nobreak\hfil\penalty50\hskip.8em\null\nobreak\hfil% + \box\SB@srbox\kern-\SB@parindent% + {\parfillskip\z@\finalhyphendemerits2000\par}% + \fi% + \else% + \SB@errscrip\scitehere% + \fi% +} +\def\endscripture{% + \ifSB@inscripture + \ifSB@omitscrip% + \egroup% + \setbox\SB@box\box\voidb@x% + \else% + \scitehere% + \ifhmode\par\fi% + \nobreak\kern-4.5\p@% + \hbox{\vrule\@height\p@\@width\SB@colwidth}% + \kern-\p@% + \egroup% + \ifpartiallist\else% + \SB@submitsong% + \fi% + \fi% + \SB@inscripturefalse% + \else% + \ifSB@insong% + \SB@errero% + \ifSB@inverse\endverse\fi% + \ifSB@inchorus\endchorus\fi% + \endsong% + \else% + \SB@errert% + \fi% + \fi% +} +\newcommand\Acolon{\SB@colon2\Acolon} +\newcommand\Bcolon{\SB@colon1\Bcolon} +\newcommand\SB@colon[2]{% + \ifSB@inscripture\else% + \SB@errscrip#2% + \beginscripture{Unknown}% + \fi% + \ifhmode\par\fi% + \begingroup% + \rightskip\SB@parindent\@plus4em% + \advance\leftskip2\SB@parindent% + \advance\parindent-#1\SB@parindent% + \def\par{\endgraf\endgroup}% + \obeylines% +} +\newcommand\strophe{% + \ifSB@inscripture\else% + \SB@errscrip\strophe\beginscripture{Unknown}% + \fi% + \vskip.9ex\@plus.45ex\@minus.68ex\relax% +} +\newcommand\SB@scripdent[2]{% + \ifSB@inscripture\else% + \SB@errscrip#2\beginscripture{Unknown}% + \fi% + \ifhmode\par\fi% + \advance\leftskip#1\SB@parindent\relax% +} +\newcommand\scripindent{\SB@scripdent1\scripindent} +\newcommand\scripoutdent{\SB@scripdent-\scripoutdent} +\newcommand\SB@quotesactive{% + \catcode`'\active% + \catcode``\active% +} +\newcommand\shiftdblquotes[4]{} +\newcommand\SB@ldqleft{} +\newcommand\SB@ldqright{} +\newcommand\SB@rdqleft{} +\newcommand\SB@rdqright{} +\newcommand\SB@scanlq{} +\newcommand\SB@scanrq{} +\newcommand\SB@dolq{} +\newcommand\SB@dorq{} +{ + \SB@quotesactive + \gdef\shiftdblquotes#1#2#3#4{% + \def\SB@ldqleft{\kern#1}% + \def\SB@ldqright{\kern#2}% + \def\SB@rdqleft{\kern#3}% + \def\SB@rdqright{\kern#4}% + \SB@quotesactive% + \def`{\futurelet\SB@next\SB@scanlq}% + \def'{\futurelet\SB@next\SB@scanrq}% + } + \gdef\SB@scanlq{% + \ifx\SB@next`% + \expandafter\SB@dolq% + \else% + \expandafter\lq% + \fi% + } + \gdef\SB@scanrq{% + \ifx\SB@next'% + \expandafter\SB@dorq% + \else% + \expandafter\rq% + \fi% + } + \gdef\SB@dolq`{% + \ifvmode\leavevmode\else\/\fi% + \vadjust{}% + \SB@ldqleft\lq\lq\SB@ldqright% + \vadjust{}% + } + \gdef\SB@dorq'{% + \ifvmode\leavevmode\else\/\fi% + \vadjust{}% + \SB@rdqleft\rq\rq\SB@rdqright% + \vadjust{}% + } +} +\newcommand\SB@boxup[1]{% + \setbox\SB@box\hbox{\notefont#1}% + \SB@dimen\wd\SB@box% + \advance\SB@dimen6\p@% + \advance\SB@dimen\leftskip% + \advance\SB@dimen\rightskip% + \ifdim\SB@dimen>\SB@colwidth% + \vbox{% + \advance\hsize-6\p@% + \advance\hsize-\leftskip% + \advance\hsize-\rightskip% + \notejustify% + \unhbox\SB@box\par% + \kern\z@% + }% + \else% + \vbox{\box\SB@box\kern\z@}% + \fi% +} +\newcommand\textnote[1]{% + \ifhmode\par\fi% + \ifnum\lastpenalty=12345\else% + \ifSB@inverse% + \vskip2\p@\relax% + \else\ifSB@inchorus% + \vskip2\p@\relax% + \else\ifSB@stanza% + \nobreak\vskip\versesep% + \fi\fi\fi% + \fi% + \begingroup% + \everypar{}% + \ifchorded\chordedfalse\SB@setbaselineskip\chordedtrue\fi% + \placenote{\SB@colorbox{\SB@boxup{#1}}}% + \endgroup% + \nobreak% + \ifSB@inverse% + \vskip2\p@\relax% + \else\ifSB@inchorus% + \vskip2\p@\relax% + \else\ifSB@stanza\else% + \nobreak\vskip\versesep% + \fi\fi\fi% +} +\newcommand\musicnote[1]{\ifchorded\textnote{#1}\fi} +\ifSB@etex + \newcommand\echo[1]{% + \begingroup% + \ifdim\fontdimen\@ne\font>\z@\upshape\else\slshape\fi% + \endlinechar-1 % + \scantokens{(#1)}% + \endgroup% + } +\else + \newcommand\echo{% + \begingroup% + \ifdim\fontdimen\@ne\font>\z@\upshape\else\slshape\fi% + \afterassignment\SB@echo% + \setbox\SB@box\hbox% + } + \newcommand\SB@echo{\aftergroup\SB@@echo(} + \newcommand\SB@@echo{\unhbox\SB@box)\endgroup} +\fi +\newcount\SB@transposefactor +\newif\ifSB@convertnotes +\newcommand\notenameA{} +\newcommand\notenameB{} +\newcommand\notenameC{} +\newcommand\notenameD{} +\newcommand\notenameE{} +\newcommand\notenameF{} +\newcommand\notenameG{} +\newcommand\printnoteA{} +\newcommand\printnoteB{} +\newcommand\printnoteC{} +\newcommand\printnoteD{} +\newcommand\printnoteE{} +\newcommand\printnoteF{} +\newcommand\printnoteG{} +\newcommand\notenamesin[7]{% + \def\notenameA{#1}% + \def\notenameB{#2}% + \def\notenameC{#3}% + \def\notenameD{#4}% + \def\notenameE{#5}% + \def\notenameF{#6}% + \def\notenameG{#7}% + \SB@convertnotestrue% +} +\newcommand\notenamesout[7]{% + \def\printnoteA{#1}% + \def\printnoteB{#2}% + \def\printnoteC{#3}% + \def\printnoteD{#4}% + \def\printnoteE{#5}% + \def\printnoteF{#6}% + \def\printnoteG{#7}% + \SB@convertnotestrue% +} +\newcommand\notenames[7]{% + \notenamesin{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \notenamesout{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \SB@convertnotesfalse% +} +\newcommand\alphascale{\notenames ABCDEFG} +\newcommand\solfedge{\notenames{LA}{SI}{DO}{RE}{MI}{FA}{SOL}} +\alphascale +\newif\ifSB@prefshrps +\newif\ifSB@needkey +\newcommand\transpose[1]{% + \advance\SB@transposefactor by#1\relax% + \SB@cnt\SB@transposefactor% + \divide\SB@cnt12 % + \multiply\SB@cnt12 % + \advance\SB@transposefactor-\SB@cnt% + \SB@needkeytrue% +} +\newcommand\capo[1]{% + \iftranscapos\transpose{#1}\else\musicnote{capo #1}\fi% +} +\newcommand\prefersharps{\SB@prefshrpstrue\SB@needkeyfalse} +\newcommand\preferflats{\SB@prefshrpsfalse\SB@needkeyfalse} +\newcommand\transposehere[1]{% + \ifnum\SB@transposefactor=0 % + \ifSB@convertnotes% + \SB@dotranspose{#1}% + \the\SB@toks% + \else% + #1% + \fi% + \else% + \ifSB@convertnotes% + {\SB@transposefactor0 % + \SB@dotranspose{#1}% + \xdef\SB@tempv{\the\SB@toks}}% + \else% + \def\SB@tempv{#1}% + \fi% + \SB@dotranspose{#1}% + \expandafter\trchordformat\expandafter{\SB@tempv}{\the\SB@toks}% + \fi% +} +\newcommand\SB@dotranspose[1]{% + \SB@toks{}% + \let\SB@dothis\SB@trmain% + \SB@trscan#1\SB@trend% +} +\newcommand\trchordformat[2]{#2} +\newcommand\SB@trscan{\futurelet\SB@next\SB@dothis} +\newcommand\SB@trmain{% + \ifx\SB@next\bgroup% + \let\SB@donext\SB@trgroup% + \else\ifx\SB@next\egroup% + \SB@toks\expandafter{\the\SB@toks\egroup}% + \let\SB@donext\SB@trskip% + \else\ifcat\noexpand\SB@next\noexpand\@sptoken% + \SB@appendsp\SB@toks% + \let\SB@donext\SB@trskip% + \else% + \let\SB@donext\SB@trstep% + \fi\fi\fi% + \SB@donext% +} +\newcommand\SB@trgroup[1]{% + \SB@toks\expandafter{\the\SB@toks{#1}}% + \SB@trscan% +} +\newcommand\SB@trskip{% + \afterassignment\SB@trscan% + \let\SB@next= } +\newcommand\SB@trstep[1]{% + \let\SB@donext\SB@trscan% + \ifcat\noexpand\SB@next A% + \ifnum\uccode`#1=`#1% + \def\SB@temp{#1}% + \let\SB@dothis\SB@trnote% + \else% + \SB@toks\expandafter{\the\SB@toks#1}% + \fi% + \else\ifx\SB@next\gtab% + \let\SB@donext\SB@trtab% + \else\ifx\SB@next\SB@trend + \let\SB@donext\relax% + \else% + \SB@toks\expandafter{\the\SB@toks#1}% + \fi\fi\fi% + \SB@donext% +} +\newcommand\SB@trnote{% + \ifcat\noexpand\SB@next A% + \let\SB@donext\SB@trnotestep% + \else\ifnum\SB@transposefactor=0 % + \SB@cnt0 % + \let\SB@donext\SB@trtrans% + \else\ifx\SB@next\flt% + \SB@cnt\m@ne% + \let\SB@donext\SB@tracc% + \else\ifx\SB@next\shrp% + \SB@cnt\@ne% + \let\SB@donext\SB@tracc% + \else% + \SB@cnt0 % + \let\SB@donext\SB@trtrans% + \fi\fi\fi\fi% + \SB@donext% +} +\newcommand\SB@trnotestep[1]{% + \ifnum\uccode`#1=`#1% + \expandafter\def\expandafter\SB@temp\expandafter{\SB@temp#1}% + \expandafter\SB@trscan% + \else% + \SB@cnt0 % + \expandafter\SB@trtrans\expandafter#1% + \fi% +} +\newcommand\SB@tracc[1]{\futurelet\SB@next\SB@trtrans} +\newcommand\SB@trtrans{% + \advance\SB@cnt% + \ifx\SB@temp\notenameA0 % + \else\ifx\SB@temp\notenameB2 % + \else\ifx\SB@temp\notenameC3 % + \else\ifx\SB@temp\notenameD5 % + \else\ifx\SB@temp\notenameE7 % + \else\ifx\SB@temp\notenameF8 % + \else\ifx\SB@temp\notenameG10 % + \else-99 \fi\fi\fi\fi\fi\fi\fi% + \ifnum\SB@cnt<\m@ne% + \SB@toks\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\SB@toks\SB@temp}% + \else% + \advance\SB@cnt\SB@transposefactor% + \ifnum\SB@cnt<0 \advance\SB@cnt12 \fi% + \ifnum\SB@cnt>11 \advance\SB@cnt-12 \fi% + \ifSB@needkey\ifnum\SB@transposefactor=0 \else\SB@setkeysig\fi\fi% + \edef\SB@temp{% + \the\SB@toks% + \ifSB@prefshrps% + \ifcase\SB@cnt\printnoteA\or\printnoteA\noexpand\shrp\or% + \printnoteB\or\printnoteC\or\printnoteC\noexpand\shrp\or% + \printnoteD\or\printnoteD\noexpand\shrp\or\printnoteE\or% + \printnoteF\or\printnoteF\noexpand\shrp\or\printnoteG\or% + \printnoteG\noexpand\shrp\fi% + \else% + \ifcase\SB@cnt\printnoteA\or\printnoteB\noexpand\flt\or% + \printnoteB\or\printnoteC\or\printnoteD\noexpand\flt\or% + \printnoteD\or\printnoteE\noexpand\flt\or\printnoteE\or% + \printnoteF\or\printnoteG\noexpand\flt\or\printnoteG\or% + \printnoteA\noexpand\flt\fi% + \fi}% + \SB@toks\expandafter{\SB@temp}% + \fi% + \let\SB@dothis\SB@trmain% + \SB@trscan% +} +\newcommand\SB@setkeysig{% + \global\SB@needkeyfalse% + \ifcase\SB@cnt% + \global\SB@prefshrpstrue\or% A + \global\SB@prefshrpsfalse\or% Bb + \global\SB@prefshrpstrue\or% B + \ifx\SB@next m% C + \global\SB@prefshrpsfalse% + \else% + \global\SB@prefshrpstrue% + \fi\or% + \global\SB@prefshrpstrue\or% C# + \ifx\SB@next m% D + \global\SB@prefshrpsfalse% + \else% + \global\SB@prefshrpstrue% + \fi\or% + \global\SB@prefshrpsfalse\or% Eb + \global\SB@prefshrpstrue\or% E + \global\SB@prefshrpsfalse\or% F + \global\SB@prefshrpstrue\or% F# + \ifx\SB@next m% G + \global\SB@prefshrpsfalse% + \else% + \global\SB@prefshrpstrue% + \fi\or% + \global\SB@prefshrpsfalse\else% Ab + \global\SB@needkeytrue% non-chord + \fi% +} +\newcommand\SB@trtab{\expandafter\SB@trscan\@firstoftwo} +\newcommand\SB@trend{% + \SB@Error{Internal Error: Transposition failed}% + {This error should not occur.}% +} +\newcommand\SB@metertop{} +\newcommand\SB@meterbot{} +\newcommand\meter[2]{\gdef\SB@metertop{#1}\gdef\SB@meterbot{#2}} +\newcommand\SB@measuremark{SB@IsMeasure} +\newcommand\SB@makembar[2]{% + \ifSB@inverse\else% + \ifSB@inchorus\else\SB@errmbar\fi% + \fi% + \ifhmode% + \SB@skip\lastskip\unskip% + \setbox\SB@box\lastbox% + \copy\SB@box% + \ifvbox\SB@box% + \begingroup% + \setbox\SB@boxii\copy\SB@box% + \vbadness\@M\vfuzz\maxdimen% + \setbox\SB@boxii% + \vsplit\SB@boxii to\maxdimen% + \endgroup% + \long\edef\SB@temp{\splitfirstmark}% + \ifx\SB@temp\SB@measuremark% + \penalty100\hskip1em% + \else% + \penalty100\hskip\SB@skip% + \fi% + \else% + \penalty100\hskip\SB@skip% + \fi% + \fi% + \setbox\SB@box\hbox{\tiny\sffamily{#1}}% + \setbox\SB@boxii\hbox{\tiny\sffamily{#2}}% + \ifdim\wd\SB@box>\wd\SB@boxii% + \SB@dimen\wd\SB@box\relax% + \else% + \SB@dimen\wd\SB@boxii\relax% + \fi% + \ifdim\SB@dimen<.5\p@% + \SB@dimen.5\p@% + \fi% + \SB@dimenii\baselineskip% + \advance\SB@dimenii-2\p@% + \advance\SB@dimenii-\ht\SB@box% + \advance\SB@dimenii-\dp\SB@box% + \advance\SB@dimenii-\ht\SB@boxii% + \advance\SB@dimenii-\dp\SB@boxii% + \ifvmode\leavevmode\fi% + \vbox{% + \mark{\SB@measuremark}% + \hbox to\SB@dimen{% + \hfil% + \box\SB@box% + \hfil% + }% + \nointerlineskip% + \hbox to\SB@dimen{% + \hfil% + \box\SB@boxii% + \hfil% + }% + \nointerlineskip% + \hbox to\SB@dimen{% + \hfil% + \vrule\@width.5\p@\@height\SB@dimenii% + \hfil% + }% + }% +} +\newcommand\mbar{\SB@mbar} +\newcommand\measurebar{% + \mbar\SB@metertop\SB@meterbot% + \meter{}{}% +} +\newif\ifSB@wordends +\newif\ifSB@brokenword +\newtoks\SB@lyric +\newcount\SB@numhyps +\newtoks\SB@lyricnohyp +\newbox\SB@lyricbox +\newbox\SB@chordbox +\newcommand\SB@chbstok{} +\newcommand\SB@setchord{} +{ + \catcode`^\active + \catcode`!7 + \gdef\SB@setchord#1{% + \SB@gettabindtrue\SB@nohattrue% + \setbox\SB@chordbox\hbox{\begingroup% + \ifSB@trackch% + \def\SB@activehat{\ifmmode!\else\global\SB@nohatfalse\fi}% + \else% + \def\SB@activehat{% + \ifmmode!\else\SB@lop\SB@ctail\SB@toks\the\SB@toks\fi% + }% + \fi% + \let^\SB@activehat% + \printchord{\vphantom/\transposehere{#1}\kern.2em}% + \endgroup}% + \SB@gettabindfalse% + \ifSB@trackch\ifSB@nohat% + \global\SB@creg\expandafter{\the\SB@creg#1\\}% + \fi\fi% + \let\SB@noreplay\@firstofone% + } +} +\newcommand\SB@outertest{} +\edef\SB@outertest#1{% + \noexpand\SB@@outertest#1% + \string\outer% + \noexpand\SB@@outertest% +} +\newcommand\SB@@outertest{} +\expandafter\def\expandafter\SB@@outertest% +\expandafter#\expandafter1\string\outer#2\SB@@outertest{% + \def\SB@temp{#2}% + \ifx\SB@temp\@empty\else\SB@testtrue\fi% +} +\newcommand\SB@UTFtest{} +\edef\SB@UTFtest#1{% + \noexpand\SB@UTFtester#1% + \string\UTFviii@zero@octets% + \noexpand\SB@UTFtester% +} +\begingroup + \escapechar\m@ne + \xdef\SB@two{\string\two} + \xdef\SB@three{\string\three} + \xdef\SB@four{\string\four} + \xdef\SB@temp{\string\@octets} +\endgroup +\edef\SB@temp{##1\string\UTFviii@##2\SB@temp##3} +\expandafter\def\expandafter\SB@UTFtester\SB@temp\SB@UTFtester{% + \def\SB@temp{#2}% + \ifx\SB@temp\SB@two% + \SB@cnt\tw@% + \else\ifx\SB@temp\SB@three% + \SB@cnt\thr@@% + \else\ifx\SB@temp\SB@four% + \SB@cnt4 % + \else% + \SB@cnt0 % + \fi\fi\fi% +} +\newcommand\SB@declare[3]{% + \afterassignment\iffalse\let\SB@next= #3\relax\fi% + \expandafter\SB@UTFtest\expandafter{\meaning\SB@next}% + \ifcase\SB@cnt% + \ifcat\noexpand#3\relax% + \SB@addNtest\SB@macrotests#1#2#3% + \else\ifcat\noexpand#3.% + \SB@addDtest\SB@othertests#1#2#3% + \else\ifcat\noexpand#3A% + \SB@addDtest\SB@lettertests#1#2#3% + \else% + \SB@addDtest\relax0#2#3% + \fi\fi\fi% + \or% + \SB@addNtest\SB@macrotests#1#2#3% + \else% + \SB@addMtest\SB@multitests#1#2{#3}% + \fi% +} +\newcommand\DeclareLyricChar{\SB@declare\SB@testtrue0} +\newcommand\DeclareNonLyric{% + \SB@declare\SB@testfalse\SB@testfalse% +} +\newcommand\DeclareNoHyphen{% + \SB@declare\SB@testfalse\SB@testtrue% +} +\newcommand\SB@lettertests{} +\newcommand\SB@macrotests{} +\newcommand\SB@multitests{} +\newcommand\SB@othertests{} +\newcommand\SB@hyphtests{} +\newcommand\SB@addtest[2]{% + \expandafter\gdef\expandafter#1\expandafter{#1#2}% +} +\newcommand\SB@addDtest[4]{% + \ifx0#2\else\SB@addtest#1{\ifx\SB@next#4#2\fi}\fi% + \ifx0#3\else\SB@addtest\SB@hyphtests{\ifx\SB@next#4#3\fi}\fi% +} +\newcommand\SB@addNtest[4]{% + \ifx0#2\else% + \SB@addtest#1{% + \edef\SB@temp{\string#4}\ifx\SB@temp\SB@nextname#2\fi% + }% + \fi% + \ifx0#3\else% + \SB@addtest\SB@hyphtests{% + \edef\SB@temp{\string#4}\ifx\SB@temp\SB@nextname#3\fi% + }% + \fi% +} +\newcommand\SB@addMtest[4]{% + \ifx0#2\else% + \SB@addtest#1{\def\SB@temp{#4}\ifx\SB@next\SB@temp#2\fi}% + \fi% + \ifx0#3\else\SB@addtest\SB@hyphtests{% + \def\SB@temp{#4}\ifx\SB@next\SB@temp#3\fi}% + \fi% +} +\DeclareLyricChar\` +\DeclareLyricChar\' +\DeclareLyricChar\^ +\DeclareLyricChar\" +\DeclareLyricChar\~ +\DeclareLyricChar\= +\DeclareLyricChar\. +\DeclareLyricChar\u +\DeclareLyricChar\v +\DeclareLyricChar\H +\DeclareLyricChar\t +\DeclareLyricChar\c +\DeclareLyricChar\d +\DeclareLyricChar\b +\DeclareLyricChar\oe +\DeclareLyricChar\OE +\DeclareLyricChar\ae +\DeclareLyricChar\AE +\DeclareLyricChar\aa +\DeclareLyricChar\AA +\DeclareLyricChar\o +\DeclareLyricChar\O +\DeclareLyricChar\l +\DeclareLyricChar\L +\DeclareLyricChar\ss +\DeclareLyricChar\i +\DeclareLyricChar\j +\DeclareLyricChar\/ +\DeclareLyricChar\- +\DeclareLyricChar\discretionary +\DeclareNoHyphen\par +\newcommand\SB@bracket{} +\newcommand\SB@chord{\SB@begincname\SB@@chord} +\newcommand\SB@begincname{% + \begingroup% + \catcode`##\active\catcode`&\active% + \chordlocals% +} +\newcommand\SB@endcname{} +\let\SB@endcname\endgroup +\newcommand\SB@nbsp{} +\def\SB@nbsp{\nobreakspace{}} +\newcommand\SB@@chord{} +\def\SB@@chord#1]{% + \endgroup% + \SB@setchord{#1}% + \setbox\SB@lyricbox\hbox{\kern\SB@tabindent}% + \global\SB@tabindent\z@% + \SB@lyric{}% + \SB@numhyps0 % + \SB@spcinit% + \let\SB@dothis\SB@chstart% + \SB@chscan% +} +\newcommand\SB@spcinit{} +\newcommand\MultiwordChords{% + \def\SB@spcinit{% + \let\SB@chdone\SB@chlyrdone% + \def\SB@chimpspace{\let\SB@donext\SB@chdone}% + \def\SB@chexpspace{\let\SB@donext\SB@chdone}% + \let\SB@chespace\SB@chendspace% + }% +} +\newcommand\SB@chscan{% + \let\SB@nextname\relax% + \futurelet\SB@next\SB@chmain% +} +\newcommand\SB@chmain{\SB@dothis\SB@donext} +\newcommand\SB@chstart{% + \ifx\SB@next`% + \let\SB@donext\SB@chstep% + \else\ifx\SB@next'% + \let\SB@donext\SB@chstep% + \else\ifx\SB@next"% + \let\SB@donext\SB@chstep% + \else% + \the\SB@lyric% + \SB@lyric{}% + \let\SB@dothis\SB@chnorm% + \SB@chnorm% + \fi\fi\fi% +} +\newcommand\SB@chnorm{% + \ifcat\noexpand\SB@next A% + \SB@testtrue\SB@lettertests% + \ifSB@test% + \SB@chespace\let\SB@donext\SB@chstep% + \else% + \let\SB@donext\SB@chdone% + \fi% + \else% + \SB@chtrymacro% + \fi% +} +\newcommand\SB@chtrymacro{% + \ifcat\noexpand\SB@next\relax% + \SB@chmacro% + \else% + \SB@chother% + \fi% +} +\newcommand\SB@chother{% + \ifcat\noexpand\SB@next\noexpand\@sptoken% + \SB@chexpspace% + \else\ifcat\noexpand\SB@next\noexpand\bgroup% + \SB@chespace\let\SB@donext\SB@chbgroup% + \else\ifcat\noexpand\SB@next\noexpand\egroup% + \SB@chespace\let\SB@donext\SB@chegroup% + \else\ifx\SB@next-% + \SB@numhyps\@ne\relax% + \SB@lyricnohyp\expandafter{\the\SB@lyric}% + \let\SB@dothis\SB@chhyph% + \SB@chespace\let\SB@donext\SB@chstep% + \else\ifcat\noexpand\SB@next.% + \SB@testtrue\SB@othertests% + \ifSB@test% + \SB@chespace\let\SB@donext\SB@chstep% + \else% + \let\SB@donext\SB@chdone% + \fi% + \else% + \SB@chespace\let\SB@donext\SB@chstep% + \fi\fi\fi\fi\fi% +} +\newcommand\SB@chmacro{% + \SB@testfalse% + \expandafter\SB@outertest\expandafter{\meaning\SB@next}% + \ifSB@test% + \let\SB@donext\SB@chdone% + \else% + \let\SB@donext\SB@chgetname% + \fi% +} +\newcommand\SB@chgetname[1]{% + \edef\SB@nextname{\string#1}% + \SB@@chmacro\SB@donext#1% +} +\newcommand\SB@@chmacro{% + \ifx\SB@next\SB@activehat% + \let\SB@donext\SB@chdone% + \else\ifx\SB@next\measurebar% + \SB@chmbar% + \else\ifx\SB@next\mbar% + \SB@chmbar% + \else\ifx\SB@next\ch% + \SB@chespace\let\SB@donext\SB@chlig% + \else\ifx\SB@next\mch% + \SB@chespace\let\SB@donext\SB@mchlig% + \else\ifx\SB@next\ % + \SB@chimpspace% + \else\ifx\SB@next\SB@nbsp% + \SB@chimpspace% + \else% + \expandafter\SB@UTFtest\expandafter{\meaning\SB@next}% + \ifcase\SB@cnt\SB@chothermac% + \or\or\SB@chespace\let\SB@donext\SB@chsteptwo% + \or\SB@chespace\let\SB@donext\SB@chstepthree% + \or\SB@chespace\let\SB@donext\SB@chstepfour\fi% + \fi\fi\fi\fi\fi\fi\fi% +} +\newcommand\SB@chothermac{% + \SB@testfalse% + \afterassignment\iffalse% + \SB@cnt\expandafter`\SB@nextname x\fi% + \ifnum\the\catcode\SB@cnt=0\else\SB@testtrue\fi% + \SB@macrotests% + \ifSB@test% + \SB@chespace\let\SB@donext\SB@chstep% + \else% + \let\SB@donext\SB@chdone% + \fi% +} +\newcommand\SB@chstep[1]{% + \SB@lyric\expandafter{\the\SB@lyric#1}% + \SB@chscan% +} +\newcommand\SB@chsteptwo[2]{\SB@chmulti{#1#2}} +\newcommand\SB@chstepthree[3]{\SB@chmulti{#1#2#3}} +\newcommand\SB@chstepfour[4]{\SB@chmulti{#1#2#3#4}} +\newcommand\SB@chmulti[1]{% + \def\SB@next{#1}% + \let\SB@nextname\relax% + \SB@testtrue\SB@multitests% + \ifSB@test% + \SB@lyric\expandafter{\the\SB@lyric#1}% + \expandafter\SB@chscan% + \else% + \expandafter\SB@chmstop% + \fi% +} +\newcommand\SB@chmstop{\expandafter\SB@chdone\SB@next} +\newcommand\SB@chhyph{% + \ifx\SB@next-% + \advance\SB@numhyps\@ne\relax% + \let\SB@donext\SB@chstep% + \else% + \let\SB@donext\SB@chdone% + \fi% +} +\newcommand\SB@chimpspace{\let\SB@donext\SB@chdone} +\newcommand\SB@chexpspace{\let\SB@donext\SB@chdone} +\newcommand\SB@chespace{} +\newcommand\SB@chendspace{% + \let\SB@chdone\SB@chlyrdone% + \def\SB@chexpspace{\SB@chbspace\SB@chexpspace}% + \def\SB@chimpspace{\SB@chbspace\SB@chimpspace}% + \def\SB@chespace{}% +} +\newcommand\SB@chbspace{% + \setbox\SB@lyricbox\hbox{% + \unhbox\SB@lyricbox% + \the\SB@lyric% + }% + \SB@lyric{}% + \ifdim\wd\SB@lyricbox<\wd\SB@chordbox% + \let\SB@chbstok= \SB@next% + \def\SB@chexpspace{\let\SB@donext\SB@chgetspace}% + \def\SB@chimpspace{\let\SB@donext\SB@chstep}% + \let\SB@chespace\SB@chendspace% + \let\SB@chdone\SB@chspcdone% + \else% + \def\SB@chimpspace{\let\SB@donext\SB@chdone}% + \def\SB@chexpspace{\let\SB@donext\SB@chdone}% + \fi% +} +\newcommand\SB@chgetspace{% + \SB@appendsp\SB@lyric% + \let\SB@nextname\relax% + \afterassignment\SB@chscan% + \let\SB@next= } +\newcommand\SB@chmbar{% + \ifmeasures% + \let\SB@donext\SB@chdone% + \else% + \SB@chespace\let\SB@donext\SB@chstep% + \fi% +} +\newcommand\SB@chbgroup[1]{% + \SB@lyric\expandafter{\the\SB@lyric{#1}}% + \SB@chscan% +} +\newcommand\SB@chegroup{% + \let\SB@nextname\relax% + \afterassignment\SB@chegrpscan% + \let\SB@next= } +\newcommand\SB@chegrpscan{% + \futurelet\SB@next\SB@chegrpmacro% +} +\newcommand\SB@chegrpmacro{% + \ifcat\noexpand\SB@next\relax% + \expandafter\SB@chegrpouter% + \else% + \expandafter\SB@chegrpdone% + \fi% +} +\newcommand\SB@chegrpouter{% + \SB@testfalse% + \expandafter\SB@outertest\expandafter{\meaning\SB@next}% + \ifSB@test% + \expandafter\SB@chegrpdone% + \else% + \expandafter\SB@chegrpname% + \fi% +} +\newcommand\SB@chegrpname[1]{% + \edef\SB@nextname{\string#1}% + \SB@chegrpdone#1% +} +\newcommand\SB@chegrpdone{\SB@chdone\egroup} +\newcommand\SB@chlig[5]{% + \gdef\SB@ligpre{{#3}}% + \gdef\SB@ligpost{\[#2]{#4}}% + \gdef\SB@ligfull{\[\SB@noreplay{\hphantom{#3}}#2]{#5}}% + \SB@chdone% +} +\newcommand\SB@mchlig[5]{% + \SB@lyric\expandafter{\the\SB@lyric#3}% + \let\SB@next\measurebar% + \edef\SB@nextname{\string\measurebar}% + \gdef\SB@ligpost{\measurebar\[#2]{#4}}% + \gdef\SB@ligfull{\measurebar\[#2]{#4}}% + \SB@chdone% +} +\newcommand\SB@chlyrdone{% + \setbox\SB@lyricbox\hbox{% + \unhbox\SB@lyricbox% + \ifnum\SB@numhyps=\@ne% + \the\SB@lyricnohyp% + \else% + \the\SB@lyric% + \fi% + }% + \SB@emitchord% +} +\newcommand\SB@chspcdone{% + \let\SB@nextname\relax% + \let\SB@next= \SB@chbstok% + \expandafter\SB@emitchord\the\SB@lyric% +} +\newcommand\SB@chdone{} +\let\SB@chdone\SB@chlyrdone +\newcommand\SB@ligpre{} +\newcommand\SB@ligpost{} +\newcommand\SB@ligfull{} +\newcommand\SB@clearlig{% + \gdef\SB@ligpre{}% + \gdef\SB@ligpost{}% + \gdef\SB@ligfull{}% +} +\newcommand\SB@emitchord{% + \ifSB@inverse\else\ifSB@inchorus\else\SB@errchord\fi\fi% + \SB@testfalse% + \ifcat\noexpand\SB@next\noexpand\@sptoken\SB@testtrue\fi% + \ifcat\noexpand\SB@next.\SB@testtrue\fi% + \ifx\SB@next\SB@outerpar\SB@testtrue\fi% + \ifx\SB@next\egroup\SB@testtrue\fi% + \SB@hyphtests% + \ifSB@test\SB@wordendstrue\else\SB@wordendsfalse\fi% + \SB@dimen\wd\SB@chordbox% + \ifvmode\leavevmode\fi% + \SB@brokenwordfalse% + \ifdim\wd\SB@lyricbox>\z@% + \ifdim\SB@dimen>\wd\SB@lyricbox% + \ifSB@wordends\else\SB@brokenwordtrue\fi% + \fi% + \else% + \SB@skip\lastskip% + \unskip\penalty200\hskip\SB@skip% + \fi% + \ifnum\SB@numhyps>0 % + \ifnum\SB@numhyps>\@ne\relax% + \SB@brokenwordfalse% + \else% + \SB@brokenwordtrue% + \fi% + \fi% + \vbox{\baselineskip\f@size\p@\kern2\p@% + \ifSB@brokenword% + \global\setbox\SB@lyricbox\hbox{% + \unhbox\SB@lyricbox% + \SB@ligpre% + }% + \ifdim\wd\SB@lyricbox>\SB@dimen% + \SB@dimen\wd\SB@lyricbox% + \fi% + \advance\SB@dimen.5em% + \hbox to\SB@dimen{\unhbox\SB@chordbox\hfil}% + \kern-2\p@% + \hbox to\SB@dimen{% + \unhcopy\SB@lyricbox\hfil\char\hyphenchar\font\hfil% + }% + \global\SB@cnt\@m% + \gdef\SB@temp{\expandafter\SB@clearlig\SB@ligpost}% + \else% + \hbox{\unhbox\SB@chordbox\hfil}% + \kern-2\p@% + \hbox{% + \unhcopy\SB@lyricbox% + \global\SB@cnt\spacefactor% + \hfil% + }% + \gdef\SB@temp{\expandafter\SB@clearlig\SB@ligfull}% + \fi% + }% + \ifSB@wordends% + \ifdim\wd\SB@lyricbox>\z@\else\nobreak\fi% + \else% + \nobreak\spacefactor\SB@cnt% + \fi% + \SB@temp% +} +\newcommand\shrp{\raise3\p@\hbox{\small\#}\kern-\p@} +\newcommand\flt{\thinspace\raise3\p@\hbox{\normalsize$\flat$}} +\newcommand\ch{\SB@ch} +\newcommand\SB@ch{} +\newcommand\SB@ch@on{\SB@begincname\SB@@ch} +\newcommand\SB@@ch[1]{\SB@endcname\SB@@@ch{#1}} +\newcommand\SB@@@ch[4]{\[\SB@noreplay{\hphantom{#2}}#1]#4} +\newcommand\SB@ch@off[4]{#4} +\newcommand\mch{\SB@mch} +\newcommand\SB@mch{} +\newcommand\SB@mch@m[4]{#2\measurebar#3} +\newcommand\SB@mch@on{\SB@begincname\SB@@mch} +\newcommand\SB@@mch[1]{\SB@endcname\SB@@@mch{#1}} +\newcommand\SB@@@mch[4]{#2\measurebar\[#1]#3} +\newcommand\SB@activehat{% + \ifmmode^\else\expandafter\SB@rechord\fi% +} +\newcommand\SB@loadactives{} +{ + \catcode`&\active + \catcode`#\active + \catcode`|\active + \catcode`^\active + \global\let&\flt + \global\let#\shrp + \global\let|\measurebar + \global\let^\SB@activehat + \gdef\SB@loadactives{% + \catcode`^\ifchorded\active\else9 \fi% + \catcode`|\ifmeasures\active\else9 \fi% + \def\[{\SB@bracket}% + } +} +\newif\ifSB@trackch +\newtoks\SB@cr@ +\newtoks\SB@ctail +\newcommand\SB@creg{} +\newcommand\newchords[1]{% + \@ifundefined{SB@cr@#1}{% + \expandafter\newtoks\csname SB@cr@#1\endcsname% + \global\csname SB@cr@#1\endcsname{\\}% + }{\SB@errdup{#1}}% +} +\newcommand\memorize{% + \@ifnextchar[\SB@memorize{\SB@memorize[]}% +} +\newcommand\SB@memorize{} +\def\SB@memorize[#1]{% + \@ifundefined{SB@cr@#1}{\SB@errreg{#1}}{% + \SB@trackchtrue% + \global\expandafter\let\expandafter\SB@creg% + \csname SB@cr@#1\endcsname% + \global\SB@creg{\\}% + }% +} +\newcommand\replay{\@ifnextchar[\SB@replay\SB@@replay} +\newcommand\SB@replay{} +\def\SB@replay[#1]{% + \@ifundefined{SB@cr@#1}{\SB@errreg{#1}}{% + \SB@trackchfalse% + \global\expandafter\let\expandafter\SB@creg% + \csname SB@cr@#1\endcsname% + \global\SB@ctail\SB@creg% + }% +} +\newcommand\SB@@replay{% + \SB@trackchfalse% + \global\SB@ctail\SB@creg% +} +\newcommand\SB@rechord{} +\newcommand\SB@@rechord{% + \SB@ifempty\SB@ctail{% + \SB@errreplay% + \SB@toks{}% + \let\SB@donext\@gobble% + }{% + \SB@lop\SB@ctail\SB@toks% + \let\SB@donext\SB@chord% + \let\SB@noreplay\@gobble% + }% + \expandafter\SB@donext\the\SB@toks]% +} +\newif\ifSB@nohat +\newcommand\SB@noreplay{} +\let\SB@noreplay\@firstofone +\newlength\SB@fretwidth +\setlength\SB@fretwidth{6\p@} +\newcommand\SB@fretnum[1]{{% + \sffamily\fontsize{10}{10}\selectfont#1% +}} +\newcommand\SB@onfret[1]{% + \rlap{\hbox to\SB@fretwidth{\hfil\vrule\@height6\p@\hfil}}% + \hbox to\SB@fretwidth{\hfil#1\hfil}% +} +\newcommand\SB@atopfret[1]{% + \hbox to\SB@fretwidth{\hfil#1\hfil}% +} +\newcommand\SB@fretbar{% + \nointerlineskip% + \SB@dimen5\SB@fretwidth% + \advance\SB@dimen.4\p@% + \hbox to6\SB@fretwidth{% + \hfil% + \vrule\@width\SB@dimen\@height.4\p@\@depth\z@% + \hfil% + }% + \nointerlineskip% +} +\newcommand\SB@topempty{\SB@atopfret{}} +\newcommand\SB@topX{\SB@atopfret{% + \hbox{% + \kern-.2\p@% + \fontencoding{OMS}\fontfamily{cmsy}% + \fontseries{m}\fontshape{n}% + \fontsize{7}{7}\selectfont\char\tw@% + \kern-.2\p@% + }% +}} +\newcommand\SB@topO{\SB@atopfret{% + \vrule\@width\z@\@height4.3333\p@\@depth.8333\p@% + \lower.74\p@\hbox{% + \fontencoding{OMS}\fontfamily{cmsy}% + \fontseries{m}\fontshape{n}% + \fontsize{10}{10}\selectfont\char14% + }% +}} +\newcommand\SB@fretempty{\SB@onfret{}} +\newcommand\SB@frethit{\SB@onfret{% + \hbox{% + \fontencoding{OMS}\fontfamily{cmsy}% + \fontseries{m}\fontshape{n}% + \fontsize{12}{12}\selectfont\char15% + }% +}} +\newcommand\SB@finger[1]{% + \SB@atopfret{\sffamily\fontsize{6}{6}\selectfont#1}% +} +\newif\ifSB@gettabind\SB@gettabindfalse +\newdimen\SB@tabindent +\newcommand\SB@targfret{} +\newcommand\SB@targstr{} +\newcommand\SB@targfing{} +\newcommand\gtab{\SB@begincname\SB@gtab} +\newcommand\SB@gtab[1]{\SB@endcname\SB@@gtab{#1}} +\newcommand\SB@@gtab[2]{% + \SB@tabargs#2\relax\relax\relax\relax\relax\relax\relax\fi% + \ifvmode\leavevmode\fi% + \vbox{% + \normalfont\normalsize% + \setbox\SB@box\hbox{% + \thinspace{\printchord{#1\strut}}\thinspace% + }% + \setbox\SB@boxii\hbox{\SB@fretnum{\SB@targfret}}% + \hsize\wd\SB@box% + \SB@dimen\wd\SB@boxii% + \ifSB@gettabind% + \global\SB@tabindent\SB@dimen% + \global\advance\SB@tabindent.5\SB@fretwidth% + \global\advance\SB@tabindent-.5\p@% + \fi% + \advance\SB@dimen6\SB@fretwidth% + \ifdim\hsize<\SB@dimen% + \hsize\SB@dimen% + \else\ifSB@gettabind% + \SB@dimenii\hsize% + \advance\SB@dimenii-\SB@dimen% + \divide\SB@dimenii\tw@% + \global\advance\SB@tabindent\SB@dimenii% + \fi\fi% + \hbox to\hsize{\hfil\unhbox\SB@box\hfil}% + \kern-2\p@% + \hbox to\hsize{% + \hfil% + \vbox{\box\SB@boxii\kern18\p@}% + \vbox{% + \let\X\SB@topX\let\0\SB@topO% + \let\1\SB@topempty\let\2\SB@topempty% + \let\3\SB@topempty\let\4\SB@topempty% + \hbox to6\SB@fretwidth{\SB@targstr}% + \nointerlineskip% + \let\X\SB@fretempty\let\0\SB@fretempty% + \let\1\SB@frethit\let\2\SB@fretempty% + \let\3\SB@fretempty\let\4\SB@fretempty% + \SB@fretbar\hbox{\SB@targstr}% + \let\1\SB@fretempty\let\2\SB@frethit% + \SB@fretbar\hbox{\SB@targstr}% + \let\2\SB@fretempty\let\3\SB@frethit% + \SB@fretbar\hbox{\SB@targstr}% + \let\3\SB@fretempty\let\4\SB@frethit% + \SB@fretbar\hbox{\SB@targstr}% + \SB@fretbar% + \ifx\SB@targsfing\@empty\else% + \let\X\SB@topempty\let\0\SB@topempty% + \def\1{\SB@finger1}\def\2{\SB@finger2}% + \def\3{\SB@finger3}\def\4{\SB@finger4}% + \kern1.5\p@% + \hbox to6\SB@fretwidth{\SB@targfing}% + \fi% + }% + \hfil% + }% + \kern3\p@% + }% + \SB@gettabindfalse% +} +\newcommand\SB@ctoken{} \def\SB@ctoken{,} +\newcommand\SB@xtoken{} \def\SB@xtoken{X} +\newcommand\SB@otoken{} \def\SB@otoken{O} +\newcommand\SB@tokenz{} \def\SB@tokenz{0} +\newcommand\SB@tokeni{} \def\SB@tokeni{1} +\newcommand\SB@tokenii{} \def\SB@tokenii{2} +\newcommand\SB@tokeniii{} \def\SB@tokeniii{3} +\newcommand\SB@tokeniv{} \def\SB@tokeniv{4} +\newcommand\SB@tdone{} \def\SB@tdone{\relax} + +\newcommand\SB@tabargs[2]{% + \def\SB@targfret{#1}% + \ifx\SB@targfret\SB@ctoken% + \let\SB@targfret\@empty% + \def\SB@donext{\SB@@tabargs{#2}}% + \else% + \def\SB@temp{#2}% + \ifx\SB@temp\SB@ctoken% + \let\SB@donext\SB@@tabargs% + \else% + \let\SB@targfret\@empty% + \def\SB@donext{\SB@@tabargs{#1}{#2}}% + \fi% + \fi% + \SB@donext% +} +\newcommand\SB@@tabargs[7]{% + \let\SB@targstr\@empty% + \let\SB@targfing\@empty% + \SB@tabarg\SB@targstr{#1}% + \SB@tabarg\SB@targstr{#2}% + \SB@tabarg\SB@targstr{#3}% + \SB@tabarg\SB@targstr{#4}% + \SB@tabarg\SB@targstr{#5}% + \SB@tabarg\SB@targstr{#6}% + \def\SB@temp{#7}% + \ifx\SB@temp\SB@ctoken% + \let\SB@donext\SB@@@tabargs% + \else% + \ifx\SB@temp\SB@tdone\else\SB@errtabx\fi% + \def\SB@donext{\iffalse}% + \@gobble\fi% + \fi% + \SB@donext% +} +\newcommand\SB@@@tabargs[7]{% + \def\SB@temp{#1}% + \ifx\SB@temp\SB@tdone\else% + \SB@tabarg\SB@targfing{#1}% + \SB@tabarg\SB@targfing{#2}% + \SB@tabarg\SB@targfing{#3}% + \SB@tabarg\SB@targfing{#4}% + \SB@tabarg\SB@targfing{#5}% + \SB@tabarg\SB@targfing{#6}% + \def\SB@temp{#7}% + \ifx\SB@temp\SB@tdone\else\SB@errtabx\fi% + \fi% + \iffalse% +} +\newcommand\SB@tabarg[2]{% + \def\SB@temp{#2}% + \ifx\SB@temp\SB@xtoken\SB@@tabarg#1\X\else% + \ifx\SB@temp\SB@ytoken\SB@@tabarg#1\0\else% + \ifx\SB@temp\SB@tokenz\SB@@tabarg#1\0\else% + \ifx\SB@temp\SB@tokeni\SB@@tabarg#1\1\else% + \ifx\SB@temp\SB@tokenii\SB@@tabarg#1\2\else% + \ifx\SB@temp\SB@tokeniii\SB@@tabarg#1\3\else% + \ifx\SB@temp\SB@tokeniv\SB@@tabarg#1\4\else% + \SB@errtab\SB@@tabarg#1\0% + \fi\fi\fi\fi\fi\fi\fi% +} +\newcommand\SB@@tabarg[2]{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} +\newcommand\songchapter{% + \let\SB@temp\@seccntformat% + \def\@seccntformat##1{}% + \@startsection{chapter}{0}{\z@}% + {3.5ex\@plus1ex\@minus.2ex}% + {.4ex\let\@seccntformat\SB@temp}% + {\sffamily\bfseries\LARGE\centering}% +} +\newcommand\songsection{% + \let\SB@temp\@seccntformat% + \def\@seccntformat##1{}% + \@startsection{section}{1}{\z@}% + {3.5ex\@plus1ex\@minus.2ex}% + {.4ex\let\@seccntformat\SB@temp}% + {\sffamily\bfseries\LARGE\centering}% +} +\newenvironment{songs}[1]{% + \SB@clearpage% + \gdef\SB@indexlist{#1}% + \SB@chkidxlst% + \stepcounter{SB@songsnum}% + \setcounter{songnum}{1}% + \SB@songsenvtrue% +}{% + \SB@finalizesonglist% + \SB@clearpage% + \clearpage% + \thispagestyle{empty}% + \cleardoublepage% + \SB@songsenvfalse% +} +\newcounter{SB@songsnum} +\newcommand\SB@indexlist{} +\newcommand\SB@newindex[4]{% + \expandafter\newcommand\csname SB@idxfilename@#3\endcsname{#4}% + \ifSB@genindexes\begingroup% + \newwrite\SB@theindex% + \immediate\openout\SB@theindex=#4.sxd% + #2% + \global\expandafter\let\csname SB@index@#3\endcsname\SB@theindex% + \endgroup\fi% + \expandafter\newcommand\csname SB@idxsel@#3\endcsname[3]{###1}% +} +\newcommand\newindex[2]{% + \AtBeginDocument{\SB@newindex1\SB@titleinit{#1}{#2}}% +} +\@onlypreamble\newindex +\newcommand\SB@titleinit{% + \immediate\write\SB@theindex{TITLE INDEX DATA FILE}% +} +\newcommand\newscripindex[2]{% + \AtBeginDocument{\SB@newindex2\SB@scripinit{#1}{#2}}% +} +\@onlypreamble\newscripindex +\newcommand\SB@scripinit{% + \immediate\write\SB@theindex{SCRIPTURE INDEX DATA FILE}% +} +\newcommand\newauthorindex[2]{% + \AtBeginDocument{\SB@newindex3\SB@authinit{#1}{#2}}% +} +\@onlypreamble\newauthorindex +\newcommand\SB@authinit{% + \immediate\write\SB@theindex{AUTHOR INDEX DATA FILE}% +} +\newcommand\SB@percent{} +{\catcode`\%=12\gdef\SB@percent{%}} +\newcommand\SB@idxcmd[2]{% + \expandafter\gdef\expandafter#1\expandafter{% + #1\immediate\write\SB@theindex{\SB@percent#2}% + }% +} +\newcommand\authsepword[1]{\SB@idxcmd\SB@authinit{sep #1}} +\@onlypreamble\authsepword +\newcommand\authbyword[1]{\SB@idxcmd\SB@authinit{after #1}} +\@onlypreamble\authbyword +\newcommand\authignoreword[1]{\SB@idxcmd\SB@authinit{ignore #1}} +\@onlypreamble\authignoreword +\newcommand\titleprefixword[1]{\SB@idxcmd\SB@titleinit{prefix #1}} +\@onlypreamble\titleprefixword +\newcommand\SB@addtoindex[2]{% + \ifSB@genindexes% + \immediate\write#1{#2}% + \immediate\write#1{\songnumstyle{songnum}}% + \immediate\write#1{% + song\arabic{SB@songsnum}-\songnumstyle{songnum}.% + \ifnum\arabic{section}=0 1\else2\fi}% + \fi% +} +\newcommand\SB@addtoindexes[3]{% + \@for\SB@temp:=\SB@indexlist\do{% + \csname SB@idxsel@\SB@temp\endcsname{\SB@toks\expandafter{#1}}% + {\SB@toks\expandafter{#2}}{\SB@toks\expandafter{#3}}% + \SB@addtoindex{\csname SB@index@\SB@temp\endcsname}{\the\SB@toks}% + }% +} +\newcommand\SB@addtotitles[1]{% + \SB@toks{#1}% + \@for\SB@temp:=\SB@indexlist\do{% + \csname SB@idxsel@\SB@temp\endcsname{% + \SB@addtoindex{\csname SB@index@\SB@temp\endcsname}{\the\SB@toks}% + }{}{}% + }% +} +\newcommand\SB@chkidxlst{% + \let\SB@temp\SB@indexlist% + \let\SB@indexlist\@empty% + \@for\SB@tempii:=\SB@temp\do{% + \@ifundefined{SB@idxsel@\SB@tempii}{\SB@errnoidx\SB@tempii}{% + \ifx\SB@indexlist\@empty% + \SB@toks\expandafter{\SB@tempii}% + \else% + \SB@toks\expandafter\expandafter\expandafter{% + \expandafter\SB@indexlist\expandafter,\SB@tempii}% + \fi% + \edef\SB@indexlist{\the\SB@toks}% + }% + }% +} +\newcommand\indexentry{\@ifnextchar[{\SB@idxentry*}{\SB@@idxentry*}} +\newcommand\SB@idxentry{} +\def\SB@idxentry#1[#2]#3{{% + \def\SB@indexlist{#2}% + \SB@chkidxlst% + \SB@addtoindexes{#1#3}{#3}{#3}% +}} +\newcommand\SB@@idxentry[2]{\SB@addtotitles{#1#2}} +\newcommand\indextitleentry{% + \@ifnextchar[{\SB@idxentry{}}{\SB@@idxentry{}}% +} +\newbox\SB@idxtitlebox +\newcommand\SB@idxlineskip[1]{% + \vskip#1\p@\@plus#1\p@\@minus#1\p@% +} +\newcommand\SB@multiline{% + \begingroup% + \hbadness\@M\hfuzz\maxdimen% + \SB@dimenii\hsize% + \advance\SB@dimenii-\SB@dimen% + \SB@dimeniii\SB@dimenii% + \advance\SB@dimeniii-\wd\SB@box% + \interlinepenalty\@M% + \parshape\tw@\z@\hsize\SB@dimenii\SB@dimen\relax% + \noindent\unhcopy\SB@box% + \leaders\hbox to.5em{\hss.\hss}\hskip\SB@dimeniii\@plus1fil% + \unhcopy\SB@boxii% + \par% + \endgroup% +}% +\newcommand\SB@balancerows{% + \SB@dimen\hsize% + \advance\SB@dimen-\wd\SB@box% + \advance\SB@dimen-2em% + \settoheight\SB@dimenii{\vbox{\SB@multiline}}% + \SB@dimeniii.5\SB@dimen% + \SB@dimeniv\SB@dimeniii% + \loop% + \SB@dimeniv.5\SB@dimeniv% + \settoheight\SB@dimenv{\vbox{% + \SB@dimen\SB@dimeniii% + \SB@multiline% + }}% + \ifdim\SB@dimenv>\SB@dimenii% + \advance\SB@dimeniii\SB@dimeniv% + \else% + \SB@dimen\SB@dimeniii% + \advance\SB@dimeniii-\SB@dimeniv% + \fi% + \ifdim\SB@dimeniv>2\p@\repeat% + \SB@multiline% +} +\newcommand\SB@ellipspread[2]{% + \begingroup% + \setbox\SB@box\hbox{#1}% + \setbox\SB@boxii\hbox{#2}% + \SB@dimen\wd\SB@box% + \advance\SB@dimen2em% + \advance\SB@dimen\wd\SB@boxii% + \ifdim\SB@dimen>\hsize% + \SB@balancerows% + \else% + \hbox to\hsize{% + \unhbox\SB@box% + \leaders\hbox to.5em{\hss.\hss}\hfil% + \unhbox\SB@boxii% + }\par% + \fi% + \endgroup% +} +\newcommand\SB@idxitemsep{% + ,\penalty0\hskip.33em\@minus.11em\hfilneg\vadjust{}\hfil% +} +\newenvironment{idxblock}[1]{}{} +\newcommand\idxentry[2]{} +\newcommand\idxaltentry[2]{} +\newenvironment{SB@lgidx}[1]{}{} +\newenvironment{SB@smidx}[1]{}{} +\newcommand\SB@idxsetup[1]{% + \hsize\textwidth% + \parskip\z@skip\parfillskip\z@skip% + \baselineskip\f@size\p@\@plus\p@\@minus\p@% + \lineskiplimit\z@\lineskip\p@\@plus\p@\@minus\p@% + \ifnum\SB@numcols>\@ne% + \advance\hsize\columnsep% + \advance\hsize-#1\columnsep% + \divide\hsize#1\relax% + \fi% +} +\newcommand\SB@makeidxcolumn[1]{% + \ifdim\ht\SB@box=\z@% + \hskip\hsize\relax% + \else% + \splittopskip\topskip\splitmaxdepth\maxdepth% + \vsplit\SB@box to\SB@dimen% + \global\setbox\SB@box\vbox{% + \SB@idxsetup{#1}% + \splitbotmark% + \unvbox\SB@box% + }% + \fi% +} +\newcommand\SB@oneidxpage{} +\newcommand\SB@displayindex[3]{% + \ifsongindexes\begingroup% + \setbox\SB@idxtitlebox\vbox{% + \let\SB@temp\songsection% + \ifx\chapter\undefined\else% + \ifx\chapter\relax\else% + \let\SB@temp\songchapter% + \fi% + \fi% + \SB@temp{#1}% + }% + \IfFileExists{\csname SB@idxfilename@#2\endcsname.sbx}{% + \ifx\hyperlink\undefined\let\hyperlink\@secondoftwo\fi% + \ifx\hyperlink\relax\let\hyperlink\@secondoftwo\fi% + \global\setbox\SB@box\vbox{% + \null% + \vfil% + \unvcopy\SB@idxtitlebox% + \vskip.5in\@minus.3in\relax% + \hbox to\hsize{% + \hfil% + \vbox{% + \hsize\SB@colwidth% + \renewenvironment{idxblock}[1]% + {\begin{SB@smidx}{####1}}{\end{SB@smidx}}% + \let\\\SB@idxitemsep% + \input{\csname SB@idxfilename@#2\endcsname.sbx}% + }% + \hfil% + }% + \vskip\z@\@plus2fil\relax% + }% + {\vbadness\@M\vfuzz\maxdimen% + \splitmaxdepth\maxdepth\splittopskip\topskip% + \global\setbox\SB@boxii\vsplit\SB@box to\textheight}% + \ifvoid\SB@box% + \box\SB@boxii% + \else% + \global\setbox\SB@box\vbox{% + \renewenvironment{idxblock}[1]% + {\begin{SB@lgidx}{####1}}{\end{SB@lgidx}}% + \let\\\SB@idxitemsep% + \SB@idxsetup{#3}% + \input{\csname SB@idxfilename@#2\endcsname.sbx}% + \unskip% + }% + \SB@toks{\SB@makeidxcolumn{#3}}% + \ifnum\SB@numcols>\@ne% + \SB@cnt#3\relax% + \loop\ifnum\SB@cnt>\@ne% + \SB@toks\expandafter{\the\SB@toks% + \kern\columnsep\SB@makeidxcolumn{#3}}% + \advance\SB@cnt\m@ne% + \repeat% + \fi% + \edef\SB@oneidxpage{\the\SB@toks}% + \unvbox\SB@idxtitlebox% + \vskip.2in\relax% + \nointerlineskip% + \null% + \nointerlineskip% + \SB@cnt\vbadness\vbadness\@M% + \SB@dimenii\vfuzz\vfuzz\maxdimen% + \loop% + \SB@dimen\textheight% + \ifinner\else\kern\z@\advance\SB@dimen-\pagetotal\fi% + \global\setbox\SB@boxii\copy\SB@box% + \global\setbox\SB@boxiii\hbox{\SB@oneidxpage}% + \ifdim\ht\SB@box>\z@% + \box\SB@boxiii% + \vfil\break% + \repeat% + \SB@dimenii\ht\SB@boxii% + \divide\SB@dimenii#3\relax% + \SB@maxmin\SB@dimen>\SB@dimenii% + \loop% + \global\setbox\SB@box\copy\SB@boxii% + \global\setbox\SB@boxiii\hbox{\SB@oneidxpage}% + \ifdim\ht\SB@box>\z@% + \advance\SB@dimen\p@% + \repeat% + \box\SB@boxiii% + \global\setbox\SB@boxii\box\voidb@x% + \vbadness\SB@cnt\vfuzz\SB@dimenii% + \fi% + }{% + \vbox to\textheight{% + \vfil% + \unvbox\SB@idxtitlebox% + \vskip1em\relax% + \hbox to\textwidth{\hfil[Index not yet generated.]\hfil}% + \vskip\z@\@plus2fil\relax% + }% + }% + \cleardoublepage% + \endgroup\fi% +} +\newcommand\showindex[2]{% + \@ifundefined{SB@idxsel@#2}{\SB@errnoidx{#2}}{% + \csname SB@idxsel@#2\endcsname% + \SB@makesongindex\SB@makescripindex\SB@makeauthorindex% + {#1}{#2}% + }% +} +\newcommand\SB@makesongindex[2]{% + \renewenvironment{SB@lgidx}[1]{ + \parindent\z@% + \hbox{\SB@colorbox{\vbox{% + \hbox to\idxheadwidth{\sffamily\bfseries\LARGE##1\hfil}% + }}}% + \nobreak\vskip3\p@\@plus2\p@\@minus2\p@\nointerlineskip% + }{\penalty-50\vskip5\p@\@plus5\p@\@minus4\p@}% + \renewenvironment{SB@smidx}[1]{}{}% + \renewcommand\idxentry[2]{% + \SB@ellipspread{\sffamily\slshape\ignorespaces##1\unskip}{##2}% + }% + \renewcommand\idxaltentry[2]{% + \SB@ellipspread{\rmfamily\ignorespaces##1\unskip}{##2}% + }% + \SB@displayindex{#1}{#2}{2}% +} +\newcommand\SB@idxcolhead{} +\newcommand\idxcont[1]{#1 {\mdseries(continued)}} +\newcommand\SB@idxcont[1]{% + \hbox to\hsize{\small\bfseries\idxcont{#1}\hfil}% + \nobreak% + \ifdim\prevdepth>4\p@\prevdepth4\p@\fi% + \vskip-\prevdepth% + \vskip4\p@\@plus\p@\@minus\p@\nointerlineskip% +} +\newcommand\SB@makescripindex[2]{% + \renewenvironment{SB@lgidx}[1]{% + \gdef\SB@idxcolhead{##1}% + \hbox to\hsize{\small\bfseries##1\hfil}% + \nobreak% + \ifdim\prevdepth>4\p@\prevdepth4\p@\fi% + \vskip-\prevdepth% + \vskip4\p@\@plus\p@\@minus\p@\nointerlineskip% + }{% + \mark{\noexpand\relax}% + \penalty-20\vskip3\p@\@plus3\p@\relax% + }% + \renewenvironment{SB@smidx}[1] + {\begin{SB@lgidx}{##1}}{\end{SB@lgidx}}% + \renewcommand\idxentry[2]{% + \parindent.25cm% + \SB@ellipspread{\sffamily\small\slshape\indent##1}{##2}% + \SB@toks\expandafter{\SB@idxcolhead}% + \mark{\noexpand\SB@idxcont{\the\SB@toks}}% + }% + \renewcommand\idxaltentry[2]{\SB@erridx{a scripture}}% + \SB@displayindex{#1}{#2}{3}% +} +\newcommand\SB@makeauthorindex[2]{% + \renewenvironment{SB@lgidx}[1]{\parindent\z@}{}% + \renewenvironment{SB@smidx}[1]{\parindent\z@}{}% + \renewcommand\idxentry[2]{% + \SB@ellipspread{\small\bfseries\sfcode`.\@m##1}{##2}% + }% + \renewcommand\idxaltentry[2]{\SB@erridx{an author}}% + \SB@displayindex{#1}{#2}{2}% +} +\newcommand\SB@Error{\PackageError{songs}} +\newcommand\SB@Warn{\PackageWarning{songs}} +\newcommand\SB@errpl{% + \SB@Error{\protect\includeonlysongs\space not permitted with% + in a songs environment}{\protect\includeonlysongs\space can o% + nly be used in the document preamble or between songs environ% + ments in the document body.}% +} +\newcommand\SB@warnigen{% + \PackageWarning{songs}{Indexes shown but index-generation inh% + ibited. Index files may be out of date.}{Indexes were initial% + ly turned off by the end of the document preamble, which mean% + s that the auxilliary files used to keep the indexes up-to-da% + te were not generated. However, indexes were turned on withi% + n the document body using \protect\indexeson, which means th% + e indexes shown in the resulting document are being created f% + rom outdated files. To correct the problem, be sure that inde% + xes are turned on by the end of the preamble so that the auxi% + lliary files will be updated.}% +} +\newcommand\SB@errrtopt{% + \SB@Error{Cannot display chords in a rawtext dump}{You have u% + sed the rawtext option in the \protect\usepackage\space lin% + e and have either used the chorded option as well or have use% + d the \protect\chordson\space macro subsequently.}% +} +\newcommand\SB@errcol{% + \SB@Error{Illegal number of columns}{The number of columns mu% + st be at least 1.}% +} +\newcommand\SB@errboo{% + \SB@Error{Encountered \protect\beginsong\space without seein% + g an \protect\endsong\space for the previous song}% + {Song \songnumstyle{songnum} might be missing a% + n \protect\endsong\space line.}% +} +\newcommand\SB@errbor{% + \SB@Error{Encountered \protect\beginsong\space without seein% + g an \protect\endscripture\space for the preceeding scriptur% + e quotation}{A scripture quotation appearing after son% + g \songnumstyle{songnum} might be missing a% + n \protect\endscripture\space line.}% +} +\newcommand\SB@erreov{% + \SB@Error{Encountered \protect\endsong\space without seein% + g an \protect\endverse\space for the preceding verse}{Son% + g \songnumstyle{songnum} has a \protect\beginverse\space% + line with no matching \protect\endverse\space line.}% +} +\newcommand\SB@erreoc{% + \SB@Error{Encountered \protect\endsong\space without seein% + g an \protect\endchorus\space for the preceding chorus}{Son% + g \songnumstyle{songnum} has a \protect\beginchorus\space% + line with no matching \protect\endchorus\space line.}% +} +\newcommand\SB@erreor{% + \SB@Error{Encountered \protect\endsong\space without seein% + g an \protect\endscripture for the preceding scripture quot% + e}{A scripture quote appearing after song \SB@prevsong\space% + ended with \protect\endsong\space instead of wit% + h \protect\endscripture.}% +} +\newcommand\SB@erreot{% + \SB@Error{Encountered \protect\endsong\space with no matchin% + g \protect\beginsong}{After song \SB@prevsong\space there wa% + s an \protect\endsong\space with no matchin% + g \protect\beginsong.}% +} +\newcommand\SB@errbvv{% + \SB@Error{Encountered \protect\beginverse\space without seein% + g an \protect\endverse\space for the preceding verse}{Son% + g \songnumstyle{songnum} might have a verse that has n% + o \protect\endendverse\space line.}% +} +\newcommand\SB@errbvc{% + \SB@Error{Encountered \protect\beginverse\space without seein% + g an \protect\endchorus\space for the preceding chorus}{Son% + g \songnumstyle{songnum} might have a chorus that has n% + o \protect\endchorus\space line.}% +} +\newcommand\SB@errbvt{% + \SB@Error{Encountered \protect\beginverse\space without firs% + t seeing a \protect\beginsong\space line}{After son% + g \SB@prevsong, there is a \protect\beginverse\space line no% + t contained in any song.}% +} +\newcommand\SB@errevc{% + \SB@Error{Encountered \protect\endverse\space while process% + ing a chorus}{Song \songnumstyle{songnum} might hav% + e a \protect\beginchorus\space concluded by a% + n \protect\endverse\space instead of an \protect\endchorus.}% +} +\newcommand\SB@errevo{% + \SB@Error{Encountered \protect\endverse\space without firs% + t seeing a \protect\beginverse}{Song \songnumstyle{songnum} m% + ight have an \protect\endverse\space with no matchin% + g \protect\beginverse.}% +} +\newcommand\SB@errevt{% + \SB@Error{Encountered an \protect\endverse\space outside o% + f any song}{After song \SB@prevsong, there is a% + n \protect\endverse\space line not preceded b% + y a \protect\beginsong\space line.}% +} +\newcommand\SB@erretex{% + \SB@Error{The \protect\repchoruses\space feature requires e-% + TeX compatibility}{Your version of LaTeX2e does not appear t% + o be e-TeX compatible. Find a distribution that includes e-T% + eX support in order to use this feature.}% +} +\newcommand\SB@errbcv{% + \SB@Error{Encountered \protect\beginchorus\space without see% + ing an \protect\endverse\space for the preceding verse}{Son% + g \songnumstyle{songnum} might hav% + e a \protect\beginverse\space with no match% + ing \protect\endverse.}% +} +\newcommand\SB@errbcc{% + \SB@Error{Encountered \protect\beginchorus\space without see% + ing an \protect\endchorus\space for the preceding chorus}% + {Song \songnumstyle{songnum} might have a \protect\beginchorus% + \space with no matching \protect\endchorus.}% +} +\newcommand\SB@errbct{% + \SB@Error{Encountered \protect\beginchorus\space without see% + ing a \protect\beginsong\space line first}{After son% + g \songnumstyle{songnum} there is a \protect\beginchorus\space% + line outside of any song.}% +} +\newcommand\SB@errecv{% + \SB@Error{Encountered an \protect\endchorus\space while proc% + essing a verse}{Song \songnumstyle{songnum} might hav% + e a \protect\beginverse\space concluded by \protect\endchorus% + \space instead of \protect\endverse.}% +} +\newcommand\SB@erreco{% + \SB@Error{Encountered \protect\endchorus\space without firs% + t seeing a \protect\beginchorus}{Song \songnumstyle{songnum} m% + ight have an \protect\endchorus\space with no match% + ing \protect\beginchorus.}% +} +\newcommand\SB@errect{% + \SB@Error{Encountered an \protect\endchorus\space outside o% + f any song}{After song \SB@prevsong, there is a% + n \protect\endchorus\space line not preceded b% + y a \protect\beginsong\space line.}% +} +\newcommand\SB@errbro{% + \SB@Error{Encountered a \protect\beginscripture\space insid% + e a song}{Song \songnumstyle{songnum} might be missing a% + n \protect\endsong\space line.}% +} +\newcommand\SB@errbrr{% + \SB@Error{Encountered a \protect\beginscripture\space with% + out seeing an \protect\endscripture\space for the precedin% + g scripture quote}{A scripture quote after song \SB@prevsong% + \space is missing an \protect\endscripture\space line.}% +} +\newcommand\SB@errero{% + \SB@Error{Encountered an \protect\endscripture\space whil% + e processing a song}{Song \songnumstyle{songnum} ends wit% + h \protect\endscripture\space when it should end wit% + h \protect\endsong.}% +} +\newcommand\SB@errert{% + \SB@Error{Encountered an \protect\endscripture\space with% + out first seeing a \protect\beginscripture}{After son% + g \SB@prevsong, there is an \protect\endscripture\space w% + ith no matching \protect\beginscripture.}% +} +\newcommand\SB@errscrip[1]{% + \SB@Error{Encountered a \protect#1\space outside a scriptu% + re quote}{\protect#1\space can only appear betwee% + n \protect\beginscripture\space an% + d \protect\endscripture\space lines.}% +} +\newcommand\SB@errchord{% + \SB@Error{Song \songnumstyle{songnum} seems to have chord% + s that appear outside of any verse or chorus}{All chords a% + nd lyrics should appear between \protect\beginverse\space% + and \protect\endverse, or between \protect\beginchorus\space% + and \protect\endchorus.}% +} +\newcommand\SB@errreplay{% + \SB@Error{Replayed chord has no matching chord}{Son% + g \songnumstyle{songnum} uses \protect^ more times than the% + re are chords in the previously memorized verse.}% +} +\newcommand\SB@errreg[1]{% + \SB@Error{Unknown chord-replay register name: #1}{Chord-re% + play registers must be declared with \protect\newchords.}% +} +\newcommand\SB@errdup[1]{% + \SB@Error{Duplicate definition of chord-replay register% + : #1}{\protect\newchords\space was used to declare the sa% + me chord-replay register twice.}% +} +\newcommand\SB@errmbar{% + \SB@Error{Song \songnumstyle{songnum} seems to have measur% + e bars that appear outside of any verse or chorus}{All mea% + sure bars (produced with \protect\mbar\space or |) must ap% + pear between \protect\beginverse\space an% + d \protect\endverse, or between \protect\beginchorus\space% + and \protect\endchorus.}% +} +\newcommand\SB@errtab{% + \SB@Error{Invalid argument to \protect\gtab\space macro. R% + eplacing it with \protect\0.}{Valid arguments consist onl% + y of: X, O, 0, 1, 2, 3, or 4.}% +} +\newcommand\SB@errtabx{% + \SB@Error{Argument to \protect\gtab\space has extra tokens% + . Ignoring them.}{The strings and fingering portions of t% + he second argument should consist of exactly six symbols e% + ach.}% +} +\newcommand\SB@errnoidx[1]{% + \SB@Error{Unknown index identifier: #1}{This index identifie% + r was never declared using \protect\newindex.}% +} +\newcommand\SB@erridx[1]{% + \SB@Error{\protect\idxaltentry\space not allowed in #1 index}% + {This error should not occur. The index generation routines ha% + ve malfunctioned. Try deleting all temporary files and then re% + compiling.}% +} +\newif\ifchorded +\newif\iflyric\lyrictrue +\newif\ifslides +\newif\ifmeasures +\newif\ifpartiallist +\newif\ifrepchorus +\newif\iftranscapos +\newif\ifrawtext +\newif\ifpdfindex\pdfindextrue +\newif\ifsongindexes\songindexestrue +\newif\ifSB@colorboxes\SB@colorboxestrue +\newif\ifSB@genindexes\SB@genindexestrue +\newif\ifSB@omitscrip +\SB@chordson +\ProcessOptions\relax +\ifSB@pdf\else\pdfindexfalse\fi +\ifSB@colorboxes + \RequirePackage{color} + \definecolor{SongbookShade}{gray}{.80} + \newcommand\SB@colorbox[1]{\colorbox{SongbookShade}{#1}} +\else + \newcommand\SB@colorbox[1]{\vbox{% + \kern3\p@% + \hbox{\kern3\p@{#1}\kern3\p@}% + \kern3\p@% + }} +\fi +\ifrawtext + \newwrite\SB@txtout + \immediate\openout\SB@txtout=\jobname.txt + \newif\ifSB@doEOL + {\catcode`\^^M12 % + \catcode`\^^J12 % + \gdef\SB@printEOL{\ifSB@doEOL^^M^^J\fi}} + {\catcode`#12\gdef\SB@hash{#}} + {\catcode`&12\gdef\SB@amp{&}} + \def\SB@@@beginsong{% + \begingroup% + \def\'{}\def\`{}\def\v{}\def\u{}\def\={}\def\^{}% + \def\.{}\def\H{}\def\~{}\def\"{}\def\t{}% + \def\copyright{(c)}% + \let~\space% + \let\par\SB@printEOL% + \let\#\SB@hash% + \let\&\SB@amp% + \catcode`|9 % + \catcode`*9 % + \catcode`^9 % + \def\[##1]{}% + \resettitles% + \immediate\write\SB@txtout{\songnumstyle{songnum}. \songtitle}% + \nexttitle% + \foreachtitle{\immediate\write\SB@txtout{(\songtitle)}}% + \ifx\songauthors\@empty\else% + \immediate\write\SB@txtout{\songauthors}% + \fi% + \ifx\SB@rawrefs\@empty\else% + \immediate\write\SB@txtout{\SB@rawrefs}% + \fi% + \immediate\write\SB@txtout{}% + \SB@doEOLfalse% + \obeylines% + } + \def\endsong{% + \SB@doEOLtrue% + \immediate\write\SB@txtout{\songcopyright\space% + \songlicense\SB@printEOL}% + \endgroup% + \SB@insongfalse% + \stepcounter{songnum}% + } + \def\SB@parsesrefs#1{#1} + \long\def\beginverse#1#2\endverse{% + \SB@doEOLtrue\begingroup% + \def\textnote##1{##1}% + \def\SB@temp{#1}% + \def\SB@star{*}% + \ifx\SB@temp\SB@star% + \immediate\write\SB@txtout{\@gobble#2}% + \else% + \immediate\write\SB@txtout{#2}% + \fi% + \endgroup\SB@doEOLfalse} + \long\def\beginchorus#1\endchorus{% + \SB@doEOLtrue\begingroup% + \def\textnote##1{##1}% + \immediate\write\SB@txtout{Chorus:#1}% + \endgroup\SB@doEOLfalse} + \long\def\beginscripture#1\endscripture{} + \def\musicnote#1{} + \def\textnote#1{% + \SB@doEOLtrue% + \immediate\write\SB@txtout{#1\SB@printEOL}% + \SB@doEOLfalse} + \renewcommand\brk{} + \def\rep#1{(x#1)} + \def\echo#1{(#1)} + \def\mbar#1#2{} +\fi +\endinput +%% +%% End of file `songs.sty'.