summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/songbook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-10-19 00:24:47 +0000
committerKarl Berry <karl@freefriends.org>2006-10-19 00:24:47 +0000
commit4888ceffcebbbff65e9dfd805b5c062a4990ce18 (patch)
tree5b90a4164fbff80e4c4b7e722975a0dbd7d99650 /Master/texmf-dist/source/latex/songbook
parentff920c7e23a7b1736eef9cb4ad2304a859cd0db8 (diff)
songbook 4.2 update (17oct06)
git-svn-id: svn://tug.org/texlive/trunk@2351 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/songbook')
-rw-r--r--Master/texmf-dist/source/latex/songbook/songbook.dtx154
-rw-r--r--Master/texmf-dist/source/latex/songbook/songbook.ins13
2 files changed, 124 insertions, 43 deletions
diff --git a/Master/texmf-dist/source/latex/songbook/songbook.dtx b/Master/texmf-dist/source/latex/songbook/songbook.dtx
index d21e7b3573a..b34404fc6a4 100644
--- a/Master/texmf-dist/source/latex/songbook/songbook.dtx
+++ b/Master/texmf-dist/source/latex/songbook/songbook.dtx
@@ -1,18 +1,17 @@
% \iffalse meta-comment % -*- LaTeX -*-
-% rcsid = @(#)$Id: songbook.dtx,v 1.11 2003/09/23 01:18:57 christopher Exp $
+% rcsid = @(#)$Id: songbook.dtx,v 1.12 2006/10/15 15:49:50 rathc Exp $
%
%
% songbook.sty - Generic SongBook style.
%
-% Version 4.1a, 31 August, 2003
+% Version 4.2, 13 October, 2006
%
-% Copyright 1992--2003 Christopher Rath <christopher@rath.ca>
+% Copyright 1992--2006 Christopher Rath <christopher@rath.ca>
%
% This package is free software; you can redistribute it and/or
-% modify it under the terms of the GNU Lesser General Public
-% License as published by the Free Software Foundation; either
-% version 2.1 of the License, or (at your option) any later
-% version.
+% modify it under the terms of version 2.1 of the GNU Lesser
+% General Public License as published by the Free Software
+% Foundation.
%
% This package is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied
@@ -22,7 +21,7 @@
%
% \fi
%
-% \CheckSum{2112}
+% \CheckSum{2178}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -48,10 +47,11 @@
%
% 4.0 and earlier... are not documented in this file.
% \changes{v4.1}{2003/08/31}{Added an optional parameter to the \textsf{song}
-% environment along with a corresponding usepackage option.}
+% environment along with a corresponding usepackage option.}
% \changes{v4.1a}{2003/09/22}{Corrected a bug whereby the new exclude song mode
-% was throwing an error when the \textsf{SBRef} and
-% \textsf{SBMargNote} commands were used.}
+% was throwing an error when the \textsf{SBRef} and
+% \textsf{SBMargNote} commands were used.}
+% \changes{v4.2}{2006/10/13}{Added abilty to create an index by song artist.}
%\fi
%
% \hyphenation{make-index}
@@ -120,10 +120,10 @@
% \GetFileInfo{songbook.dtx}
%
% \title{The \Songbook{} Package\\
-% {\large Version 4.1a}}
+% {\large Version 4.2}}
% \author{Christopher Rath\\
% {\small$<$\texttt{Christopher@Rath.ca}$>$}}
-% \date{2003/08/31}
+% \date{2006/10/10}
% \maketitle
%
% \begin{abstract}
@@ -142,6 +142,12 @@
% \tableofcontents
% }
%
+% \section*{Preface to version 4.2}
+% What's new in version~4.2:
+% \begin{itemize}
+% \item added a new Artist index option
+% \end{itemize}
+%
% \section*{Preface to version 4.1a}
% What's new in version~4.1a:
% \begin{itemize}
@@ -590,21 +596,26 @@
% \item |\CSColBrk| \DescribeMacro{\CSColBrk} generates a column break
% here if we're in |compactsong| mode.
%
-% \item |\makeKeyIndex| \DescribeMacro{\makeKeyIndex} start creation of
+% \item |\makeArtistIndex| \DescribeMacro{\makeArtistIndex} starts creation
+% of an index of songs by artist (composer). If you need to add your
+% own information to this index use the |\artistIndex[][]| command,
+% documented in the \textit{Detailed Documentation} section, below.
+%
+% \item |\makeKeyIndex| \DescribeMacro{\makeKeyIndex} starts creation of
% an index of songs by key. If you need to add your own information
% to this index use the |\keyIndex[][]| command, documented in the
% \textit{Detailed Documentation} section, below.
%
-% \item |\makeTitleContents| \DescribeMacro{\makeTitleContents} start
+% \item |\makeTitleContents| \DescribeMacro{\makeTitleContents} starts
% creation of a table of contents. If you need to add your own
% information to this index use the |\titleContents[][]| command,
% documented in the \textit{Detailed Documentation} section, below.
%
-% \item |\makeTitleContentsSkip| \DescribeMacro{\makeTitleContentsSkip} start
+% \item |\makeTitleContentsSkip| \DescribeMacro{\makeTitleContentsSkip} starts
% creation of a table of contents of songs exluded from the current
% songbook. This macro operates in the same manner as |\makeTitleContents|.
%
-% \item |\makeTitleIndex| \DescribeMacro{\makeTitleIndex} start
+% \item |\makeTitleIndex| \DescribeMacro{\makeTitleIndex} starts
% creation of a title and first line index. If you need to add your
% own information to this index use the |\titleIndex[][]| command,
% documented in the \textit{Detailed Documentation} section, below.
@@ -1244,6 +1255,17 @@
% \item Run \LaTeX2e{} on your copy of \texttt{sampleKdx.tex}.
% \end{enumerate}
%
+% \subsection{Song Artist Index Generation}
+% To produce an index by song artist (composer) follow the same steps as
+% for song key index generation, above, with the following exceptions:
+% \begin{itemize}
+%
+% \item use |\makeArtistIndex| instead of |\makeKeyIndex|.
+%
+% \item use \texttt{./mksbadx} instead of \texttt{./mksbkdx}.
+%
+% \item use \texttt{sampleAdx.tex} instead of \texttt{sampleKdx.tex}.
+% \end{itemize}
%
% \section{Example}
% Here is an example songbook; where the the songbook contains exactly
@@ -1267,6 +1289,7 @@
% \makeTitleIndex %% Title and First Line Index.
% \makeTitleContents %% Table of Contents.
% \makeKeyIndex %% Song Key Index.
+% \makeArtistIndex %% Index by Artist.
%
% \begin{document}
% %%
@@ -1274,7 +1297,7 @@
% %%
% \begin{song}{What A Mighty God We Serve}{C}
% {\SBPubDom}
-% {Unknown}
+% {\SBUnknownTag}
% {Isaiah 9:6}
% {\NotCCLIed}
%
@@ -1361,9 +1384,9 @@
%
% \section{Dependencies}
% The \Songbook{} style is dependent upon four other \LaTeX2e{} styles:
-% \texttt{conditional.sty}, \texttt{calc.sty}, \texttt{ifthen.sty}, and
+% \texttt{conditionals.sty}, \texttt{calc.sty}, \texttt{ifthen.sty}, and
% \texttt{multicol.sty}.
-% \texttt{Conditional.sty} is supplied with this package.
+% \texttt{Conditionals.sty} is supplied with this package.
% \texttt{Calc.sty}, \texttt{ifthen.sty}, and \texttt{multicol.sty} are
% part of the \LaTeX2e{} distribution.
%
@@ -1374,13 +1397,17 @@
%
% \section{Files}
% \begin{description}
-% \item[conditionals.sty] Donald Arseneau's conditional tests.
+% \item[conditionals.sty] Donald Arseneau's conditional tests; included
+% with Donald's kind permission.
+% \item[mksbadx] A shell script around makeindex to sort the song
+% artist index.
% \item[mksbkdx] A shell script around makeindex to sort the song
% key index.
% \item[mksbtdx] A shell script around makeindex to sort the
% title \& first line index.
% \item[relnotes.txt] The \Songbook{} package release notes.
% \item[sample-sb.tex] A sample songbook.
+% \item[sampleAdx.tex] Song artist index for the sample songbook.
% \item[sampleKdx.tex] Song key index for the sample songbook.
% \item[sampleTdx.tex] Title \& first line index for the sample
% songbook.
@@ -1553,7 +1580,7 @@
\documentclass{ltxdoc} \RequirePackage{calc} \EnableCrossrefs
\CodelineIndex
\RecordChanges % Gather update information
- %\OnlyDescription % comment out for implementation details
+ %\OnlyDescription % comment out for implementation details
%\OldMakeindex % use if your MakeIndex is pre-v2.9
\setlength\hfuzz{15pt} % dont make so many
\hbadness=7000 % over and under full box warnings
@@ -1620,11 +1647,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
-%% rcsid = @(#)$Id: songbook.dtx,v 1.11 2003/09/23 01:18:57 christopher Exp $
+%% rcsid = @(#)$Id: songbook.dtx,v 1.12 2006/10/15 15:49:50 rathc Exp $
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{songbook}[2003/08/31 v4.1a All purpose Songbook style]
-\typeout{Document Subclass: songbook 2003/08/31 v4.1a All purpose Songbook style}
+\ProvidesPackage{songbook}[2006/10/13 v4.2 All purpose Songbook style]
+\typeout{Document Subclass: songbook 2006/10/13 v4.2 All purpose Songbook style}
% \end{macrocode}
%
% \section{Initial Code Part}
@@ -1796,8 +1823,8 @@
%
% \begin{macrocode}
\newif\ifCompactSongMode\CompactSongModefalse
-\newif\ifExcludeSong \ExcludeSongfalse
-\newif\ifPrintAllSongs \PrintAllSongsfalse
+\newif\ifExcludeSong \ExcludeSongfalse
+\newif\ifPrintAllSongs \PrintAllSongsfalse
\newif\ifSamepageMode \SamepageModefalse
\newif\ifSongEject \SongEjecttrue
% \end{macrocode}
@@ -3303,6 +3330,13 @@
% \begin{macro}{\theSongComposer}
% |\theSongComposer| is the composer and lyricist of the last song.
%
+% \changes{v4.2}{2006/10/13}{Added new |theSongComposerU| variable.}
+% \begin{macro}{\theSongComposerU}
+% |\theSongComposerU| takes the value of |\theSongComposer| except
+% when the song composer parameter was left empty in the songbook;
+% in which case this variable will be assigned the value of
+% |\SBUnknownTag|.
+%
% \begin{macro}{\theSongKey}
% |\theSongKey| is the key of the last song. This variable must be
% reset within the |\STitle| command, as well as at the
@@ -3337,6 +3371,7 @@
%
% \begin{macrocode}
\newcommand{\theSongComposer}{the Composer}
+\newcommand{\theSongComposerU}{the ComposerU}
\newcommand{\theSongCopyRt}{the Copyright}
\newcommand{\theSongKey}{the Key}
\newcommand{\theSongLicense}{the License}
@@ -3356,6 +3391,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsubsection{Special Characters}
% Some macros to ease the entry of special characters in songbooks.
@@ -3488,6 +3524,45 @@
%%=======================================================%
% \end{macrocode}
%
+% \changes{v4.2}{2006/10/13}{Added |makeArtistIndex| and necessary children.}
+% \begin{macro}{\makeArtistIndex}
+% |\makeArtistIndex| starts the creation of an index of artists.
+% \begin{ParameterList}
+% \item None.
+% \end{ParameterList}
+%
+% \begin{macrocode}
+\def\makeArtistIndex{\if@filesw \newwrite\@artistIndexfile
+ \immediate\openout\@artistIndexfile=\jobname.aIdx
+ \def\artistIndex{\@bsphack\begingroup
+ \def\protect####1{\string####1\space}\@sanitize
+ \@wrArtistIndex}\typeout
+ {Writing index file \jobname.aIdx }\fi}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\artistIndex}
+% |\artistIndex|\parm{1}\parm{2} makes an entry in the index of songs
+% by artist.
+% \begin{ParameterList}
+% \item[\meta{1}] Song artist.
+% \item[\meta{2}] Song title and number.
+% \end{ParameterList}
+%
+% \begin{macrocode}
+\def\@wrArtistIndex#1#2{\let\thepage\relax
+ \xdef\@gtempa{\write\@artistIndexfile{\string
+ \indexentry{#1}{#2}}}\endgroup\@gtempa
+ \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
+
+\def\artistIndex{\@bsphack\begingroup \@sanitize\@artistIndex}
+
+\def\@artistIndex#1#2{\endgroup\@esphack}
+
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\makeKeyIndex}
% |\makeKeyIndex| starts the creation of an index of songs
% by key.
@@ -3963,7 +4038,7 @@
% \begin{macrocode}
\newenvironment{song}[7][Y]{ % Comment markers to negate
\if#1Y\ExcludeSongfalse\else\ExcludeSongtrue\fi% the newline.
- \ifPrintAllSongs\ExcludeSongfalse\fi %
+ \ifPrintAllSongs\ExcludeSongfalse\fi %
\SongMarkboth{\relax}{\relax} %
\SBinSongEnvtrue %
\renewcommand{\SBinSongEnv}{\True} %
@@ -3984,6 +4059,11 @@
%
% \begin{macrocode}
\renewcommand{\theSongComposer}{#5} %
+ \if\blank{#5} %
+ \renewcommand{\theSongComposerU}{\SBUnknownTag}%
+ \else %
+ \renewcommand{\theSongComposerU}{#5} %
+ \fi %
\renewcommand{\theSongCopyRt}{#4} %
\renewcommand{\theSongKey}{#3} %
\renewcommand{\theSongLicense}{#7} %
@@ -3998,22 +4078,24 @@
% \end{macrocode}
%
% \changes{v4.1}{2003/08/31}{Changes index invocation to match
-% \meta{Include?} directive.}
+% \meta{Include?} directive.}
+% \changes{v4.2}{2006/10/13}{Added invocation for artist index.}
%
% Write table of contents and index entries in reponse to the user's
% \meta{Include?} directive.
%
% \begin{macrocode}
- \ifExcludeSong %
+ \ifExcludeSong %
\titleContentsSkip{\theSongTitle}{\theSongKey}%
- \else %
+ \else %
\titleIndex{\theSongTitle}{\theSBSongCnt} %
\titleContents{\theSongTitle}{\theSongKey} %
- \fi %
+ \artistIndex{\theSongComposerU+\theSongTitle}{\theSBSongCnt}%
+ \fi %
% \end{macrocode}
%
% \changes{v4.1}{2003/08/31}{Implemented \meta{Include?} parameter through use
-% of \TeX's |box2|.}
+% of \TeX's |box2|.}
%
% Now we deal with the user's \meta{Include?} directive. If \meta{Include?} is
% ``\texttt{Y}'' then we will cause normal songbook processing to occur;
@@ -4119,7 +4201,7 @@
% \item[|OHExcl|\ ] Exclude the song when in |overhead| mode
% \item[|WBExcl|\ ] Exclude the song when in |wordbk| mode
% \item[|WOExcl|\ ] Exclude the song when in either |wordbk| or
-% |overhead| mode
+% |overhead| mode
% \end{description}
%
% Here's an example usage which shows a song to be excluded when in
@@ -4405,7 +4487,7 @@
% the error that will occur from attempting to use the |\marginpar| command
% within a |\vbox{}|.
% \changes{v4.1a}{2003/09/22}{Added an \textsf{ifExcludeSong} clause to avoid the
-% conflict with \textsf{marginpar}}
+% conflict with \textsf{marginpar}}
%
% \begin{macrocode}
\newcommand{\SBMargNote}[1]{%
@@ -4442,7 +4524,7 @@
% error that will occur from attempting to use the |\marginpar| command
% within a |\vbox{}|.
% \changes{v4.1a}{2003/09/22}{Added an \textsf{ifExcludeSong} clause to avoid the
-% conflict with \textsf{marginpar}}
+% conflict with \textsf{marginpar}}
%
% \begin{macrocode}
\newcommand{\SBRef}[2]{%
diff --git a/Master/texmf-dist/source/latex/songbook/songbook.ins b/Master/texmf-dist/source/latex/songbook/songbook.ins
index 3663a991f58..7532ebcfe0f 100644
--- a/Master/texmf-dist/source/latex/songbook/songbook.ins
+++ b/Master/texmf-dist/source/latex/songbook/songbook.ins
@@ -1,16 +1,15 @@
-%% rcsid = @(#)$Id: songbook.ins,v 1.4 2003/08/19 23:30:37 christopher Exp $
+%% rcsid = @(#)$Id: songbook.ins,v 1.5 2006/10/15 15:49:50 rathc Exp $
%%
%% songbook.ins - Docstrip batch file for Songbook Style
%%
-%% Version 4.1, 31 August, 2003
+%% Version 4.2, 13 October, 2006
%%
-%% Copyright 2002--2003 Christopher Rath <christopher@rath.ca>
+%% Copyright 1992--2006 Christopher Rath <christopher@rath.ca>
%%
%% This package is free software; you can redistribute it and/or
-%% modify it under the terms of the GNU Lesser General Public
-%% License as published by the Free Software Foundation; either
-%% version 2.1 of the License, or (at your option) any later
-%% version.
+%% modify it under the terms of version 2.1 of the GNU Lesser
+%% General Public License as published by the Free Software
+%% Foundation.
%%
%% This package is distributed in the hope that it will be
%% useful, but WITHOUT ANY WARRANTY; without even the implied