summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-07-28 21:21:53 +0000
committerKarl Berry <karl@freefriends.org>2015-07-28 21:21:53 +0000
commit2a6ba6d868071a3d636d8e91f87240934ad24251 (patch)
tree1f5acc77bd40a26006cd79a93d4209706b0ec4c8 /Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex
parent5e812c6d831079dbfd90dfd395d90abbd8ed9464 (diff)
leadsheets (28jul15)
git-svn-id: svn://tug.org/texlive/trunk@37982 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex45
1 files changed, 28 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex
index a495369a56e..79d235f66aa 100644
--- a/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex
+++ b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.songs.code.tex
@@ -1,4 +1,4 @@
-\LeadsheetsExplLibrary{songs}{2015/07/02 typesetting songs}
+\LeadsheetsExplLibrary{songs}{2015/07/27 typesetting songs}
% --------------------------------------------------------------------------
% messages:
@@ -39,6 +39,9 @@
\tl_new:N \l__leadsheets_capo_number_format_tl
\tl_new:N \l__leadsheets_recall_verse_type_tl
\tl_new:N \l__leadsheets_song_body_tl
+\tl_new:N \l__leadsheets_song_pre_hook_tl
+\tl_new:N \l__leadsheets_song_post_hook_tl
+\tl_new:N \l__leadsheets_song_mid_hook_tl
\bool_new:N \l__leadsheets_print_selected_bool
\bool_new:N \l__leadsheets_transpose_bool
@@ -247,7 +250,7 @@
}
% --------------------------------------------------------------------------
-\cs_new:Npn \leadsheets_print_song:nwn #1#2\end#3
+\cs_new_protected:Npn \leadsheets_print_song:nwn #1#2\end#3
{
\tl_clear:N \l__leadsheets_song_body_tl
\leadsheets_if_print_song:nT {#1}
@@ -258,27 +261,24 @@
\leadsheets_songtitle:
\leadsheets_check_capo:
\tl_use:N \l__leadsheets_songtext_format_tl
- #2
}
+ \tl_put_right:NV \l__leadsheets_song_body_tl
+ \l__leadsheets_song_mid_hook_tl
+ \tl_put_right:Nn \l__leadsheets_song_body_tl {#2}
}
- \tl_if_eq:nnTF {#3} {song}
- {
- \leadsheets_if_print_song:nT {#1}
- { \leadsheets_end_song:n {#1} }
- \group_end:
- \end{song}
- }
- {
- \tl_put_right:Nn \l__leadsheets_song_body_tl { \end{#3} }
- \__leadsheets_continue_song:nwn {#1}
- }
+ \__leadsheets_continue_or_end_song:nn {#1} {#3}
}
\cs_new:Npn \__leadsheets_continue_song:nwn #1#2\end#3
{
\leadsheets_if_print_song:nT {#1}
{ \tl_put_right:Nn \l__leadsheets_song_body_tl {#2} }
- \tl_if_eq:nnTF {#3} {song}
+ \__leadsheets_continue_or_end_song:nn {#1} {#3}
+ }
+
+\cs_new_protected:Npn \__leadsheets_continue_or_end_song:nn #1#2
+ {
+ \tl_if_eq:nnTF {#2} {song}
{
\leadsheets_if_print_song:nT {#1}
{ \leadsheets_end_song:n {#1} }
@@ -286,7 +286,7 @@
\end{song}
}
{
- \tl_put_right:Nn \l__leadsheets_song_body_tl { \end{#3} }
+ \tl_put_right:Nn \l__leadsheets_song_body_tl { \end{#2} }
\__leadsheets_continue_song:nwn {#1}
}
}
@@ -295,6 +295,10 @@
{
\bool_set_true:N \l__leadsheets_measuring_bool
\leadsheets_reset_counters:
+ \tl_put_left:NV \l__leadsheets_song_body_tl
+ \l__leadsheets_song_pre_hook_tl
+ \tl_put_right:NV \l__leadsheets_song_body_tl
+ \l__leadsheets_song_post_hook_tl
\box_clear:N \l__leadsheets_tmpa_box
\vbox_set:NV \l__leadsheets_tmpa_box \l__leadsheets_song_body_tl
\leadsheets_set_property:nnx {#1} {height}
@@ -655,10 +659,17 @@
capo-nr-format .initial:n = {Roman} ,
capo-nr .code:n =
\cs_set_protected:Npn \leadsheets_capo_number_print:n ##1 {#1} ,
- capo-nr .initial:n = #1.
+ capo-nr .initial:n = #1. ,
+ before-song .tl_set:N = \l__leadsheets_song_pre_hook_tl ,
+ after-song .tl_set:N = \l__leadsheets_song_post_hook_tl ,
+ after-title .tl_set:N = \l__leadsheets_song_mid_hook_tl ,
+ add-to-reset .code:n =
+ \clist_map_inline:nn {#1} { \leadsheets_add_to_reset:n {##1} }
}
\endinput
2015/05/22: \l__leadsheets_chords_sequences_prop changed into global
2015/07/02: added `class' option to verses
2015/07/05: enable usage of # in the key property
+2015/07/27: new options `before-song', `after-song', `after-title' and
+ `add-to-reset'