From 522b0ed0d1d887765fe0f0f9f7e4fbb6f3f26199 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Sat, 27 Feb 2016 10:59:51 +0100 Subject: [PATCH] Override songs enviroonment to prevent number reset --- patacrep/data/latex/patacrep.sty | 17 +++++++++++++++++ patacrep/data/latex/songs.sty | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/patacrep/data/latex/patacrep.sty b/patacrep/data/latex/patacrep.sty index 3dc6c7bf..5ed071c2 100644 --- a/patacrep/data/latex/patacrep.sty +++ b/patacrep/data/latex/patacrep.sty @@ -443,4 +443,21 @@ \def\@void[#1]{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Prevent numbering reset on new 'songs' environment +\newcounter{tempsongnum} + +\let\oldsongs\songs +\let\endoldsongs\endsongs + +\renewenvironment{songs}[1]{% + \setcounter{tempsongnum}{\thesongnum}% + \oldsongs{#1}% + \setcounter{songnum}{\thetempsongnum}% +}{% + \endoldsongs\ignorespacesafterend% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \endinput diff --git a/patacrep/data/latex/songs.sty b/patacrep/data/latex/songs.sty index c41f1bfb..4773d47c 100644 --- a/patacrep/data/latex/songs.sty +++ b/patacrep/data/latex/songs.sty @@ -2957,7 +2957,7 @@ \gdef\SB@indexlist{#1}% \SB@chkidxlst% \stepcounter{SB@songsnum}% - %\setcounter{songnum}{1}% + \setcounter{songnum}{1}% \let\SB@sgroup\@empty% \ifinner\else\ifdim\pagetotal>\z@% \null\nointerlineskip%