From 7dbc4336e2fd76d490e360bfe786eeb737e52629 Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Sun, 19 Feb 2012 19:14:33 +0100 Subject: [PATCH] Add repeatchords option to the crepbook document class The repeatchords option enables chords printing in repeated chords section. The new repeatedchords environment is used by song authors to declare that chords enclosed in the environment are only the repeated version of the chords given earlier. This environment allows users who prefer to repeat chords on every verse and chorus to write them down, and in conjunction with the repeatchords option to have songbooks that displays the repeated chords. --- tex/crepbook.cls | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tex/crepbook.cls b/tex/crepbook.cls index 89fce4b1..33d3bb10 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -12,12 +12,14 @@ \newif{\ifnodiagram} \newif{\ifimportantdiagramonly} \newif{\ifpictures} +\newif{\ifnorepeatchords} \tabsfalse \lilypondfalse \nodiagramtrue \picturesfalse \importantdiagramonlyfalse +\norepeatchordstrue % Options \DeclareOption{tabs}{\tabstrue} @@ -29,6 +31,8 @@ \DeclareOption{importantdiagramonly}{\importantdiagramonlytrue\nodiagramfalse} \DeclareOption{pictures}{\picturestrue} \DeclareOption{nopictures}{\picturesfalse} +\DeclareOption{norepeatchords}{\norepeatchordstrue} +\DeclareOption{repeatchords}{\norepeatchordsfalse} \DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}} \DeclareOption{11pt}{\PassOptionsToClass{\CurrentOption}{article}} @@ -434,4 +438,24 @@ \end{verse*} } +%% \SB@chordsoff with a greater for the line spacing +\newcommand{\CB@chordshidden}{% + \def\SB@bracket##1]{\ignorespaces}% + \let\SB@rechord\relax% + \let\SB@ch\SB@ch@off% + \ifSB@measurespec% + \ifmeasures\SB@measureson\else\SB@measuresoff\fi% + \else% + \SB@measuresoff% + \fi% + \ifSB@preamble\let\colbotglue{\z@\@plus.5\textheight}\fi% + \SB@setbaselineskip% +} + +\newenvironment{repeatedchords}{% + \ifnorepeatchords% + \CB@chordshidden% + \fi +}{}% + \makeatother