texlive[51494] Master/texmf-dist: songs (27jun19)
commits+karl at tug.org
commits+karl at tug.org
Thu Jun 27 23:00:23 CEST 2019
Revision: 51494
http://tug.org/svn/texlive?view=revision&revision=51494
Author: karl
Date: 2019-06-27 23:00:23 +0200 (Thu, 27 Jun 2019)
Log Message:
-----------
songs (27jun19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/songs/README
trunk/Master/texmf-dist/doc/latex/songs/history.txt
trunk/Master/texmf-dist/doc/latex/songs/sample/chordbook.tex
trunk/Master/texmf-dist/doc/latex/songs/sample/lyricbook.tex
trunk/Master/texmf-dist/doc/latex/songs/sample/slidebook.tex
trunk/Master/texmf-dist/doc/latex/songs/sample/songs.sbd
trunk/Master/texmf-dist/doc/latex/songs/sample/transparencies.tex
trunk/Master/texmf-dist/doc/latex/songs/songidx/bible.can
trunk/Master/texmf-dist/doc/latex/songs/songidx/catholic.can
trunk/Master/texmf-dist/doc/latex/songs/songidx/greek.can
trunk/Master/texmf-dist/doc/latex/songs/songidx/protestant.can
trunk/Master/texmf-dist/doc/latex/songs/songidx/songidx.lua
trunk/Master/texmf-dist/doc/latex/songs/songidx/tanakh.can
trunk/Master/texmf-dist/doc/latex/songs/songs.pdf
trunk/Master/texmf-dist/source/latex/songs/songs.dtx
trunk/Master/texmf-dist/source/latex/songs/songs.ins
trunk/Master/texmf-dist/tex/latex/songs/songs.sty
Added Paths:
-----------
trunk/Master/texmf-dist/source/latex/songs/Makefile
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/songs/Makefile
Deleted: trunk/Master/texmf-dist/doc/latex/songs/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/Makefile 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/Makefile 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,23 +0,0 @@
-LATEX = pdflatex
-TEXOUT = pdf
-MAKEINDEX = makeindex
-
-all: songs.sty songs.$(TEXOUT)
-
-songs.sty: songs.ins songs.dtx
- $(LATEX) $<
-
-songs.$(TEXOUT): songs.dtx songs.sty
- $(LATEX) $<
- $(MAKEINDEX) -s gind.ist -o $(join $(basename $@ $@),.ind .idx)
- $(MAKEINDEX) -s gglo.ist -o $(join $(basename $@ $@),.gls .glo)
- $(LATEX) $<
- $(MAKEINDEX) -s gind.ist -o $(join $(basename $@ $@),.ind .idx)
- $(MAKEINDEX) -s gglo.ist -o $(join $(basename $@ $@),.gls .glo)
- $(LATEX) $<
-
-clean:
- -rm songs.$(TEXOUT) songs.sty
- -rm *.aux *.log *.out
- -rm *.ind *.idx *.gls *.glo *.ilg
-
Modified: trunk/Master/texmf-dist/doc/latex/songs/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/README 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/README 2019-06-27 21:00:23 UTC (rev 51494)
@@ -24,7 +24,7 @@
II. Copyright Notice
-The Songs LaTeX Package is copyright (C) 2017 Kevin W. Hamlen.
+The Songs LaTeX Package is copyright (C) 2018 Kevin W. Hamlen.
It 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;
Modified: trunk/Master/texmf-dist/doc/latex/songs/history.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/history.txt 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/history.txt 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,5 +1,15 @@
Songs LaTeX Package Revision History:
+Version 3.1 [2018/09/12]: Sixth CTAN Release
+
+ * Fixed a bug that broke \titleprefixword, \authsepword, \authbyword, and \authignoreword family of macros.
+
+ * New support for drawing barre chords in \gtab
+
+ * Macros now permitted within \gtab strings and fingering arguments.
+
+ * PDF mode now correctly detected on XeTeX.
+
Version 3.0 [2017/06/05]: Fifth CTAN Release
* Transitioned the songidx program to LuaTeX, eliminating the need for C-compiled programs. This significant change to the install process warrants the transition to a new major version number.
Modified: trunk/Master/texmf-dist/doc/latex/songs/sample/chordbook.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/sample/chordbook.tex 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/sample/chordbook.tex 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/sample/lyricbook.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/sample/lyricbook.tex 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/sample/lyricbook.tex 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/sample/slidebook.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/sample/slidebook.tex 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/sample/slidebook.tex 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/sample/songs.sbd
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/sample/songs.sbd 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/sample/songs.sbd 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/sample/transparencies.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/sample/transparencies.tex 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/sample/transparencies.tex 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/bible.can
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/bible.can 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/bible.can 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 Kevin W. Hamlen
+# Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/catholic.can
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/catholic.can 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/catholic.can 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 Kevin W. Hamlen
+# Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/greek.can
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/greek.can 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/greek.can 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 Kevin W. Hamlen
+# Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/protestant.can
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/protestant.can 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/protestant.can 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 Kevin W. Hamlen
+# Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/songidx.lua
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/songidx.lua 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/songidx.lua 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
--- Copyright (C) 2017 Kevin W. Hamlen
+-- Copyright (C) 2018 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
@@ -19,7 +19,7 @@
-- http://songs.sourceforge.net.
-VERSION = "3.0"
+VERSION = "3.1"
BIBLEDEFAULT = "bible.can"
-- fileopen(<filename>)
@@ -203,16 +203,16 @@
end
end
-prelist = { A=true, THE=true }
+wt_prefix = { A=true, THE=true }
wt_and = { AND=true }
wt_by = { BY=true }
wt_unknown = { UNKNOWN=true }
-- rotate(<title>)
--- If the first word of <title> is any word in prelist, then shift that word
+-- If the first word of <title> is any word in wt_prefix, then shift that word
-- to the end of the string, preceded by a comma and a space. So for example,
--- if prelist contains "The", then rotate("The title") returns "Title, The".
--- Words in prelist are matched case-insensitively, and the new first word
+-- if wt_prefix contains "The", then rotate("The title") returns "Title, The".
+-- Words in wt_prefix are matched case-insensitively, and the new first word
-- becomes capitalized. If <title> begins with the marker character '*',
-- that character is ignored and left unchanged.
function rotate(s)
@@ -219,7 +219,7 @@
local t = unicode.utf8.upper(s)
local n = 0
if s:sub(1,1) == "*" then n = 1 end
- for pre in pairs(prelist) do
+ for pre in pairs(wt_prefix) do
if t:sub(1+n,n+#pre) == pre and
unicode.utf8.find(t, "^%s+%S", n+#pre+1) then
local len = unicode.utf8.len(pre)
@@ -402,7 +402,10 @@
buf:match("^%%p()refix ") or
buf:match("^%%ig()nore ")
if j then
- if not seen[j] then wt[j], seen[j] = {}, true end
+ if not seen[j] then
+ for w in pairs(wt[j]) do wt[j][w] = nil end
+ seen[j] = true
+ end
wt[j][unicode.utf8.upper(buf:sub(buf:find(" ")+1))] = true
end
else
@@ -938,7 +941,7 @@
while arg[i] do
if arg[i] == "-v" or arg[i] == "--version" then
io.write("songidx ", VERSION, "\n",
- "Copyright (C) 2017 Kevin W. Hamlen\n",
+ "Copyright (C) 2018 Kevin W. Hamlen\n",
"License GPLv2: GNU GPL version 2 or later",
" <http://gnu.org/licenses/gpl.html>\n",
"This is free software: you are free to change and redistribute it.\n",
Modified: trunk/Master/texmf-dist/doc/latex/songs/songidx/tanakh.can
===================================================================
--- trunk/Master/texmf-dist/doc/latex/songs/songidx/tanakh.can 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/doc/latex/songs/songidx/tanakh.can 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 Kevin W. Hamlen
+# Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/doc/latex/songs/songs.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/source/latex/songs/Makefile
===================================================================
--- trunk/Master/texmf-dist/source/latex/songs/Makefile (rev 0)
+++ trunk/Master/texmf-dist/source/latex/songs/Makefile 2019-06-27 21:00:23 UTC (rev 51494)
@@ -0,0 +1,23 @@
+LATEX = pdflatex
+TEXOUT = pdf
+MAKEINDEX = makeindex
+
+all: songs.sty songs.$(TEXOUT)
+
+songs.sty: songs.ins songs.dtx
+ $(LATEX) $<
+
+songs.$(TEXOUT): songs.dtx songs.sty
+ $(LATEX) $<
+ $(MAKEINDEX) -s gind.ist -o $(join $(basename $@ $@),.ind .idx)
+ $(MAKEINDEX) -s gglo.ist -o $(join $(basename $@ $@),.gls .glo)
+ $(LATEX) $<
+ $(MAKEINDEX) -s gind.ist -o $(join $(basename $@ $@),.ind .idx)
+ $(MAKEINDEX) -s gglo.ist -o $(join $(basename $@ $@),.gls .glo)
+ $(LATEX) $<
+
+clean:
+ -rm songs.$(TEXOUT) songs.sty
+ -rm *.aux *.log *.out
+ -rm *.ind *.idx *.gls *.glo *.ilg
+
Property changes on: trunk/Master/texmf-dist/source/latex/songs/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/songs/songs.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/songs/songs.dtx 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/source/latex/songs/songs.dtx 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2017 Kevin W. Hamlen
+% Copyright (C) 2018 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
@@ -29,7 +29,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{songs}
%<*package>
- [2017/06/05 v3.0 Songs package]
+ [2018/09/12 v3.1 Songs package]
%</package>
%
%<*driver>
@@ -387,7 +387,7 @@
%</driver>
% \fi
%
-% \CheckSum{8792}
+% \CheckSum{8935}
%
% \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
@@ -431,7 +431,7 @@
%
% \title{The \Songs{} package\thanks{This manual documents
% \textsf{songs}~\fileversion, dated~\filedate,
-% \copyright~2017 Kevin W.~Hamlen, and
+% \copyright~2018 Kevin W.~Hamlen, and
% distributed under version~2 the GNU General Public License
% as published by the Free Software Foundation.}}
% \author{Kevin W. Hamlen}
@@ -489,7 +489,7 @@
% \medskip
%
% \noindent
-% This software is copyright \copyright~2017 Kevin W.~Hamlen.
+% This software is copyright \copyright~2018 Kevin W.~Hamlen.
% For contact information or the latest version, see the project webpage at:
%
% \vskip1.5ex
@@ -1668,6 +1668,14 @@
% \example|\gtab{C#sus4}{4:XX3341}|\produces{\vcenterbox{\gtab{C\shrp sus4}{4:XX3341}}}
% \example|\gtab{B&}{X13331}|\produces{\vcenterbox{\gtab{B\flt}{{\hphantom{4}}:X13331:}}}
%
+% To create a barre chord in which one finger is extended across multiple
+% strings, use parentheses |()| or brackets |[]| in the \Meta{strings}
+% argument to group the barred strings.
+% Each such group will draw a barre on the lowest numbered fret it contains.
+% For example:
+%
+% \example|\gtab{C7}{X(3535X):013140}|\produces{\vcenterbox{\gtab{C7}{{\hphantom{4}}:X(3535X):013140}}}
+%
% \DescMacro{minfrets}
% By default, tablature diagrams always consist of at least 4 fret rows
% (more if the \Meta{strings} argument contains a number larger than 4).
@@ -1682,6 +1690,27 @@
% causes tablature diagrams to have only as many rows are required to
% accommodate the largest digit appearing in the \Meta{strings} argument.
%
+% \paragraph{Tablatures Within Macros}
+% Macros that produce tablatures must not bury the colons that separate the
+% \Meta{fret}, \Meta{strings}, and \Meta{fingering} arguments within other
+% macros, and it's safest to always include both colons to avoid ambiguities
+% related to optional argument parsing.
+% For example,
+%
+% \begin{codeblock}
+% |\newcommand{\mystrings}{X4412X}|
+% |\newcommand{\myfingers}{X3412X}|
+% |\newcommand{\mychord}{|\mac{gtab}|{C|\mac{shrp}|}{:\mystrings:\myfingers}}|
+% \end{codeblock}
+%
+% \noindent
+% works as expected.
+% But omitting the colon before |\mystrings| in the definition of |\mychord|
+% confuses \mac{gtab} into thinking |\mystrings| is the \Meta{fret}
+% argument, and writing code like |\gtab{C\shrp}{\allargs}| with |\allargs|
+% defined to something with colons results in an error, because it confuses
+% \mac{gtab} into thinking that |\allargs| is only the \Meta{strings} argument.
+%
% \section{Automatic Transposition}\label{sec:transpose}
%
% \DescMacro{transpose}
@@ -3930,13 +3959,15 @@
% treatment of hyperlinks and bookmark indexes.
% \begin{macrocode}
\newif\ifSB at pdf\SB at pdffalse
-\ifx\pdfoutput\undefined\else
- \ifx\pdfoutput\relax\else
- \ifnum\pdfoutput<\@ne\else
- \SB at pdftrue
+\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\ifpdf\SB at pdftrue\fi}{
+ \ifx\pdfoutput\undefined\else
+ \ifx\pdfoutput\relax\else
+ \ifnum\pdfoutput<\@ne\else
+ \SB at pdftrue
+ \fi
\fi
\fi
-\fi
+}
% \end{macrocode}
% \end{macro}
%
@@ -5716,14 +5747,10 @@
% Using |scleardpage| moves to the next double-page if the current
% double-page is nonempty.
% \begin{macrocode}
-\newcommand\SB at songlistbrk{}
-\def\SB at songlistbrk{brk}
-\newcommand\SB at songlistnc{}
-\def\SB at songlistnc{nextcol}
-\newcommand\SB at songlistcp{}
-\def\SB at songlistcp{sclearpage}
-\newcommand\SB at songlistcdp{}
-\def\SB at songlistcdp{scleardpage}
+\newcommand*\SB at songlistbrk{brk}
+\newcommand*\SB at songlistnc{nextcol}
+\newcommand*\SB at songlistcp{sclearpage}
+\newcommand*\SB at songlistcdp{scleardpage}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -5917,8 +5944,7 @@
\newcommand\SB at lop[1]{\expandafter\SB@@lop\the#1\SB@@lop#1}
\newcommand\SB@@lop{}
\def\SB@@lop\\#1\\#2\SB@@lop#3#4{\global#3{\\#2}\global#4{#1}}
-\newcommand\SB at emptylist{}
-\def\SB at emptylist{\\}
+\newcommand*\SB at emptylist{\\}
\newcommand\SB at ifempty[3]{%
\edef\SB at temp{\the#1}%
\ifx\SB at temp\SB at emptylist#2\else#3\fi%
@@ -7246,12 +7272,9 @@
% Otherwise some choruses could get auto-inserted multiple times at the same
% spot, possibly even leading to an infinite loop!
% \begin{macrocode}
-\newcommand\SB at cmark{}
-\def\SB at cmark{SB at cmark}
-\newcommand\SB at lastcmark{}
-\def\SB at lastcmark{SB at lastcmark}
-\newcommand\SB at nocmark{}
-\def\SB at nocmark{SB at nocmark}
+\newcommand*\SB at cmark{SB at cmark}
+\newcommand*\SB at lastcmark{SB at lastcmark}
+\newcommand*\SB at nocmark{SB at nocmark}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -8270,7 +8293,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\SB at trspace}
+% \begin{macro}{\SB at trskip}
% A space or end-brace lies next in the input stream.
% It has already been added to the token list, so skip over it.
% \begin{macrocode}
@@ -9072,8 +9095,7 @@
% whose definition is the non-breaking space definition normally assigned to
% |~|.
% \begin{macrocode}
-\newcommand\SB at nbsp{}
-\def\SB at nbsp{\nobreakspace{}}
+\newcommand*\SB at nbsp{\nobreakspace{}}
% \end{macrocode}
% \end{macro}
%
@@ -10198,7 +10220,9 @@
% a dot or nothing at all).
% \begin{macrocode}
\newcommand\SB at onfret[1]{%
- \rlap{\hbox to\SB at fretwidth{\hfil\vrule\@height6\p@\hfil}}%
+ \kern.5\SB at fretwidth\kern-.2\p@%
+ \vrule\@height6\p@%
+ \kern-.2\p@\kern-.5\SB at fretwidth%
\hbox to\SB at fretwidth{\hfil#1\hfil}%
}
% \end{macrocode}
@@ -10260,31 +10284,216 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\SB at doify}
+% \begin{macro}{\SB@@doify}
+% \begin{macro}{\SB at do}
+% Define the macro given in the first argument to equal the fully expanded
+% content of the second argument, but with |\SB at do| inserted before each token
+% or group.
+% \begin{macrocode}
+\newcommand\SB at do[1]{}
+\newcommand\SB at doify[2]{%
+ \SB at toks{}%
+ \edef#1{#2}%
+ \expandafter\SB@@doify#1\SB@@doify%
+ \edef#1{\the\SB at toks}%
+}
+\newcommand\SB@@doify[1]{%
+ \ifx#1\SB@@doify\else%
+ \SB at toks\expandafter{\the\SB at toks\SB at do{#1}}%
+ \expandafter\SB@@doify%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at allbarres}
+% \begin{macro}{\SB at dobarre}
+% Reserve a control sequence to remember all the stacks, start control
+% sequences, and end control sequences associated with barre delimiter pairs;
+% and a control sequence to perform an arbitrary action on them.
+% \begin{macrocode}
+\newcommand\SB at allbarres{}
+\newcommand\SB at dobarre{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at barreI}
+% \begin{macro}{\SB at barreN}
+% \begin{macro}{\SB at barreY}
+% As we process strings in order, barres in progress can be in one of three
+% states: initial (|\SB at barreI|), deactivated (|\SB at barreN|), or
+% tentatively activated (|\SB at barreY|).
+% \begin{macrocode}
+\newcommand\SB at barreI{\noexpand\SB at barreI}
+\newcommand\SB at barreN{\noexpand\SB at barreN}
+\newcommand\SB at barreY{\noexpand\SB at barreY}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at lowfret}
+% \begin{macro}{\SB@@lowfret}
+% If we see a lower numbered fret than the current fret within a barre,
+% deactivate the barre.
+% (It has already been shown on an earlier fret.)
+% \begin{macrocode}
+\newcommand\SB at lowfret{%
+ \let\SB at dobarre\SB@@lowfret\SB at allbarres%
+ \SB at fretempty%
+}
+\newcommand\SB@@lowfret[3]{{%
+ \let\SB at barreI\SB at barreN%
+ \let\SB at barreY\SB at barreN%
+ \xdef#1{#1}%
+}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at bactivate}
+% If we see the current fret within a barre, tentatively activate the barre
+% (unless it is already deactivated).
+% \begin{macrocode}
+\newcommand\SB at bactivate[3]{{%
+ \let\SB at barreI\SB at barreY%
+ \xdef#1{#1}%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB at bbarre}
+% Starting a barre group pushes it onto its stack in the initial state.
+% \begin{macrocode}
+\newcommand\SB at bbarre[1]{%
+ \xdef#1{\SB at barreI{\the\SB at cntii}#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB at ebarre}
+% \begin{macro}{\SB@@ebarre}
+% \begin{macro}{\SB@@@ebarre}
+% Ending a barre group pops it and draws it if it's active.
+% \begin{macrocode}
+\newcommand\SB at ebarre[3]{%
+ \ifx#1\@empty%
+ \ifnum\SB at cnt=\@ne\SB at errebar#2#3\fi%
+ \else%
+ \expandafter\SB@@ebarre#1\SB@@ebarre#1%
+ \fi%
+}
+\newcommand\SB@@ebarre{}
+\def\SB@@ebarre#1#2#3\SB@@ebarre#4{{%
+ \gdef#4{#3}%
+ \let\SB at barreI\@gobble%
+ \let\SB at barreN\@gobble%
+ \let\SB at barreY\SB at barre%
+ #1{#2}%
+}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at barreson}
+% \begin{macro}{\SB at barresoff}
+% Turn barre delimiters on or off, depending on whether we're typesetting
+% the interior or upper part of the tablature diagram.
+% \begin{macrocode}
+\newcommand\SB at barreson[3]{%
+ \def#2{\SB at bbarre#1}%
+ \def#3{\SB at ebarre#1#2#3}%
+}
+\newcommand\SB at barresoff[3]{\let#2\relax\let#3\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\SB at fretempty}
-% \begin{macro}{\SB at frethit}
+% \begin{macro}{\SB at fretdot}
+% \begin{macro}{\SB@@fretdot}
% On a string in a fret diagram there can be nothing or a filled circle.
% \begin{macrocode}
-\newcommand\SB at fretempty{\SB at onfret\relax}
-\newcommand\SB at frethit{\SB at onfret{%
- \hbox{%
+\newcommand\SB at fretempty{%
+ \advance\SB at cntii\@ne%
+ \SB at onfret\relax%
+}
+\newcommand\SB at fretdot{%
+ \advance\SB at cntii\@ne%
+ \let\SB at dobarre\SB at bactivate\SB at allbarres%
+ \SB@@fretdot%
+}
+\newcommand\SB@@fretdot{%
+ \SB at onfret{%
\fontencoding{OMS}\fontfamily{cmsy}%
\fontseries{m}\fontshape{n}%
\fontsize\@xiipt\@xiipt\selectfont\char15%
}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB at barre}
+% Draw a barre.
+% \begin{macrocode}
+\newcommand\SB at barre[1]{{%
+ \SB at dimen\SB at fretwidth%
+ \multiply\SB at dimen\SB at cntii%
+ \advance\SB at dimen-#1\SB at fretwidth%
+ \kern-\SB at dimen%
+ \SB@@fretdot%
+ \kern-.5\SB at fretwidth%
+ \advance\SB at dimen-\SB at fretwidth%
+ \raise.7pt\hbox{\vrule\@height4.6\p@\@width\SB at dimen}%
+ \kern-.5\SB at fretwidth%
+ \SB@@fretdot%
}}
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\SB at fretend}
+% At the end of a barred row in a tablature diagram, we auto-finish any
+% activated barres that weren't explicitly closed by the user.
+% \begin{macrocode}
+\newcommand\SB at fretend{{%
+ \let\SB at barreI\@gobble%
+ \let\SB at barreN\@gobble%
+ \let\SB at barreY\SB at barre%
+ \def\SB at dobarre##1##2##3{##1\gdef##1{}}\SB at allbarres%
+}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SB at finger}
+% \begin{macro}{\SB at X}
+% \begin{macro}{\SB at Z}
+% \begin{macro}{\SB at O}
% If we're including fingering info in the tablature diagram, then below
% each string there might be a number.
% \begin{macrocode}
+\newcommand*\SB at X{X}
+\newcommand*\SB at Z{0}
+\newcommand*\SB at O{O}
\newcommand\SB at finger[1]{%
- \SB at atopfret{\sffamily\fontsize\@vipt\@vipt\selectfont#1}%
+ \def\SB at temp{#1}%
+ \ifx\SB at temp\SB at X\SB at topempty\else%
+ \ifx\SB at temp\SB at Z\SB at topempty\else%
+ \ifx\SB at temp\SB at O\SB at topempty\else%
+ \SB at atopfret{\sffamily\fontsize\@vipt\@vipt\selectfont#1}%
+ \fi\fi\fi%
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\ifSB at gettabind}
% \begin{macro}{\SB at tabindent}
@@ -10328,77 +10537,45 @@
% We can then temporarily assign meanings to those control sequences and
% replay the arguments to achieve various effects.
%
-% \begin{macro}{\SB at csify}
-% \begin{macro}{\SB@@csify}
-% Convert all tokens in the first argument to control sequences and store
-% the resulting sequence into the macro given by the first argument.
-% Store the length in tokens into counter register |\SB at cnt|.
-% \begin{macrocode}
-\newcommand\SB at csify[2]{%
- \SB at toks{}%
- \SB at cnt\z@%
- \SB@@csify#2\SB@@csify%
- \edef#1{\the\SB at toks}%
-}
-\newcommand\SB@@csify[1]{%
- \ifx#1\SB@@csify\else%
- \advance\SB at cnt\@ne%
- \SB at toks\expandafter{\the\SB at toks\csname#1\endcsname}%
- \expandafter\SB@@csify%
- \fi%
-}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\SB at gttop}
% \begin{macro}{\SB at gtinit}
% \begin{macro}{\SB at gtinc}
-% \begin{macro}{\SB at gtset}
% Different meanings are assigned to digits, |X|'s, and |O|'s
-% depending on whether we are currently typesetting
-% the material overtop the diagram,
-% the interior of the diagram,
-% or the fingering numbers below the diagram.
-% These meanings are set by |\SB at gttop|, |\SB at gtinit| \&
-% |\SB at gtinc|, and |\SB at gtset|, respectively.
+% as we typeset each row of the interior of the diagram.
+% These meanings are set by |\SB at gtinit| and |\SB at gtinc|.
% \begin{macrocode}
-\newcommand\SB at gttop{%
- \let\X\SB at topX\let\0\SB at topO\let\O\0\let\1\SB at topempty%
- \let\2\1\let\3\1\let\4\1\let\5\1%
- \let\6\1\let\7\1\let\8\1\let\9\1%
-}
\newcommand\SB at gtinit{%
- \let\X\SB at fretempty\let\0\X\let\O\X\let\1\SB at frethit%
- \let\2\X\let\3\X\let\4\X\let\5\X%
- \let\6\X\let\7\X\let\8\X\let\9\X%
+ \def\SB at do##1{\csname##1\endcsname}%
+ \let\O\0%
+ \let\3\2\let\4\2\let\5\2\let\6\2%
+ \let\7\2\let\8\2\let\9\2%
}
\newcommand\SB at gtinc{%
+ \advance\SB at cnt\@ne%
\let\9\8\let\8\7\let\7\6\let\6\5\let\5\4%
- \let\4\3\let\3\2\let\2\1\let\1\0%
+ \let\4\3\let\3\2\let\2\1\let\1\SB at lowfret%
}
-\newcommand\SB at gtset[2]{%
- \let\X#1\let\0\X\let\O\X%
- \def\1{#21}\def\2{#22}\def\3{#23}%
- \def\4{#24}\def\5{#25}\def\6{#26}%
- \def\7{#27}\def\8{#28}\def\9{#29}%
-}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
-% \begin{macro}{\SB at gtmax}
-% To compute the height of the tablature diagram, we must identify the
-% maximum fret number in the \Meta{strings} argument.
-% This is accomplished by using the following macro in combination with
-% |\SB at gtset| above.
+% \begin{macro}{\BarreDelims}
+% \begin{macro}{\SB at bdelims}
+% Each pair of barre delimiters reserves a stack and augments the
+% initialization state to recognize those delimiters.
% \begin{macrocode}
-\newcommand\SB at gtmax[1]{\ifnum\SB at cnt<#1\SB at cnt#1\fi}
+\newcommand\BarreDelims[2]{%
+ \expandafter\SB at bdelims\csname SB at bs@#1#2\expandafter\endcsname%
+ \csname#1\expandafter\endcsname\csname#2\endcsname%
+}
+\newcommand\SB at bdelims[3]{%
+ \newcommand*#1{}%
+ \SB at app\def\SB at allbarres{\SB at dobarre#1#2#3}%
+}
+\BarreDelims()
+\BarreDelims[]
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\gtab}
% \begin{macro}{\SB at gtab}
@@ -10481,7 +10658,13 @@
\thinspace{\printchord{\transposehere{#1}\strut}}\thinspace%
}%
\setbox\SB at boxii\hbox{\SB at fretnum{\SB at targfret}}%
- \setbox\SB at boxiii\hbox{{\SB at gttop\SB at targstr}}%
+ \setbox\SB at boxiii\hbox{{%
+ \let\X\SB at topX\let\0\SB at topO%
+ \let\1\SB at topempty\let\2\1%
+ \SB at gtinit%
+ \let\SB at dobarre\SB at barresoff\SB at allbarres%
+ \SB at targstr%
+ }}%
\hsize\wd\SB at box%
\ifSB at gettabind%
\global\SB at tabindent\wd\SB at boxii%
@@ -10506,18 +10689,20 @@
\vtop{%
\SB at dimen\wd\SB at boxiii%
\box\SB at boxiii%
- \SB at cnt\minfrets%
- \SB at gtset\relax\SB at gtmax\SB at targstr%
+ \let\X\SB at fretempty\let\0\X%
+ \let\1\SB at fretdot\def\2{\SB at fretempty\global\SB at testtrue}%
\SB at gtinit%
+ \let\SB at dobarre\SB at barreson\SB at allbarres%
+ \SB at cnt\@ne%
\loop%
- \SB at fretbar\hbox{\SB at targstr}%
- \advance\SB at cnt\m at ne%
- \ifnum\SB at cnt>\z@\SB at gtinc\repeat%
+ \SB at testfalse%
+ \SB at fretbar\hbox{\SB at cntii\z@\SB at targstr\SB at fretend}%
+ \ifnum\SB at cnt<\minfrets\SB at testtrue\fi%
+ \ifSB at test\SB at gtinc\repeat%
\SB at fretbar%
\ifx\SB at targsfing\@empty\else%
\kern1.5\p@%
- \SB at gtset\SB at topempty\SB at finger%
- \hbox{\SB at targfing}%
+ \hbox{\let\SB at do\SB at finger\SB at targfing}%
\fi%
}%
\hfil%
@@ -10530,7 +10715,9 @@
% \end{macro}
%
% \begin{macro}{\SB at tabargs}
+% \begin{macro}{\SB@@tabargs}
% \begin{macro}{\SB at ctoken}
+% \changes{v3.1}{2017/06/23}{Allow macros within 2nd gtab arg}
% Break the second argument to a |\gtab| macro into three sub-arguments.
% The possible forms are:
% (a) \Meta{strings},
@@ -10539,8 +10726,8 @@
% (d) \Meta{fret}|:|\Meta{strings}|:|\Meta{fingering}.
% To distinguish forms (b) and (c), we count the number of tokens before
% the first colon.
-% If there is only one token, we assume it must be form (b), since frets
-% larger than 9 and 1-stringed instruments are both rare.
+% If there is only one token or group, we assume it must be form (b),
+% since frets larger than 9 and 1-stringed instruments are both rare.
% Otherwise we assume form (c).
% \begin{macrocode}
\newcommand\SB at ctoken{} \def\SB at ctoken{:}
@@ -10548,26 +10735,28 @@
\def\SB at tabargs#1:#2:#3:#4\SB at tabargs{%
\def\SB at temp{#4}%
\ifx\SB at temp\@empty%
- \SB at csify\SB at targstr{#1}%
+ \SB at doify\SB at targstr{#1}%
\else\ifx\SB at temp\SB at ctoken%
- \SB at csify\SB at targstr{#1}%
- \ifnum\SB at cnt>\@ne%
- \SB at cntii\SB at cnt%
- \SB at csify\SB at targfing{#2}%
- \SB at cnt\SB at cntii%
+ \SB@@tabargs#1\SB@@tabargs%
+ \ifx\SB at temp\@empty%
+ \def\SB at targfret{#1}%
+ \SB at doify\SB at targstr{#2}%
\else%
- \def\SB at targfret{#1}%
- \SB at csify\SB at targstr{#2}%
+ \SB at doify\SB at targfing{#2}%
+ \SB at doify\SB at targstr{#1}%
\fi%
\else%
\def\SB at targfret{#1}%
- \SB at csify\SB at targfing{#3}%
- \SB at csify\SB at targstr{#2}%
+ \SB at doify\SB at targfing{#3}%
+ \SB at doify\SB at targstr{#2}%
\fi\fi%
}
+\newcommand\SB@@tabargs{}
+\def\SB@@tabargs#1#2\SB@@tabargs{\def\SB at temp{#2}}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Book Sectioning}
%
@@ -12048,12 +12237,12 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\SB at errtab}
+% \begin{macro}{\SB at errebar}
% \begin{macrocode}
-\newcommand\SB at errtab{%
- \SB at 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 at errebar[2]{%
+ \SB at Error{Ignoring unbalanced \expandafter\@gobble\string#2 i%
+ n \protect\gtab}{Found no \expandafter\@gobble\string#1 to ma%
+ tch the \expandafter\@gobble\string#2.}%
}
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/source/latex/songs/songs.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/songs/songs.ins 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/source/latex/songs/songs.ins 2019-06-27 21:00:23 UTC (rev 51494)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2017 Kevin W. Hamlen
+%% Copyright (C) 2018 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
@@ -27,7 +27,7 @@
This is a generated file.
-Copyright (C) 2017 by Kevin W. Hamlen
+Copyright (C) 2018 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
Modified: trunk/Master/texmf-dist/tex/latex/songs/songs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/songs/songs.sty 2019-06-27 21:00:07 UTC (rev 51493)
+++ trunk/Master/texmf-dist/tex/latex/songs/songs.sty 2019-06-27 21:00:23 UTC (rev 51494)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2017 by Kevin W. Hamlen
+%% Copyright (C) 2018 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
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{songs}
- [2017/06/05 v3.0 Songs package]
+ [2018/09/12 v3.1 Songs package]
\newif\ifSB at etex
\ifx\eTeXversion\undefined\else
\ifx\eTeXversion\relax\else
@@ -33,13 +33,15 @@
\fi
\fi
\newif\ifSB at pdf\SB at pdffalse
-\ifx\pdfoutput\undefined\else
- \ifx\pdfoutput\relax\else
- \ifnum\pdfoutput<\@ne\else
- \SB at pdftrue
+\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\ifpdf\SB at pdftrue\fi}{
+ \ifx\pdfoutput\undefined\else
+ \ifx\pdfoutput\relax\else
+ \ifnum\pdfoutput<\@ne\else
+ \SB at pdftrue
+ \fi
\fi
\fi
-\fi
+}
\newif\ifSB at preamble
\SB at preambletrue
\newif\ifSB at test
@@ -638,14 +640,10 @@
\SB at styppage%
\endgroup%
}
-\newcommand\SB at songlistbrk{}
-\def\SB at songlistbrk{brk}
-\newcommand\SB at songlistnc{}
-\def\SB at songlistnc{nextcol}
-\newcommand\SB at songlistcp{}
-\def\SB at songlistcp{sclearpage}
-\newcommand\SB at songlistcdp{}
-\def\SB at songlistcdp{scleardpage}
+\newcommand*\SB at songlistbrk{brk}
+\newcommand*\SB at songlistnc{nextcol}
+\newcommand*\SB at songlistcp{sclearpage}
+\newcommand*\SB at songlistcdp{scleardpage}
\newcommand\commitsongs{%
\ifpartiallist%
\ifnum\SB at numcols>\z@%
@@ -760,8 +758,7 @@
\newcommand\SB at lop[1]{\expandafter\SB@@lop\the#1\SB@@lop#1}
\newcommand\SB@@lop{}
\def\SB@@lop\\#1\\#2\SB@@lop#3#4{\global#3{\\#2}\global#4{#1}}
-\newcommand\SB at emptylist{}
-\def\SB at emptylist{\\}
+\newcommand*\SB at emptylist{\\}
\newcommand\SB at ifempty[3]{%
\edef\SB at temp{\the#1}%
\ifx\SB at temp\SB at emptylist#2\else#3\fi%
@@ -1355,12 +1352,9 @@
\newmarks\SB at nocmarkclass
}
\fi
-\newcommand\SB at cmark{}
-\def\SB at cmark{SB at cmark}
-\newcommand\SB at lastcmark{}
-\def\SB at lastcmark{SB at lastcmark}
-\newcommand\SB at nocmark{}
-\def\SB at nocmark{SB at nocmark}
+\newcommand*\SB at cmark{SB at cmark}
+\newcommand*\SB at lastcmark{SB at lastcmark}
+\newcommand*\SB at nocmark{SB at nocmark}
\newenvironment{chorus}{\beginchorus}{\SB at endchorus}
\newcommand\beginchorus{%
\ifSB at insong
@@ -2265,8 +2259,7 @@
}
\newcommand\SB at endcname{}
\let\SB at endcname\endgroup
-\newcommand\SB at nbsp{}
-\def\SB at nbsp{\nobreakspace{}}
+\newcommand*\SB at nbsp{\nobreakspace{}}
\newif\ifSB at firstchord\SB at firstchordtrue
\newcommand*\SB@@chord{}
\def\SB@@chord#1]{%
@@ -2758,7 +2751,9 @@
\sffamily\fontsize\@xpt\@xpt\selectfont#1%
}}
\newcommand\SB at onfret[1]{%
- \rlap{\hbox to\SB at fretwidth{\hfil\vrule\@height6\p@\hfil}}%
+ \kern.5\SB at fretwidth\kern-.2\p@%
+ \vrule\@height6\p@%
+ \kern-.2\p@\kern-.5\SB at fretwidth%
\hbox to\SB at fretwidth{\hfil#1\hfil}%
}
\newcommand\SB at atopfret[1]{%
@@ -2793,16 +2788,104 @@
\fontsize\@xpt\@xpt\selectfont\char14%
}%
}}
-\newcommand\SB at fretempty{\SB at onfret\relax}
-\newcommand\SB at frethit{\SB at onfret{%
- \hbox{%
+\newcommand\SB at do[1]{}
+\newcommand\SB at doify[2]{%
+ \SB at toks{}%
+ \edef#1{#2}%
+ \expandafter\SB@@doify#1\SB@@doify%
+ \edef#1{\the\SB at toks}%
+}
+\newcommand\SB@@doify[1]{%
+ \ifx#1\SB@@doify\else%
+ \SB at toks\expandafter{\the\SB at toks\SB at do{#1}}%
+ \expandafter\SB@@doify%
+ \fi%
+}
+\newcommand\SB at allbarres{}
+\newcommand\SB at dobarre{}
+\newcommand\SB at barreI{\noexpand\SB at barreI}
+\newcommand\SB at barreN{\noexpand\SB at barreN}
+\newcommand\SB at barreY{\noexpand\SB at barreY}
+\newcommand\SB at lowfret{%
+ \let\SB at dobarre\SB@@lowfret\SB at allbarres%
+ \SB at fretempty%
+}
+\newcommand\SB@@lowfret[3]{{%
+ \let\SB at barreI\SB at barreN%
+ \let\SB at barreY\SB at barreN%
+ \xdef#1{#1}%
+}}
+\newcommand\SB at bactivate[3]{{%
+ \let\SB at barreI\SB at barreY%
+ \xdef#1{#1}%
+}}
+\newcommand\SB at bbarre[1]{%
+ \xdef#1{\SB at barreI{\the\SB at cntii}#1}%
+}
+\newcommand\SB at ebarre[3]{%
+ \ifx#1\@empty%
+ \ifnum\SB at cnt=\@ne\SB at errebar#2#3\fi%
+ \else%
+ \expandafter\SB@@ebarre#1\SB@@ebarre#1%
+ \fi%
+}
+\newcommand\SB@@ebarre{}
+\def\SB@@ebarre#1#2#3\SB@@ebarre#4{{%
+ \gdef#4{#3}%
+ \let\SB at barreI\@gobble%
+ \let\SB at barreN\@gobble%
+ \let\SB at barreY\SB at barre%
+ #1{#2}%
+}}
+\newcommand\SB at barreson[3]{%
+ \def#2{\SB at bbarre#1}%
+ \def#3{\SB at ebarre#1#2#3}%
+}
+\newcommand\SB at barresoff[3]{\let#2\relax\let#3\relax}
+\newcommand\SB at fretempty{%
+ \advance\SB at cntii\@ne%
+ \SB at onfret\relax%
+}
+\newcommand\SB at fretdot{%
+ \advance\SB at cntii\@ne%
+ \let\SB at dobarre\SB at bactivate\SB at allbarres%
+ \SB@@fretdot%
+}
+\newcommand\SB@@fretdot{%
+ \SB at onfret{%
\fontencoding{OMS}\fontfamily{cmsy}%
\fontseries{m}\fontshape{n}%
\fontsize\@xiipt\@xiipt\selectfont\char15%
}%
+}
+\newcommand\SB at barre[1]{{%
+ \SB at dimen\SB at fretwidth%
+ \multiply\SB at dimen\SB at cntii%
+ \advance\SB at dimen-#1\SB at fretwidth%
+ \kern-\SB at dimen%
+ \SB@@fretdot%
+ \kern-.5\SB at fretwidth%
+ \advance\SB at dimen-\SB at fretwidth%
+ \raise.7pt\hbox{\vrule\@height4.6\p@\@width\SB at dimen}%
+ \kern-.5\SB at fretwidth%
+ \SB@@fretdot%
}}
+\newcommand\SB at fretend{{%
+ \let\SB at barreI\@gobble%
+ \let\SB at barreN\@gobble%
+ \let\SB at barreY\SB at barre%
+ \def\SB at dobarre##1##2##3{##1\gdef##1{}}\SB at allbarres%
+}}
+\newcommand*\SB at X{X}
+\newcommand*\SB at Z{0}
+\newcommand*\SB at O{O}
\newcommand\SB at finger[1]{%
- \SB at atopfret{\sffamily\fontsize\@vipt\@vipt\selectfont#1}%
+ \def\SB at temp{#1}%
+ \ifx\SB at temp\SB at X\SB at topempty\else%
+ \ifx\SB at temp\SB at Z\SB at topempty\else%
+ \ifx\SB at temp\SB at O\SB at topempty\else%
+ \SB at atopfret{\sffamily\fontsize\@vipt\@vipt\selectfont#1}%
+ \fi\fi\fi%
}
\newif\ifSB at gettabind\SB at gettabindfalse
\SB at newdimen\SB at tabindent
@@ -2809,40 +2892,27 @@
\newcommand\SB at targfret{}
\newcommand\SB at targstr{}
\newcommand\SB at targfing{}
-\newcommand\SB at csify[2]{%
- \SB at toks{}%
- \SB at cnt\z@%
- \SB@@csify#2\SB@@csify%
- \edef#1{\the\SB at toks}%
-}
-\newcommand\SB@@csify[1]{%
- \ifx#1\SB@@csify\else%
- \advance\SB at cnt\@ne%
- \SB at toks\expandafter{\the\SB at toks\csname#1\endcsname}%
- \expandafter\SB@@csify%
- \fi%
-}
-\newcommand\SB at gttop{%
- \let\X\SB at topX\let\0\SB at topO\let\O\0\let\1\SB at topempty%
- \let\2\1\let\3\1\let\4\1\let\5\1%
- \let\6\1\let\7\1\let\8\1\let\9\1%
-}
\newcommand\SB at gtinit{%
- \let\X\SB at fretempty\let\0\X\let\O\X\let\1\SB at frethit%
- \let\2\X\let\3\X\let\4\X\let\5\X%
- \let\6\X\let\7\X\let\8\X\let\9\X%
+ \def\SB at do##1{\csname##1\endcsname}%
+ \let\O\0%
+ \let\3\2\let\4\2\let\5\2\let\6\2%
+ \let\7\2\let\8\2\let\9\2%
}
\newcommand\SB at gtinc{%
+ \advance\SB at cnt\@ne%
\let\9\8\let\8\7\let\7\6\let\6\5\let\5\4%
- \let\4\3\let\3\2\let\2\1\let\1\0%
+ \let\4\3\let\3\2\let\2\1\let\1\SB at lowfret%
}
-\newcommand\SB at gtset[2]{%
- \let\X#1\let\0\X\let\O\X%
- \def\1{#21}\def\2{#22}\def\3{#23}%
- \def\4{#24}\def\5{#25}\def\6{#26}%
- \def\7{#27}\def\8{#28}\def\9{#29}%
+\newcommand\BarreDelims[2]{%
+ \expandafter\SB at bdelims\csname SB at bs@#1#2\expandafter\endcsname%
+ \csname#1\expandafter\endcsname\csname#2\endcsname%
}
-\newcommand\SB at gtmax[1]{\ifnum\SB at cnt<#1\SB at cnt#1\fi}
+\newcommand\SB at bdelims[3]{%
+ \newcommand*#1{}%
+ \SB at app\def\SB at allbarres{\SB at dobarre#1#2#3}%
+}
+\BarreDelims()
+\BarreDelims[]
\newcommand\gtab{\SB at begincname\SB at gtab}
\newcommand*\SB at gtab[1]{%
\SB at endcname%
@@ -2877,7 +2947,13 @@
\thinspace{\printchord{\transposehere{#1}\strut}}\thinspace%
}%
\setbox\SB at boxii\hbox{\SB at fretnum{\SB at targfret}}%
- \setbox\SB at boxiii\hbox{{\SB at gttop\SB at targstr}}%
+ \setbox\SB at boxiii\hbox{{%
+ \let\X\SB at topX\let\0\SB at topO%
+ \let\1\SB at topempty\let\2\1%
+ \SB at gtinit%
+ \let\SB at dobarre\SB at barresoff\SB at allbarres%
+ \SB at targstr%
+ }}%
\hsize\wd\SB at box%
\ifSB at gettabind%
\global\SB at tabindent\wd\SB at boxii%
@@ -2902,18 +2978,20 @@
\vtop{%
\SB at dimen\wd\SB at boxiii%
\box\SB at boxiii%
- \SB at cnt\minfrets%
- \SB at gtset\relax\SB at gtmax\SB at targstr%
+ \let\X\SB at fretempty\let\0\X%
+ \let\1\SB at fretdot\def\2{\SB at fretempty\global\SB at testtrue}%
\SB at gtinit%
+ \let\SB at dobarre\SB at barreson\SB at allbarres%
+ \SB at cnt\@ne%
\loop%
- \SB at fretbar\hbox{\SB at targstr}%
- \advance\SB at cnt\m at ne%
- \ifnum\SB at cnt>\z@\SB at gtinc\repeat%
+ \SB at testfalse%
+ \SB at fretbar\hbox{\SB at cntii\z@\SB at targstr\SB at fretend}%
+ \ifnum\SB at cnt<\minfrets\SB at testtrue\fi%
+ \ifSB at test\SB at gtinc\repeat%
\SB at fretbar%
\ifx\SB at targsfing\@empty\else%
\kern1.5\p@%
- \SB at gtset\SB at topempty\SB at finger%
- \hbox{\SB at targfing}%
+ \hbox{\let\SB at do\SB at finger\SB at targfing}%
\fi%
}%
\hfil%
@@ -2927,23 +3005,24 @@
\def\SB at tabargs#1:#2:#3:#4\SB at tabargs{%
\def\SB at temp{#4}%
\ifx\SB at temp\@empty%
- \SB at csify\SB at targstr{#1}%
+ \SB at doify\SB at targstr{#1}%
\else\ifx\SB at temp\SB at ctoken%
- \SB at csify\SB at targstr{#1}%
- \ifnum\SB at cnt>\@ne%
- \SB at cntii\SB at cnt%
- \SB at csify\SB at targfing{#2}%
- \SB at cnt\SB at cntii%
+ \SB@@tabargs#1\SB@@tabargs%
+ \ifx\SB at temp\@empty%
+ \def\SB at targfret{#1}%
+ \SB at doify\SB at targstr{#2}%
\else%
- \def\SB at targfret{#1}%
- \SB at csify\SB at targstr{#2}%
+ \SB at doify\SB at targfing{#2}%
+ \SB at doify\SB at targstr{#1}%
\fi%
\else%
\def\SB at targfret{#1}%
- \SB at csify\SB at targfing{#3}%
- \SB at csify\SB at targstr{#2}%
+ \SB at doify\SB at targfing{#3}%
+ \SB at doify\SB at targstr{#2}%
\fi\fi%
}
+\newcommand\SB@@tabargs{}
+\def\SB@@tabargs#1#2\SB@@tabargs{\def\SB at temp{#2}}
\newcommand\songchapter{%
\let\SB at temp\@seccntformat%
\def\@seccntformat##1{}%
@@ -3670,10 +3749,10 @@
d \protect\endverse, or between \protect\beginchorus\space%
and \protect\endchorus.}%
}
-\newcommand\SB at errtab{%
- \SB at 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 at errebar[2]{%
+ \SB at Error{Ignoring unbalanced \expandafter\@gobble\string#2 i%
+ n \protect\gtab}{Found no \expandafter\@gobble\string#1 to ma%
+ tch the \expandafter\@gobble\string#2.}%
}
\newcommand\SB at errnoidx[1]{%
\SB at Error{Unknown index identifier: #1}{This index identifie%
More information about the tex-live-commits
mailing list