diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:56:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:56:38 +0000 |
commit | b8b1a1e846e3d5c37bf2c58065b7f930af39099a (patch) | |
tree | 3a467681a7aaad52c2c7fb6bc8f6c633982815de /Master/texmf-dist/tex/latex/guitar/guitar.sty | |
parent | a63ba1198eb4719ae26636989895d1799a116169 (diff) |
guitar
git-svn-id: svn://tug.org/texlive/trunk@967 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/guitar/guitar.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/guitar/guitar.sty | 192 |
1 files changed, 192 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/guitar/guitar.sty b/Master/texmf-dist/tex/latex/guitar/guitar.sty new file mode 100644 index 00000000000..20d6deaf272 --- /dev/null +++ b/Master/texmf-dist/tex/latex/guitar/guitar.sty @@ -0,0 +1,192 @@ +%% +%% This file was generated by the docstrip utility from guitar.dtx. +%% You may distribute this file only together with the source guitar.dtx +%% (and if possible with guitar.ins) and only if these files are unmodified. +%% +%% Author: +%% +%% M. V\"ath vaeth@mathematik.uni-wuerzburg.de +%% + +\ifx\typeout\undefined + \def\tbx@tmp{\immediate\write17}\expandafter\tbx@tmp +\else + \expandafter\typeout +\fi{guitar.sty by M. Vaeth: Guitar chords over song texts 1.5} + +\ifx\ProvidesPackage\undefined\else + \ProvidesPackage{guitar}[2001/10/08 v1.5] +\fi +\ifx\RequirePackage\undefined + \ifx\toolboxDef\undefined + \input toolbox.sty + \fi +\else + \RequirePackage{toolbox}[2001/04/08] +\fi +\ifx\toolboxIfNextGobbling\undefined + \errmessage{guitar.sty requires toolbox.sty version 2.0 or higher} +\fi + +\ifx\newenvironment\undefined\else + \newenvironment{guitar}{\guitarOn}{\guitarOff} + \newenvironment{guitarMagic}{\guitarMagicOn}{\guitarMagicOff} + \newenvironment{guitarCr}{\guitarCrOn}{\guitarCrOff} +\fi + +\ifx\newcommand\undefined\else + \newcommand{\guitarChord}{} + + \newcommand{\guitarOn}{} + \newcommand{\guitarOff}{} + \newcommand{\guitarMagicOn}{} + \newcommand{\guitarMagicOff}{} + \newcommand{\guitarCrOn}{} + \newcommand{\guitarCrOff}{} + + \newcommand{\guitarSharp}{} + \newcommand{\guitarFlat}{} + \newcommand{\guitarMagicOnHook}{} + \newcommand{\guitarMagicOffHook}{} + \newcommand{\guitarCrOnHook}{} + \newcommand{\guitarCrOffHook}{} + \newcommand{\guitarEndLine}{} + \newcommand{\guitarEndPar}{} + \newcommand{\guitarEndDoublePar}{} + \newcommand{\guitarCalcDim}{} + \newcommand{\guitarPreAccord}{} + + \newcommand{\guitarPut}{} + \newcommand{\guitarPutOnSpace}{} + \newcommand{\guitarPutDist}{} + \newcommand{\guitarPutMerge}{} + + \newcommand{\guitarNoChord}{} + + \newcommand{\guitarAccord}{} + \newcommand{\guitarSplitDist}{} + \newcommand{\guitarSplitMerge}{} +\fi + +\ifx\newsavebox\undefined + \newbox\guitarBox +\else + \newsavebox{\guitarBox} +\fi +\ifx\newlength\undefined + \newskip\guitarDim +\else + \newlength{\guitarDim} +\fi + +\def\guitarSharp{$\sharp$} +\def\guitarFlat{$\flat$} +\def\guitarCalcDim{\advance\guitarDim by 2pt} +\def\guitarPreAccord{\footnotesize\strut} +\let\guitarMagicOnHook\toolboxEmpty +\let\guitarMagicOffHook\toolboxEmpty +\def\guitarCrOnHook{\begingroup\leftskip 0pt plus 1fill\relax + \parindent 0pt\leavevmode\gtr@CrOnHook\nobreak\hskip-\leftskip\relax + \finalhyphendemerits=0\everypar{\nobreak\hskip-\leftskip\relax}\sloppy\relax + \linepenalty=50\relax\parskip0pt\relax} +\def\guitarFirstLeft{\def\gtr@CrOnHook + {\rightskip 0pt plus 1fil\relax\parfillskip 0pt\relax}} +\def\guitarFirstFlush{\let\gtr@CrOnHook\toolboxEmpty} +\guitarFirstFlush +\let\guitarCrOffHook\endgroup +\def\guitarEndLine{\par\leavevmode} +\def\guitarEndPar{\medskip\par\leavevmode} +\def\guitarEndDoublePar{\bigskip\par\leavevmode} + +\def\guitarPut#1{\setbox0\hbox{\strut#1}\leavevmode + \raise\ht0\hbox to 0pt{\hbox to\wd0{\guitarPreAccord + \hfill\guitarAccord\hfill\hss}\hss}#1} +\def\guitarPutOnSpace{\leavevmode\raise\ht\strutbox + \hbox{\guitarPreAccord\guitarAccord}} +\def\guitarPutDist{\gtr@distMerge\hfil} +\def\guitarPutMerge{\gtr@distMerge\hrulefill} +\def\gtr@distMerge#1#2{\setbox\guitarBox\hbox{\strut#2}% + \setbox0\hbox{\guitarPreAccord\guitarAccord}\leavevmode + \guitarDim=\wd0\relax\guitarCalcDim + \ifdim\wd\guitarBox<\guitarDim% Accord is too large: + \hbox to 0pt{\raise\ht\guitarBox\hbox{\copy0}\hss}% + \hbox to\guitarDim{\box\guitarBox#1}% + \let\guitarAccord\toolboxEmpty%now used as a temporary variable. + \else + \hbox to 0pt{\raise\ht\guitarBox + \hbox to\wd\guitarBox{\hfil\box0\hfil}\hss}% + \def\guitarAccord{#2}% + \fi\guitarAccord} + +\def\guitarNoChord{\def\guitarPut##1{##1}% + \let\guitarPutDist\guitarPut + \let\guitarPutMerge\guitarPut + \let\guitarPutOnSpace\toolboxSpace} + +\toolboxMakeSplit{|}{guitarSplitDist} +\toolboxMakeSplit{_}{guitarSplitMerge} + +\def\guitarOn{\guitarCrOn\guitarMagicOn} +\def\guitarOff{\guitarMagicOff\guitarCrOff} +\def\guitarMagicOn{\guitarMagicOnHook\gtr@magicOn\gtr@ignorespaces} +\def\guitarMagicOff{\gtr@magicOff\guitarMagicOffHook} +\def\gtr@crMagicCondOn{\gtr@magicCondOn\gtr@crCondOn} +\def\gtr@crMagicCondOff{\gtr@magicCondOff\gtr@crCondOff} +\def\gtr@magicOn{\gtr@magicOnCat + \let\gtr@magicCondOff\gtr@magicOffCat + \let\gtr@magicCondOn\gtr@magicOnCat} +\def\gtr@magicOff{\gtr@magicOffCat + \let\gtr@magicCondOff\toolboxEmpty + \let\gtr@magicCondOn\toolboxEmpty} +\def\gtr@magicOnCat{\catcode`\[=13\relax} +\gtr@magicOnCat\def[{\gtr@chordTest\gtr@scanBrace} +\def\gtr@magicOffCat{\catcode`\[=12\relax} +\gtr@magicOff + +\def\gtr@scanBrace#1]{\gtr@parse{#1}} + +\def\guitarChord{\gtr@chordTest\gtr@parse} +\def\gtr@chordTest#1{\gtr@crMagicCondOff\gtr@change + \toolboxIfNextGobbling*{\gtr@normal#1}{#1}} +\def\gtr@parse#1{\gtr@normal + \guitarSplitDist{#1}\guitarAccord\gtr@dist + \expandafter + \guitarSplitMerge\expandafter{\guitarAccord}\guitarAccord\gtr@merge + \toolboxIfNextGobbling\toolboxSpaceToken + {\gtr@crMagicCondOn\guitarPutOnSpace}\gtr@para} +\def\gtr@para#1{\gtr@crMagicCondOn + \ifx\gtr@dist\undefined + \ifx\gtr@merge\undefined + \let\gtr@tmp\guitarPut + \else + \let\gtr@tmp\guitarPutMerge + \fi + \else + \let\gtr@tmp\guitarPutDist + \fi\gtr@tmp{#1}} + +\def\gtr@change{\catcode`\#=13\catcode`b=13\relax} +\gtr@change\def#{\guitarSharp} +\def b{\guitarFlat} +\def\gtr@normal{\catcode`\#=6\catcode`b=11\relax} +\gtr@normal + +\def\guitarCrOn{\guitarCrOnHook\gtr@crOn\gtr@ignorespaces} +\def\guitarCrOff{\gtr@crOff\guitarCrOffHook} +\def\gtr@crOn{\gtr@crOnCat + \let\gtr@crCondOff\gtr@crOffCat + \let\gtr@crCondOn\gtr@crOnCat} +\def\gtr@crOff{\gtr@crOffCat + \let\gtr@crCondOff\toolboxEmpty + \let\gtr@crCondOn\toolboxEmpty} +\def\gtr@crOnCat{\catcode`\^^M=13\relax} +\gtr@crOnCat\def^^M{\toolboxIfNextGobbling^^M\gtr@par\guitarEndLine}% +\def\gtr@par{\toolboxIfNextGobbling^^M\gtr@dblpar\guitarEndPar}% +\def\gtr@dblpar{\toolboxIfNextGobbling^^M\gtr@dblpar\guitarEndDoublePar}% +\def\gtr@ignorespaces{\toolboxIfNextGobbling^^M\gtr@ignorespaces\ignorespaces}% +\def\gtr@crOffCat{\catcode`\^^M=5\relax}% +\gtr@crOff + +\endinput +%% +%% End of file `guitar.sty'. |