summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-03-19 16:39:43 +0000
committerKarl Berry <karl@freefriends.org>2009-03-19 16:39:43 +0000
commitb2b633e01d06322e0aa769988f0ea7320d9f9a37 (patch)
tree04d8e0e02eac6cbb7b0f7c9caf4697a0ebfa2537 /Master/texmf-dist/source/latex
parent44fd9c60eecdeb03f545d4c6199921b9ea71fa28 (diff)
guitar update (17mar09)
git-svn-id: svn://tug.org/texlive/trunk@12435 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/guitar/guitar.dtx99
1 files changed, 78 insertions, 21 deletions
diff --git a/Master/texmf-dist/source/latex/guitar/guitar.dtx b/Master/texmf-dist/source/latex/guitar/guitar.dtx
index 230dff9db7a..342e97deef6 100644
--- a/Master/texmf-dist/source/latex/guitar/guitar.dtx
+++ b/Master/texmf-dist/source/latex/guitar/guitar.dtx
@@ -1,17 +1,21 @@
-% \def\fileversion{1.5}\def\filedate{2001/10/08}\def\docdate{2001/10/08}
+% \def\fileversion{1.6}\def\filedate{2009/03/17}\def\docdate{2009/03/17}
%\iffalse These lines are necessary for the doc and docstrip utilities
%<*asciidocu>
%%#
-%%# Author:
+%%# Author and copyright 2001,2009:
%%#
%%# M. V\"ath vaeth@mathematik.uni-wuerzburg.de
%%#
%%# The author thanks
%%# Donald Arseneau <asnd@triumf.ca>
%%# Dan Luecking <luecking@uark.edu>
+%%# Heiko Oberdiek <oberdiek@uni-freiburg.de>
%%# and a colleague who does not want to be named here.
+%%# The package may be distributed and/or modified under the conditions of
+%%# the LaTeX Project Public License (version 1.3c or later).
+
%%#############################################################################
%%#
%%# guitar.sty - typesetting guitar chords over song texts.
@@ -368,7 +372,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
-% \CheckSum{485}
+% \CheckSum{532}
% \iffalse
% \RecordChanges
@@ -381,6 +385,9 @@
% \newcommand{\cmdcite}[1]{\texttt{\textbackslash#1}}
% \newcommand{\filecite}[1]{\texttt{#1}}
%
+% \changes{1.6}{2009/03/17}{Do not redefine commands on new catcodes globally.
+% Instead save and restore the original definition when changing catcodes.
+% Thanks to Heiko Oberdiek for pointing out this bug}
% \changes{1.5}{2001/08/27}{Included references to other packages in
% documentation; slightly modified the \cmdcite{typeout} of the package name}
% \changes{1.4}{2001/08/27}{Introduced \texttt{*} versions to avoid changing
@@ -842,10 +849,10 @@
\def\tbx@tmp{\immediate\write17}\expandafter\tbx@tmp
\else
\expandafter\typeout
-\fi{guitar.sty by M. Vaeth: Guitar chords over song texts 1.5}
+\fi{guitar.sty by M. Vaeth: Guitar chords over song texts 1.6}
\ifx\ProvidesPackage\undefined\else
- \ProvidesPackage{guitar}[2001/10/08 v1.5]
+ \ProvidesPackage{guitar}[2009/03/17 v1.6]
\fi
\ifx\RequirePackage\undefined
\ifx\toolboxDef\undefined
@@ -1105,20 +1112,34 @@
\let\gtr@magicCondOn\toolboxEmpty}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\gtr@braceOnDef}
+% "\gtr@braceOnDef" will later save/redefine the "[" command.
+% For the very first call below we must make it a dummy command now.
+% \begin{macrocode}
+\let\gtr@magicOnDef\toolboxEmpty
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\gtr@magicOnCat}\nocomment
% \begin{macrocode}
-\def\gtr@magicOnCat{\catcode`\[=13\relax}
+\def\gtr@magicOnCat{\catcode`\[=13\gtr@magicOnDef}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{[}\nocomment
+% \begin{macro}{gtr@magicSave}\nocomment
+% "\gtr@magicSave" is the content of the original "[" command
% \begin{macrocode}
-\gtr@magicOnCat\def[{\gtr@chordTest\gtr@scanBrace}
+\gtr@magicOnCat\def\gtr@magicOnDef{\let\gtr@magicSave[\let[\gtr@magicNew}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gtr@magicNew}\nocomment
+% "\gtr@magicNew" is the magic new "[" command
+% \begin{macrocode}
+\def\gtr@magicNew{\gtr@chordTest\gtr@scanBrace}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\gtr@magicOffCat}\nocomment
% \begin{macrocode}
-\def\gtr@magicOffCat{\catcode`\[=12\relax}
-\gtr@magicOff
+\def\gtr@magicOffCat{\let[\gtr@magicSave\catcode`\[=12\relax}
+\gtr@magicOnDef\gtr@magicOff
% \end{macrocode}
% \end{macro}
@@ -1149,10 +1170,11 @@
% following space (gobbling). Depending on what it finds, it expands the
% corresponding "\guitarPut..." command.
% \begin{macrocode}
-\def\gtr@parse#1{\gtr@normal
+\def\gtr@parse#1{\gtr@normal\gtr@changeDef
\guitarSplitDist{#1}\guitarAccord\gtr@dist
\expandafter
\guitarSplitMerge\expandafter{\guitarAccord}\guitarAccord\gtr@merge
+ \gtr@changeUndef
\toolboxIfNextGobbling\toolboxSpaceToken
{\gtr@crMagicCondOn\guitarPutOnSpace}\gtr@para}
% \end{macrocode}
@@ -1177,20 +1199,41 @@
\def\gtr@change{\catcode`\#=13\catcode`b=13\relax}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{#}\nocomment
+% \begin{macro}{gtr@sharpSave}
+% "\gtr@sharpSave" is the content of the original sharp command
+% \end{macro}
+% \begin{macro}{gtr@flatSave}
+% "\gtr@flatSave" is the content of the original flat command
+% \end{macro}
+% \begin{macro}{\gtr@changeDef}
+% "\gtr@changeDef" will later save/redefine the sharp and flat command.
% \begin{macrocode}
-\gtr@change\def#{\guitarSharp}
+\gtr@change\def\gtr@changeDef{\let\gtr@sharpSave#\let#\gtr@sharpNew
+ \let\gtr@flatSave b\let b\gtr@flatNew}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{b}\nocomment
+% \begin{macro}{gtr@ChangeUndef}
+% "\gtr@ChangeUndef" restores the change made by "\gtr@changeDef"
% \begin{macrocode}
-\def b{\guitarFlat}
+\def\gtr@changeUndef{\let#\gtr@sharpSave\let b\gtr@flatSave}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gtr@sharpNew}\nocomment
+% "\gtr@sharpNew" is the magic new "#" command
+% \begin{macrocode}
+\def\gtr@sharpNew{\guitarSharp}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gtr@flatNew}\nocomment
+% "\gtr@flatNew" is the magic new "#" command
+% \begin{macrocode}
+\def\gtr@flatNew{\guitarFlat}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\gtr@normal}\nocomment
% \begin{macrocode}
\def\gtr@normal{\catcode`\#=6\catcode`b=11\relax}
-\gtr@normal
+\gtr@changeDef\gtr@normal
% \end{macrocode}
% \end{macro}
@@ -1218,14 +1261,28 @@
\let\gtr@crCondOn\toolboxEmpty}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\gtr@crOnDef}
+% "\gtr@crOnDef" will later save/redefine the linefeed command.
+% For the very first call below we must make it a dummy command now.
+% \begin{macrocode}
+\let\gtr@crOnDef\toolboxEmpty
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\gtr@crOnCat}\nocomment
% \begin{macrocode}
-\def\gtr@crOnCat{\catcode`\^^M=13\relax}
+\def\gtr@crOnCat{\catcode`\^^M=13\gtr@crOnDef}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{gtr@crSave}\nocomment
+% "\gtr@crSave" is the content of the original linefeed command
+% \begin{macrocode}
+\gtr@crOnCat\def\gtr@crOnDef{\let\gtr@crSave^^M\let^^M\gtr@crNew}%
% \end{macrocode}
% \end{macro}
-% \begin{macro}{linefeed}\nocomment
+% \begin{macro}{gtr@crNew}\nocomment
+% "\gtr@crNew" is the special new linefeed command
% \begin{macrocode}
-\gtr@crOnCat\def^^M{\toolboxIfNextGobbling^^M\gtr@par\guitarEndLine}%
+\def\gtr@crNew{\toolboxIfNextGobbling^^M\gtr@par\guitarEndLine}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{gtr@par}\nocomment
@@ -1245,8 +1302,8 @@
% \end{macro}
% \begin{macro}{gtr@crOffCat}\nocomment
% \begin{macrocode}
-\def\gtr@crOffCat{\catcode`\^^M=5\relax}%
-\gtr@crOff
+\def\gtr@crOffCat{\let^^M\gtr@crSave\catcode`\^^M=5\relax}%
+\gtr@crOnDef\gtr@crOff
% \end{macrocode}
% \end{macro}