summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-29 20:00:15 +0000
committerKarl Berry <karl@freefriends.org>2023-03-29 20:00:15 +0000
commit9fa41d1fc8f435a890f121050e2920d593b9dfff (patch)
tree39a033bfc90c52a768050d474ce2d2907a9f4783 /Master/texmf-dist/tex
parenta995526c1114d8fef2fe8b1f065e7a4a06750908 (diff)
songproj (28mar23)
git-svn-id: svn://tug.org/texlive/trunk@66704 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/songproj/songproj.sty23
1 files changed, 17 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/songproj/songproj.sty b/Master/texmf-dist/tex/latex/songproj/songproj.sty
index adbaefcb695..7f6d2bd733b 100644
--- a/Master/texmf-dist/tex/latex/songproj/songproj.sty
+++ b/Master/texmf-dist/tex/latex/songproj/songproj.sty
@@ -36,7 +36,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesPackage{songproj}
- [2022/11/07 v1.0.1 Song projection]
+ [2023/03/29 v1.2.0 Song projection]
\RequirePackage{expl3}
\RequirePackage{xparse}
\RequirePackage{verse}
@@ -45,6 +45,7 @@
\bool_new:N \g__sp_song_start_bool % are we at the start of a song?
\bool_new:N \g__sp_refrain_first_bool % does current song start with the
% refrain?
+\bool_new:N \g__sp_show_numbers_bool % should we show the couplet numbers?
\int_new:N \g__sp_stanzas_per_slide_int % number of stanzas to show on each
% slide (1 or 2)
\dim_new:N \g__sp_linewidth_dim % length of the longest line in current
@@ -99,6 +100,9 @@
\dim_compare:nNnTF \g__sp_linewidth_dim {=} {0pt}
{ \begin{__sp_couplet} }
{ \begin{__sp_couplet} [\g__sp_linewidth_dim] }
+ \bool_if:NTF \g__sp_show_numbers_bool
+ { \flagverse{#1.} }
+ {}
\seq_item:Nn \g__sp_couplets_seq {#1}
\end{__sp_couplet}
}
@@ -289,6 +293,8 @@
}
{}
\NewDocumentCommand {\longest} { m } { \settowidth {\g__sp_linewidth_dim} {#1} }
+ \NewDocumentCommand {\numbercouplets}{}
+ { \bool_gset_true:N \g__sp_show_numbers_bool }
\NewDocumentEnvironment {song} { m o }
% {number of stanzas per slide (1 or 2)}
% [list of couplets to include (defaults to all)]
@@ -309,6 +315,9 @@
% Indicate that we are in a song, and at its start
\bool_gset_true:N \g__sp_song_bool
\bool_gset_true:N \g__sp_song_start_bool
+
+ % Couplets should not be numbered by default
+ \bool_gset_false:N \g__sp_show_numbers_bool
}
{
% Have we been given indexes of specific couplets to use?
@@ -407,12 +416,14 @@
% Indicate that we are no longer in a song
\bool_gset_false:N\g__sp_song_bool
}
-\NewDocumentCommand {\inputsong} { m m o }
+\NewDocumentCommand {\inputsong} { s m m o }
{
- \IfNoValueTF {#3}
- { \begin{song} {#2} }
- { \begin{song} {#2} [#3] }
- \input{#1}
+ \IfNoValueTF {#4}
+ { \begin{song} {#3} }
+ { \begin{song} {#3} [#4] }
+ \IfBooleanT {#1}
+ { \numbercouplets }
+ \input{#2}
\end{song}
}
\ExplSyntaxOff