From 30a42c1f0f7b7df9659d026eb6d85468fc7fe539 Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Fri, 13 Apr 2012 19:50:20 +0200 Subject: [PATCH] add option for one song per page --- templates/ancient.tmpl | 2 +- templates/minimal.tmpl | 13 ++++--------- templates/patacrep-en.tmpl | 2 +- templates/patacrep.tmpl | 2 +- tex/crepbook.cls | 19 +++++++++++++++++++ 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/templates/ancient.tmpl b/templates/ancient.tmpl index 28b6b979..f43646d8 100644 --- a/templates/ancient.tmpl +++ b/templates/ancient.tmpl @@ -30,7 +30,7 @@ %%: {"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":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, %%: {"name":"version", "description":"Version", "default":"3.5.5"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, diff --git a/templates/minimal.tmpl b/templates/minimal.tmpl index 8da8944e..11ed5b16 100644 --- a/templates/minimal.tmpl +++ b/templates/minimal.tmpl @@ -28,7 +28,7 @@ %%: {"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":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["pictures"]}, %%: {"name":"mainfontsize", "description":"Font Size", "type":"font", "default":"10"} %%:] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -40,19 +40,14 @@ \usepackage[portuguese,spanish,english,french]{babel} \lang{\getlang} - -\newindex{titleidx}{\getname_title} -\newauthorindex{authidx}{\getname_auth} - \graphicspath{ {covers/}, {img/} } -%hide song number -\renewcommand{\printsongnum}[1]{} -\setlength{\songnumwidth}{0.1cm} +\nosongnumbers +\pagestyle{empty} \begin{document} -\begin{songs}{titleidx,authidx} +\begin{songs}{} \getsongslist \end{songs} diff --git a/templates/patacrep-en.tmpl b/templates/patacrep-en.tmpl index 56df8fba..0bad9c81 100644 --- a/templates/patacrep-en.tmpl +++ b/templates/patacrep-en.tmpl @@ -30,7 +30,7 @@ %%: {"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":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, %%: {"name":"version", "description":"Version", "default":"3.5.5"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, diff --git a/templates/patacrep.tmpl b/templates/patacrep.tmpl index 7b820505..a98a3a96 100644 --- a/templates/patacrep.tmpl +++ b/templates/patacrep.tmpl @@ -30,7 +30,7 @@ %%: {"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":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, %%: {"name":"version", "description":"Version", "default":"3.5.5"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, diff --git a/tex/crepbook.cls b/tex/crepbook.cls index ab820be9..be5fc699 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -15,6 +15,7 @@ \newif{\ifnorepeatchords} \newif{\ifukulele} \newif{\ifguitar} +\newif{\ifonesongperpage} \tabsfalse \lilypondfalse @@ -24,6 +25,7 @@ \norepeatchordstrue \ukulelefalse \guitarfalse +\onesongperpagefalse % Options \DeclareOption{tabs}{\tabstrue} @@ -41,6 +43,7 @@ \DeclareOption{noukulele}{\ukulelefalse} \DeclareOption{guitar}{\guitartrue} \DeclareOption{noguitar}{\guitarfalse} +\DeclareOption{onesongperpage}{\onesongperpagetrue} \DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}} \DeclareOption{11pt}{\PassOptionsToClass{\CurrentOption}{article}} @@ -503,4 +506,20 @@ \fi }{}% +\ifonesongperpage% + \renewcommand\songcolumns[1]{% + \SB@cnt#1\relax% + \ifSB@preamble\else{\SB@clearpage}\fi% + \SB@numcols\SB@cnt% + \ifnum\SB@numcols>\z@% + \SB@colwidth-\columnsep% + \multiply\SB@colwidth\SB@numcols% + \advance\SB@colwidth\columnsep% + \advance\SB@colwidth\textwidth% + \divide\SB@colwidth\SB@numcols% + \else% + \ifrepchorus\SB@warnrc\fi% + \fi% + } +\fi \makeatother