diff options
author | Karl Berry <karl@freefriends.org> | 2010-05-07 00:53:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-05-07 00:53:10 +0000 |
commit | 97b6c91cd1221dec79f63d88439d9902cb875b6e (patch) | |
tree | ed0cc989819867e30a97a9271e66f3a078520ae5 /Master/texmf-dist/source/latex/songbook | |
parent | 6cc30c797670923267fcfc3cecb62cae4bb5b9c1 (diff) |
songbook 4.5 (6may10)
git-svn-id: svn://tug.org/texlive/trunk@18136 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/songbook')
-rw-r--r-- | Master/texmf-dist/source/latex/songbook/songbook.dtx | 455 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/songbook/songbook.ins | 4 |
2 files changed, 339 insertions, 120 deletions
diff --git a/Master/texmf-dist/source/latex/songbook/songbook.dtx b/Master/texmf-dist/source/latex/songbook/songbook.dtx index 873ce65b556..6ed42cbf150 100644 --- a/Master/texmf-dist/source/latex/songbook/songbook.dtx +++ b/Master/texmf-dist/source/latex/songbook/songbook.dtx @@ -1,10 +1,10 @@ % \iffalse meta-comment % -*- LaTeX -*- -% rcsid = @(#)$Id: songbook.dtx,v 1.14 2010-03-31 02:06:52 rathc Exp $ +% rcsid = @(#)$Id: songbook.dtx,v 1.16 2010-04-12 18:10:15 rathc Exp $ % % % songbook.sty - Generic SongBook style. % -% Version 4.4, 30 March, 2010 +% Version 4.5, 30 April, 2010 % % Copyright 1992--2010 Christopher Rath <christopher@rath.ca> % @@ -21,7 +21,7 @@ % % \fi % -% \CheckSum{2190} +% \CheckSum{2341} %% \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 @@ -55,7 +55,9 @@ % \changes{v4.3}{2007/02/03}{Corrected problem with xlatn environment introduced in v4.2 % and added a new songTranslation environment.} % \changes{v4.4}{2010/03/30}{At Donald Arseneau's request, added language to state that -% conditionals.sty is public domain.} +% conditionals.sty is public domain.} +% \changes{v4.5}{2010/04/30}{Added a |compactsong| option to the |song| environment; +% which allows per-song use of |compactsong| formatting.} %\fi % % \hyphenation{make-index} @@ -124,10 +126,10 @@ % \GetFileInfo{songbook.dtx} % % \title{The \Songbook{} Package\\ -% {\large Version 4.4}} +% {\large Version 4.5}} % \author{Christopher Rath\\ % {\small$<$\texttt{Christopher@Rath.ca}$>$}} -% \date{2010/03/30} +% \date{2010/04/30} % \maketitle % % \begin{abstract} @@ -146,6 +148,13 @@ % \tableofcontents % } % +% \section*{Preface to version 4.5} +% What's new in version~4.5: +% \begin{itemize} +% \item Added a |compactsong| option to the |song| environment; which +% allows per-song use of |compactsong| formatting. +% \end{itemize} +% % \section*{Preface to version 4.4} % What's new in version~4.4: % \begin{itemize} @@ -507,13 +516,14 @@ % environment indents but down not place an |\SBVerseCnt| before the % chorus; similar to \LaTeX's |\section*| command, the verse counter % is not incremented either. -% +% +% \changes{v4.5}{2010/04/30}{Added |compactsong| documentation.} % \item |\begin{song}[|\meta{1}|]{|\meta{2}|}|\ \ldots|{|\meta{7}|}|\ \meta{\ldots % the song\ldots}|\end{song}| \DescribeEnv{song} is the % environment which each song resides within. The parameter list is % quite long, and is defined as: % \begin{enumerate} -% \item Include this song? (optional); +% \item Optional format string (Include song? / Compact song mode?); % \item Song title; % \item Key song is written in; % \item Copyright information; @@ -527,13 +537,24 @@ % \textit{Example\/} section, below, for a sample one-song songbook % document. % -% The ``Include this song?'' parameter is optional; the parameter is referred -% to within this documentation as ``\meta{Include?}''. If you don't specify -% it (and you typically do not), then it behaves as though you provided -% a value of ``\texttt{Y}''. If you specify any other value then the -% song is excluded from the current songbook; however, a table of -% contents record is written to a separate file -% (\textit{jobname}|.tocS|). +% The optional format string parameter allows per-song control of certain +% typesetting attributes. Each of the attributes is optional, and a single +% attribute, or multiple attributes, may be used. The available values +% are: +% \begin{description} +% \item[|Y| or |N|] These two characters tell \Songbook{} whether to +% include the song in the songbook. This ``Include this song?'' option +% is referred to within this documentation as ``\meta{Include?}''. If +% you don't specify a value (and you typically will not), then it behaves +% as though you provided a value of ``\texttt{Y}''. When a value of +% ``\texttt{N}'' then the song is excluded from the current songbook; +% however, a table of contents record is written to a separate file +% (\textit{jobname}|.tocS|). +% +% \item[|C| or |F|] These two characters tell \Songbook{} whether the +% song should be presented in |compactsong| mode or full size presention +% mode (|chordbk| formatting only). +% \end{description} % % \DescribeMacro{\CBExcl}\DescribeMacro{\OHExcl}\DescribeMacro{\WBExcl} % \DescribeMacro{\WOExcl}Some predefined macros have been provided @@ -1431,14 +1452,15 @@ % \bye % \end{verbatim}} % -% +% \changes{v4.5}{2010/04/30}{Added new dependency: \texttt{xstring.sty}.} % \section{Dependencies} % The \Songbook{} style is dependent upon four other \LaTeX2e{} styles: -% \texttt{conditionals.sty}, \texttt{calc.sty}, \texttt{ifthen.sty}, and -% \texttt{multicol.sty}. +% \texttt{conditionals.sty}, \texttt{calc.sty}, \texttt{ifthen.sty}, +% \texttt{multicol.sty}, and \texttt{xstring.sty}. % \texttt{Conditionals.sty} is supplied with this package. % \texttt{Calc.sty}, \texttt{ifthen.sty}, and \texttt{multicol.sty} are -% part of the \LaTeX2e{} distribution. +% part of the \LaTeX2e{} distribution. \texttt{xstring.sty} is available +% from CTAN. % % Embedding guitar chord fingering charts within a songbook can be % accomplished with the \texttt{texchord.sty} package; which is supplied @@ -1603,6 +1625,10 @@ % \meta{Include?} option (although I did not use his preferred % method). % +% I am grateful to Adam Fletcher for prodding me to add the per-song +% |compactsong| implementation; which took many years more than it +% should have taken for me to get it coded. +% % \section{Author} % Christopher Rath % \hskip 1cm \texttt{christopher@rath.ca} @@ -1631,7 +1657,7 @@ \CodelineIndex \RecordChanges % Gather update information %\OnlyDescription % comment out for implementation details - %\OldMakeindex % use if your MakeIndex is pre-v2.9 + %\OldMakeindex % use if your MakeIndex is pre-v2.9 \setlength\hfuzz{15pt} % dont make so many \hbadness=7000 % over and under full box warnings \def\MacroFont{\fontencoding\encodingdefault @@ -1697,11 +1723,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% -%% rcsid = @(#)$Id: songbook.dtx,v 1.14 2010-03-31 02:06:52 rathc Exp $ +%% rcsid = @(#)$Id: songbook.dtx,v 1.16 2010-04-12 18:10:15 rathc Exp $ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{songbook}[2010/03/30 v4.4 All purpose Songbook style] -\typeout{Document Subclass: songbook 2010/03/30 v4.4 All purpose Songbook style} +\ProvidesPackage{songbook}[2010/04/30 v4.5 All purpose Songbook style] +\typeout{Document Subclass: songbook 2010/04/30 v4.5 All purpose Songbook style} % \end{macrocode} % % \section{Initial Code Part} @@ -1871,7 +1897,9 @@ % is true). Set this true or false using the |\SongEjecttrue| and % |\SongEjectfalse| commands, respectively. % +% \changes{v4.5}{2010/04/30}{Added new |CompanAllMode| boolean.} % \begin{macrocode} +\newif\ifCompactAllMode \CompactAllModefalse \newif\ifCompactSongMode\CompactSongModefalse \newif\ifExcludeSong \ExcludeSongfalse \newif\ifPrintAllSongs \PrintAllSongsfalse @@ -2165,6 +2193,64 @@ % \end{macrocode} % \end{macro} % +% \changes{v4.5}{2010/04/30}{Added |compactsong| fonts.} +% \subsubsection{Compact Song Fonts} +% Downsized fonts to allow song to fit into half the space (i.e., +% two column mode) for |compactsong| printing; although the title +% will not be reset since it will be presented unchanged from normal +% chordbk mode. +% +% \begin{macro}{\ChBassFontCS} +% \begin{macro}{\ChFontCS} +% \begin{macro}{\ChBkFontCS} +% \begin{macro}{\SBDefaultFontCS} +% \begin{macro}{\SBOccursBrktFontCS} +% +% \begin{macrocode} +\newcommand{\ChBassFontCS}{\small\bf\sf} % = cmss12 at 11.0pt +\newcommand{\ChFontCS}{\normalsize\fontfamily{\sfdefault}% + \fontseries{sbc}\fontshape{n}\selectfont} % = cmssbc12 at 12.0pt +\newcommand{\ChBkFontCS}{\ChFont\fontseries{m} % + \selectfont} % = cmssm12 at 12.0pt +\newcommand{\SBDefaultFontCS}{\normalsize} % = cmr12 at 12.0pt +\newcommand{\SBOccursBrktFontCS}{\large\bf\sf} % = cmss10 at 10.9pt + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v4.5}{2010/04/30}{Added variables to save fonts for |compactsong| mode.} +% \subsubsection{Fonts Saving Variables} +% Variables in which to save the current fonts before +% we make changes for compactsong mode. We'll use them restore +% the original values again after leaving compact song mode. +% +% \begin{macro}{\ChBassFontSav} +% \begin{macro}{\ChFontSav} +% \begin{macro}{\ChBkFontSav} +% \begin{macro}{\SBDefaultFontSav} +% \begin{macro}{\SBOccursBrktFontSav} +% \begin{macro}{\SBFontSavVar} +% +% \begin{macrocode} +\newcommand{\ChBassFontSav}{\relax}% +\newcommand{\ChFontSav}{\relax}% +\newcommand{\ChBkFontSav}{\relax}% +\newcommand{\SBDefaultFontSav}{\relax}% +\newcommand{\SBOccursBrktFontSav}{\relax}% +\newcommand{\SBFontSavVar}{\relax}% + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Configurable Dimensions} % In this section we define the spaces to leave in various situations. % @@ -2312,8 +2398,8 @@ % % \subsubsection{Internal Dimensions} % These variables are used internally within \Songbook{} macros. They are -% not part of the published \texttt{songbook.sty} interface; but can be used -% to tune some of its functions. +% not part of the published \texttt{songbook.sty} interface; but a few of them +% can be used to tune some of its functions. % % \begin{macro}{\chSpaceTolerance} % \begin{macro}{\chMiniSpace} @@ -2336,6 +2422,42 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\textwidthSav} +% \begin{macro}{\evensidemarginSav} +% \begin{macro}{\marginparwidthSav} +% \begin{macro}{\marginparsepSav} +% \begin{macro}{\chSpaceToleranceSav} +% \begin{macro}{\HangAmtSav} +% \begin{macro}{\LeftMarginSBChorusSav} +% \begin{macro}{\LeftMarginSBSectionSav} +% \begin{macro}{\LeftMarginSBVerseSav} +% The |\textwidthSav|, |\evensidemarginSav|, |\marginparwidthSav|, +% |\chSpaceToleranceSav|, |\HangAmtSav|, |\LeftMarginSBChorusSav|, +% |\LeftMarginSBSectionSav|, and |\LeftMarginSBVerse| lengths are +% used in |compactsong| processing; to save and then restore values +% from. +% \begin{macrocode} +\newlength{\textwidthSav} +\newlength{\evensidemarginSav} +\newlength{\marginparsepSav} +\newlength{\marginparwidthSav} +\newlength{\chSpaceToleranceSav} +\newcommand{\HangAmtSav}{} +\newcommand{\LeftMarginSBChorusSav}{} +\newcommand{\LeftMarginSBSectionSav}{} +\newcommand{\LeftMarginSBVerseSav}{} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Declaration Of Non-Core Options} % In the \textit{Declaration Of Options} section of the \texttt{.sty} % file we deal with the various options which a user may specify in @@ -2458,17 +2580,47 @@ % \end{macro} % \end{macro} % -% \subsubsection{Compactsong Option} +% \changes{v4.5}{2010/04/30}{Added new compactallsongs option.} +% \subsubsection{Compactallsongs Option} % -% This option tells the \Songbook{} style to present the songs in a -% compact form. For |chordbk| mode this means presenting the songs in +% This option tells the \Songbook{} style to present all the songs in a +% compact form, regardless of what has been specified in each song. For +% |chordbk| mode this means presenting the songs in % two columns per page using a smaller font. When I can figure out % what this option should mean for the other modes I'll code them up. % In the mean time, |wordbk| and |overhead| modes simply ignore the -% |compactsong| option. Like the papersize options, the |compactsong| -% processing here simply sets a flag; the actual code required to -% implement |compactsong| mode is embedded below inside the three core -% options. +% |compactallsongs| option. Like the papersize options, the +% |compactallsongs| processing here simply sets a flag; the actual code +% required to implement |compactallsongs| mode is embedded below inside +% the three core options. +% +% \begin{macrocode} +%%=======================================================% +%% C O M P A C T A L L S O N G S O P T I O N % +%%=======================================================% +% \end{macrocode} +% \begin{macro}{compactallsongs} +% \begin{macrocode} +\DeclareOption{compactallsongs}{% + %%% + % Set flag to indicate the user wants compact song mode + % for all songs. + \CompactAllModetrue +} + +% \end{macrocode} +% \end{macro} +% +% \changes{v4.5}{2010/04/30}{Removed compactsong option.} +% \subsubsection{Compactsong Option} +% +% This option has been replaced with the combination of +% a new |compactallsongs| option and per-song specification +% of |compactsong| mode (see the documentation for the |song| +% environmnet. +% +% So, we now stop processing and print an error message telling +% the user that the option has been removed. % % \begin{macrocode} %%=======================================================% @@ -2478,9 +2630,11 @@ % \begin{macro}{compactsong} % \begin{macrocode} \DeclareOption{compactsong}{% - %%% - % Set flag to indicate the user wants compact song mode. - \CompactSongModetrue + \errmessage{The compactsong Songbook option has been + removed and replaced with a combination of a global + compactallsongs Songbook option and a per-song + environment compactsong option. See the song + environment's documentation} } % \end{macrocode} @@ -2706,61 +2860,6 @@ % % \begin{macrocode} \raggedbottom - -% \end{macrocode} -% -% \paragraph{CompactSong Processing} -% -% Downsize fonts to allow song to fit into half the space (i.e., -% two column mode); although the title will not be reset since -% it will be presented unchanged from normal chordbk mode. -% -% \begin{macrocode} - \ifCompactSongMode - \renewcommand{\ChBassFont}{\small\bf\sf} % = cmss12 at 11.0pt - \renewcommand{\ChFont}{\normalsize\fontfamily{\sfdefault}% - \fontseries{sbc}\fontshape{n}\selectfont} %=cmssbc12 at 12.0pt - \renewcommand{\ChBkFont}{\ChFont\fontseries{m} % - \selectfont} % =cmssm12 at 12.0pt - \renewcommand{\SBDefaultFont}{\normalsize} % = cmr12 at 12.0pt - \renewcommand{\SBOccursBrktFont}{\large\bf\sf} % = cmss10 at 10.9pt - -% \end{macrocode} -% -% Multicol specific changes. -% -% \begin{macrocode} - \setlength{\columnsep}{0.25in} - -% \end{macrocode} -% -% Remove side-margin, since marginal notes are not allowed when -% using multicol.sty. -% -% \begin{macrocode} - \addtolength{\textwidth} {\marginparsep + \marginparwidth} - \addtolength{\evensidemargin}{-\marginparsep - \marginparwidth} - \setlength {\marginparsep} {0in} - \setlength {\marginparwidth}{0in} - -% \end{macrocode} -% -% Reduce minimum spacing amount used in |\Chr| macro (since we're -% now using a smaller font for lyrics and chords. -% -% \begin{macrocode} - \setlength{\chSpaceTolerance}{1.0mm} - -% \end{macrocode} -% -% Remove the extra space before Verses, etc. -% -% \begin{macrocode} - \renewcommand{\HangAmt} {1.5em} - \renewcommand{\LeftMarginSBChorus} {2em} - \renewcommand{\LeftMarginSBSection}{\LeftMarginSBChorus} - \renewcommand{\LeftMarginSBVerse} {\LeftMarginSBChorus} - \fi } % \end{macrocode} @@ -2912,15 +3011,15 @@ % \end{macrocode} % % Do CompactSong processing, which at this time is nothing except -% resetting the |compactsong| flag back to false; to ensure that -% no |compactsong| processing occurs. We take time to print a -% warning message for the user to remind them that the |compactsong| +% resetting the |compactallsongs| flag back to false; to ensure that +% no |compactallsongs| processing occurs. We take time to print a +% warning message for the user to remind them that the |compactallsongs| % option will not have any effect at this time. % % \begin{macrocode} - \ifCompactSongMode - \typeout{``compactsong'' mode not implemented for Wordbk mode.} - \CompactSongModefalse + \ifCompactAllMode + \typeout{``compactallsongs'' mode not implemented for Wordbk mode.} + \CompactAllModefalse \fi } @@ -3100,16 +3199,16 @@ % \end{macrocode} % -% Do CompactSong processing, which at this time is nothing except -% resetting the |compactsong| flag back to false; to ensure that -% no |compactsong| processing occurs. We take time to print a -% warning message for the user to remind them that the |compactsong| +% Do compactallsongs processing, which at this time is nothing except +% resetting the |compactallsongs| flag back to false; to ensure that +% no |compactallsongs| processing occurs. We take time to print a +% warning message for the user to remind them that the |compactallsongs| % option will not have any effect at this time. % % \begin{macrocode} - \ifCompactSongMode - \typeout{``compactsong'' mode not implemented for Overhead mode.} - \CompactSongModefalse + \ifCompactAllMode + \typeout{``compactallsongs'' mode not implemented for Overhead mode.} + \CompactAllModefalse \fi } @@ -3173,15 +3272,24 @@ % \end{macrocode} % -% If we are in |compactsong| mode then load Frank Mittelbach's -% |multicol| package. We specify the date of the 1.5u release; +% \changes{v4.5}{2010/04/30}{\texttt{multicol.sty} is now always required.} +% We load Christian Tellechea's |xtring| package to enable the new +% optional song format string available for the |song| environment. +% This style is available on CTAN. +% +% \begin{macrocode} +\RequirePackage{xstring} + +% \end{macrocode} +% +% \changes{v4.5}{2010/04/30}{New dependency on \texttt{xtring.sty}.} +% We load Frank Mittelbach's |multicol| package to enable use of +% |compactsong| mode. We specify the date of the 1.5u release; % since we make use of the |\columnbreak| command which was only % added in 1.5u. % % \begin{macrocode} -\ifCompactSongMode - \RequirePackage{multicol}[1999/05/25] -\fi +\RequirePackage{multicol}[1999/05/25] % \end{macrocode} % @@ -4058,11 +4166,12 @@ % \end{macro} % % \changes{v4.1}{2003/08/31}{Added $[$\meta{Include?}$]$ option code.} +% \changes{v4.5}{2010/04/30}{Added |compactsong| option code.} % \begin{macro}{song} % |song|\parm{1}\ldots\parm{7} is the environment within which a song % is entered. % \begin{ParameterList} -% \item[\meta{1}] Include song in book? (optional) +% \item[\meta{1}] Song format string (optional). % \item[\meta{2}] Title of song. % \item[\meta{3}] Key song is written in. % \item[\meta{4}] Copyright information. @@ -4076,12 +4185,21 @@ % the song counter and then cause the title and other parameter % information to be displayed. % -% \paragraph{Include Song In Book? (optional)} +% \paragraph{Song Format String (options)} % The first parameter is optional and its default value is -% ``\texttt{Y}''. For simplicity this description refers to the field -% as \meta{Include?}. When the value of \meta{Include?} is ``\texttt{Y}'' then all -% processing is done normally. If the value of \meta{Include?} is (not ``\texttt{Y}'') -% then: +% ``\texttt{YF}''. Each letter in the format string controls one aspect +% of a song's formating. The format string options are: +% \begin{ParameterList} +% \item[|Y| |N|]: Include song in book; specify ``\texttt{Y}'' or +% ``\texttt{N}''? +% \item[|C| |F|]: |compactsong| or not (full size); specify ``\texttt{C}'' +% or ``\texttt{F}''? +% \end{ParameterList} +% +% \subparagraph{YN: Include Song in Book?} +% When the value of \meta{YN: Include Song in Book?} is ``\texttt{Y}'' then all +% processing is done normally. If the value of \meta{YN: Include Song in Book?} +% is ``\texttt{N}'' then: % \begin{itemize} % \item the songcounter is incremented; % \item a TOC index entry is written @@ -4092,6 +4210,10 @@ % songbooks. % \end{itemize} % +% If both ``\texttt{Y}'' and ``\texttt{N}'' are specified, then ``\texttt{Y}'' +% is taken as the specified value. Don't forget that a value of ``\texttt{N}'' +% will be overridden by the global |printallsongs| option. +% % The skipped-entry TOC file is named \texttt{*.tocS}. The purpose of creating % a separate file is twofold: (1)~to allow normal songbook % processing to simply omit these not-included files; (2)~to allow the @@ -4099,10 +4221,22 @@ % process through simple appending of the files to the standard TOC % file. % +% \subparagraph{CF: Compactsong or Full Size?} +% When the value of \meta{CF: Compactsong or Full Size?} is ``\texttt{F}'' +% then all processing is done normally. If the value is ``\texttt{C}'' +% then the song is printed in |compactsong| mode. If both ``\texttt{F}'' +% and ``\texttt{F}'' are specified, then ``\texttt{F}'' +% is taken as the specified value. Don't forget that a value of ``\texttt{F}'' +% will be overridden by the global |compactallsongs| option. +% % \begin{macrocode} -\newenvironment{song}[7][Y]{ % Comment markers to negate - \if#1Y\ExcludeSongfalse\else\ExcludeSongtrue\fi% the newline. +\newenvironment{song}[7][YF]{ % Comment markers to negate + \IfSubStr{\uppercase{#1}}{N}{\ExcludeSongtrue}{\relax}% newlines. + \IfSubStr{\uppercase{#1}}{Y}{\ExcludeSongfalse}{\relax}% \ifPrintAllSongs\ExcludeSongfalse\fi % + \IfSubStr{\uppercase{#1}}{C}{\CompactSongModetrue}{\relax}% newlines. + \IfSubStr{\uppercase{#1}}{F}{\CompactSongModefalse}{\relax}% + \ifCompactAllMode\CompactSongModetrue\fi % \SongMarkboth{\relax}{\relax} % \SBinSongEnvtrue % \renewcommand{\SBinSongEnv}{\True} % @@ -4168,7 +4302,7 @@ % feature using a memory hungry method: when excluding a song, put the % lyrics into |box2| and then discard it without using it. Although Mark % Wooding suggested using this method, he also provided a pointer to -% a more robust method: using the |sverb| package that is part of 'mdwtools' +% a more robust method: using the |sverb| package that is part of `mdwtools' % collection (specifically, the |\ignoreenv{}| command). % % \begin{macrocode} @@ -4184,6 +4318,74 @@ \fi% % \end{macrocode} % +% \paragraph{CompactSong Font Processing} +% +% Downsize fonts to allow song to fit into half the space (i.e., +% two column mode); although the title will not be reset since +% it will be presented unchanged from normal chordbk mode. +% +% \begin{macrocode} + \ifCompactSongMode + \renewcommand{\ChBassFontSav}{\ChBassFont} % + \renewcommand{\ChFontSav}{\ChFont} % + \renewcommand{\ChBkFontSav}{\ChBkFont} % + \renewcommand{\SBDefaultFontSav}{\SBDefaultFont} % + \renewcommand{\SBOccursBrktFontSav}{\SBOccursBrktFont}% + % + \renewcommand{\ChBassFont}{\ChBassFontCS} % + \renewcommand{\ChFont}{\ChFontCS} % + \renewcommand{\ChBkFont}{\ChBkFontCS} % + \renewcommand{\SBDefaultFont}{\SBDefaultFontCS} % + \renewcommand{\SBOccursBrktFont}{\SBOccursBrktFontCS}% +% +% Multicol specific changes. +% \begin{macrocode} + \setlength{\columnsep}{0.25in} + +% \end{macrocode} +% +% Remove side-margin, since marginal notes are not allowed when +% using multicol.sty; but, we save their values before changing +% them. +% +% \begin{macrocode} + \setlength{\textwidthSav} {\textwidth} + \setlength{\evensidemarginSav}{\evensidemargin} + \setlength{\marginparsepSav} {\marginparsep} + \setlength{\marginparwidthSav}{\marginparwidth} + % + \addtolength{\textwidth} {\marginparsep + \marginparwidth} + \addtolength{\evensidemargin}{-\marginparsep - \marginparwidth} + \setlength {\marginparsep} {0in} + \setlength {\marginparwidth}{0in} + +% \end{macrocode} +% +% Reduce minimum spacing amount used in |\Chr| macro (since we're +% now using a smaller font for lyrics and chords. +% +% \begin{macrocode} + \setlength{\chSpaceToleranceSav}{\chSpaceTolerance} + % + \setlength{\chSpaceTolerance}{1.0mm} + +% \end{macrocode} +% +% Remove the extra space before Verses, etc. +% +% \begin{macrocode} + \renewcommand{\HangAmtSav} {\HangAmt} + \renewcommand{\LeftMarginSBChorusSav} {\LeftMarginSBChorus} + \renewcommand{\LeftMarginSBSectionSav}{\LeftMarginSBSection} + \renewcommand{\LeftMarginSBVerseSav} {\LeftMarginSBVerse} + % + \renewcommand{\HangAmt} {1.5em} + \renewcommand{\LeftMarginSBChorus} {2em} + \renewcommand{\LeftMarginSBSection}{\LeftMarginSBChorus} + \renewcommand{\LeftMarginSBVerse} {\LeftMarginSBChorus} + \fi +% \end{macrocode} +% % Whereever you see a parameter used directly, and not the parameter macro % just set, above, it is because I haven't figured out how the receiving % macro can deal with accepting its input via a macro (and not via the @@ -4224,13 +4426,30 @@ % This brings the |song| environment's open clause to a close. % % The close clause now starts. We begin by closing out the |SamepageMode| -% and |CompactSongMode| environments, as applicable. +% and |CompactSongMode| environments, as applicable. For |CompactSongMode| +% we need to restore the fonts and lengths. % % \begin{macrocode} {\ifSamepageMode% \end{samepage}% \fi% \ifCompactSongMode + \renewcommand{\ChBassFont}{\ChBassFontSav} % + \renewcommand{\ChFont}{\ChFontSav} % + \renewcommand{\ChBkFont}{\ChBkFontSav} % + \renewcommand{\SBDefaultFont}{\SBDefaultFontSav} % + \renewcommand{\SBOccursBrktFont}{\SBOccursBrktFontSav}% + % + \setlength{\textwidth} {\textwidthSav} + \setlength{\evensidemargin}{\evensidemarginSav} + \setlength{\marginparsep} {\marginparsepSav} + \setlength{\marginparwidth}{\marginparwidthSav} + % + \renewcommand{\HangAmt} {\HangAmtSav} + \renewcommand{\LeftMarginSBChorus} {\LeftMarginSBChorusSav} + \renewcommand{\LeftMarginSBSection}{\LeftMarginSBSectionSav} + \renewcommand{\LeftMarginSBVerse} {\LeftMarginSBVerseSav} + % \end{multicols*} \fi \ifSongEject% diff --git a/Master/texmf-dist/source/latex/songbook/songbook.ins b/Master/texmf-dist/source/latex/songbook/songbook.ins index 61d16a4d669..064e52175ca 100644 --- a/Master/texmf-dist/source/latex/songbook/songbook.ins +++ b/Master/texmf-dist/source/latex/songbook/songbook.ins @@ -1,8 +1,8 @@ -%% rcsid = @(#)$Id: songbook.ins,v 1.7 2010-03-31 02:15:53 rathc Exp $ +%% rcsid = @(#)$Id: songbook.ins,v 1.8 2010-04-12 18:04:32 rathc Exp $ %% %% songbook.ins - Docstrip batch file for Songbook Style %% -%% Version 4.4, 30 March, 2010 +%% Version 4.5, 30 April, 2010 %% %% Copyright 1992--2010 Christopher Rath <christopher@rath.ca> %% |