From 167817cf4f606dcd015f05fbf204c3c454f5f42b Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Sun, 19 Feb 2012 17:53:12 +0100 Subject: [PATCH] Add importantdiagramonly option to the crepbook document class The importonlydiagramonly option allows to print only chord diagrams that have been flagged as important by the author of the song. The important chords are generally complicated uncommon chords and their diagram is registered with the starred version of the gtab macro. --- tex/crepbook.cls | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tex/crepbook.cls b/tex/crepbook.cls index 98b3d00e..6a1ffa0a 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -10,12 +10,14 @@ \newif{\iftabs} \newif{\iflilypond} \newif{\ifnodiagram} +\newif{\ifimportantdiagramonly} \newif{\ifpictures} \tabsfalse \lilypondfalse \nodiagramtrue \picturesfalse +\importantdiagramonlyfalse % Options \DeclareOption{tabs}{\tabstrue} @@ -24,6 +26,7 @@ \DeclareOption{nolilypond}{\lilypondfalse} \DeclareOption{nodiagram}{\nodiagramtrue} \DeclareOption{diagram}{\nodiagramfalse} +\DeclareOption{importantdiagramonly}{\importantdiagramonlytrue\nodiagramfalse} \DeclareOption{pictures}{\picturestrue} \DeclareOption{nopictures}{\picturesfalse} @@ -217,8 +220,25 @@ \fi% }% +\let\gtab@Original\gtab +\newcommand{\gtab@Hidden}[2]{}% \ifnodiagram% - \renewcommand{\gtab}[2]{}% +\renewcommand{\gtab}{\@ifstar + \gtab@Hidden% + \gtab@Hidden% +} +\else% +\ifimportantdiagramonly% +\renewcommand{\gtab}{\@ifstar + \gtab@Original% + \gtab@Hidden% +} +\else% +\renewcommand{\gtab}{\@ifstar + \gtab@Original% + \gtab@Original% +} +\fi% \fi% \newcommand{\lilypond}[1]{%