Browse Source

support a new instrument category for crepbook class

instrument may be guitar or ukulele
a new macro \utab, similar to \gtab may is also introduced
this macro can be used in sg files to indicate ukulele diagrams
remotes/kaosun/Kaosun
Romain Goffe 13 years ago
parent
commit
c2e97faaa4
  1. 3
      templates/ancient.tmpl
  2. 3
      templates/minimal.tmpl
  3. 3
      templates/patacrep-en.tmpl
  4. 3
      templates/patacrep.tmpl
  5. 41
      tex/crepbook.cls

3
templates/ancient.tmpl

@ -29,6 +29,7 @@
%%: {"name":"author", "description":"Author", "default":"Crep (R. Goffe) \\and Lohrun (A. Dupas)", "mandatory":true},
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"lang", "description":"Language", "default":"english"},
%%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","pictures","tabs"], "join":",", "mandatory":true, "default":["diagram","pictures"]},
%%: {"name":"version", "description":"Version", "default":"3.5.3"},
%%: {"name":"subtitle", "description":"Subtitle"},
@ -45,7 +46,7 @@
%%:]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begin document
\documentclass[\getbooktype,\getbookoptions,\getmainfontsize]{tex/crepbook}
\documentclass[\getbooktype,\getinstruments,\getbookoptions,\getmainfontsize]{tex/crepbook}
\usepackage[utf8]{inputenc}
\usepackage[portuguese,english,spanish,french]{babel}
\usepackage[T1]{fontenc}

3
templates/minimal.tmpl

@ -27,12 +27,13 @@
%%:[
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"lang", "description":"Language", "default":"english"},
%%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","tabs","pictures"], "join":",", "mandatory":true, "default":["pictures"]},
%%: {"name":"mainfontsize", "description":"Font Size", "type":"font", "default":"10"}
%%:]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begin document
\documentclass[\getbooktype,\getbookoptions,\getmainfontsize,noshading]{tex/crepbook}
\documentclass[\getbooktype,\getinstruments,\getbookoptions,\getmainfontsize,noshading]{tex/crepbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

3
templates/patacrep-en.tmpl

@ -29,6 +29,7 @@
%%: {"name":"author", "description":"Author", "default":"Crep (R. Goffe) \\and Lohrun (A. Dupas)", "mandatory":true},
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"lang", "description":"Language", "default":"english"},
%%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","pictures","tabs"], "join":",", "mandatory":true, "default":["diagram","pictures"]},
%%: {"name":"version", "description":"Version", "default":"3.5.3"},
%%: {"name":"subtitle", "description":"Subtitle"},
@ -45,7 +46,7 @@
%%:]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begin document
\documentclass[\getbooktype,\getbookoptions,\getmainfontsize]{tex/crepbook}
\documentclass[\getbooktype,\getinstruments,\getbookoptions,\getmainfontsize]{tex/crepbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

3
templates/patacrep.tmpl

@ -29,6 +29,7 @@
%%: {"name":"author", "description":"Author", "default":"Crep (R. Goffe) \\and Lohrun (A. Dupas)", "mandatory":true},
%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true},
%%: {"name":"lang", "description":"Language", "default":"french"},
%%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]},
%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords"], "join":",", "mandatory":true, "default":["diagram","pictures"]},
%%: {"name":"version", "description":"Version", "default":"3.5.3"},
%%: {"name":"subtitle", "description":"Subtitle"},
@ -45,7 +46,7 @@
%%:]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begin document
\documentclass[\getbooktype,\getbookoptions,\getmainfontsize]{tex/crepbook}
\documentclass[\getbooktype,\getinstruments,\getbookoptions,\getmainfontsize]{tex/crepbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

41
tex/crepbook.cls

@ -13,6 +13,8 @@
\newif{\ifimportantdiagramonly}
\newif{\ifpictures}
\newif{\ifnorepeatchords}
\newif{\ifukulele}
\newif{\ifguitar}
\tabsfalse
\lilypondfalse
@ -20,6 +22,8 @@
\picturesfalse
\importantdiagramonlyfalse
\norepeatchordstrue
\ukulelefalse
\guitarfalse
% Options
\DeclareOption{tabs}{\tabstrue}
@ -33,6 +37,10 @@
\DeclareOption{nopictures}{\picturesfalse}
\DeclareOption{norepeatchords}{\norepeatchordstrue}
\DeclareOption{repeatchords}{\norepeatchordsfalse}
\DeclareOption{ukulele}{\ukuleletrue}
\DeclareOption{noukulele}{\ukulelefalse}
\DeclareOption{guitar}{\guitartrue}
\DeclareOption{noguitar}{\guitarfalse}
\DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption{11pt}{\PassOptionsToClass{\CurrentOption}{article}}
@ -224,25 +232,58 @@
\fi%
}%
\let\utab\gtab
\let\utab@Original\utab
\newcommand{\utab@Hidden}[2]{}%
\let\gtab@Original\gtab
\newcommand{\gtab@Hidden}[2]{}%
\ifnodiagram%
\renewcommand{\gtab}{\@ifstar
\gtab@Hidden%
\gtab@Hidden%
}
\renewcommand{\utab}{\@ifstar
\utab@Hidden%
\utab@Hidden%
}
\else%
\ifimportantdiagramonly%
\renewcommand{\gtab}{\@ifstar
\gtab@Original%
\gtab@Hidden%
}
\renewcommand{\utab}{\@ifstar
\utab@Original%
\utab@Hidden%
}
\else%
\renewcommand{\gtab}{\@ifstar
\gtab@Original%
\gtab@Original%
}
\renewcommand{\utab}{\@ifstar
\utab@Original%
\utab@Original%
}
\fi%
\fi%
\ifguitar%
\else
\renewcommand{\gtab}{\@ifstar
\gtab@Hidden%
\gtab@Hidden%
}
\fi%
\ifukulele%
\else
\renewcommand{\utab}{\@ifstar
\utab@Hidden%
\utab@Hidden%
}
\fi%
\newcommand{\lilypond}[1]{%

Loading…
Cancel
Save