Browse Source

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.
remotes/origin/split-songs
Alexandre Dupas 13 years ago
committed by Romain Goffe
parent
commit
be42408e2a
  1. 22
      tex/crepbook.cls

22
tex/crepbook.cls

@ -10,12 +10,14 @@
\newif{\iftabs} \newif{\iftabs}
\newif{\iflilypond} \newif{\iflilypond}
\newif{\ifnodiagram} \newif{\ifnodiagram}
\newif{\ifimportantdiagramonly}
\newif{\ifpictures} \newif{\ifpictures}
\tabsfalse \tabsfalse
\lilypondfalse \lilypondfalse
\nodiagramtrue \nodiagramtrue
\picturesfalse \picturesfalse
\importantdiagramonlyfalse
% Options % Options
\DeclareOption{tabs}{\tabstrue} \DeclareOption{tabs}{\tabstrue}
@ -24,6 +26,7 @@
\DeclareOption{nolilypond}{\lilypondfalse} \DeclareOption{nolilypond}{\lilypondfalse}
\DeclareOption{nodiagram}{\nodiagramtrue} \DeclareOption{nodiagram}{\nodiagramtrue}
\DeclareOption{diagram}{\nodiagramfalse} \DeclareOption{diagram}{\nodiagramfalse}
\DeclareOption{importantdiagramonly}{\importantdiagramonlytrue\nodiagramfalse}
\DeclareOption{pictures}{\picturestrue} \DeclareOption{pictures}{\picturestrue}
\DeclareOption{nopictures}{\picturesfalse} \DeclareOption{nopictures}{\picturesfalse}
@ -217,8 +220,25 @@
\fi% \fi%
}% }%
\let\gtab@Original\gtab
\newcommand{\gtab@Hidden}[2]{}%
\ifnodiagram% \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% \fi%
\newcommand{\lilypond}[1]{% \newcommand{\lilypond}[1]{%

Loading…
Cancel
Save