texlive[45926] Master/texmf-dist: lyluatex (27nov17)

commits+karl at tug.org commits+karl at tug.org
Mon Nov 27 23:37:59 CET 2017


Revision: 45926
          http://tug.org/svn/texlive?view=revision&revision=45926
Author:   karl
Date:     2017-11-27 23:37:58 +0100 (Mon, 27 Nov 2017)
Log Message:
-----------
lyluatex (27nov17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/support/lyluatex/README.md
    trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.pdf
    trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.tex
    trunk/Master/texmf-dist/scripts/lyluatex/lyluatex.lua
    trunk/Master/texmf-dist/tex/latex/lyluatex/lyluatex.sty

Modified: trunk/Master/texmf-dist/doc/support/lyluatex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/lyluatex/README.md	2017-11-27 22:37:27 UTC (rev 45925)
+++ trunk/Master/texmf-dist/doc/support/lyluatex/README.md	2017-11-27 22:37:58 UTC (rev 45926)
@@ -14,7 +14,7 @@
 
 Thereafter, you can include a lilypond file with the command:
 
-    \includely[staffsize=17]{CHEMIN/VERS/LA/PARTITION}
+    \includely[staffsize=17]{PATH/TO/THE/FILE}
 
 The argument `staffsize`, which is optional, changes the size of the score.  You
 can change the size for all the subsequent scores in a document by placing the
@@ -36,13 +36,21 @@
 `-draftmode`, then compile again without this option.
 
 You can also input music directly into your docoment with the `ly` environment.
-This is only recommended for very short snippets.  For example:
+This is only recommended for relatively short snippets.  For example:
 
     \begin{ly}
     \relative c' { c d e f g a b c }
     \end{ly}
 
+Finally, for truly short snippets, there is also the `\lily` command.  Example:
 
+    \lily[staffsize=12]{c' d' g'}
+
+**Nota bene:** The `\lily` command *does not* support blocks of LilyPond code
+with explicit `\score` blocks.  Such code must be included with the `ly`
+environment or as a separate file.
+
+
 ## Migration from `lilypond-book`
 
 In order to facilitate the migration from `lilypond-book`, `lyluatex` defines

Modified: trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.tex	2017-11-27 22:37:27 UTC (rev 45925)
+++ trunk/Master/texmf-dist/doc/support/lyluatex/lyluatex.tex	2017-11-27 22:37:58 UTC (rev 45926)
@@ -77,7 +77,7 @@
 Thereafter, you can include a lilypond file with the command:
 
 \begin{verbatim}
-\includely[staffsize=17]{CHEMIN/VERS/LA/PARTITION}
+\includely[staffsize=17]{PATH/TO/THE/FILE}
 \end{verbatim}
 
 The argument \texttt{staffsize}, which is optional, changes the size of
@@ -109,7 +109,7 @@
 without this option.
 
 You can also input music directly into your docoment with the
-\texttt{ly} environment. This is only recommended for very short
+\texttt{ly} environment. This is only recommended for relatively short
 snippets. For example:
 
 \begin{verbatim}
@@ -118,6 +118,18 @@
 \end{ly}
 \end{verbatim}
 
+Finally, for truly short snippets, there is also the
+\texttt{\textbackslash{}lily} command. Example:
+
+\begin{verbatim}
+\lily[staffsize=12]{c' d' g'}
+\end{verbatim}
+
+\textbf{Nota bene:} The \texttt{\textbackslash{}lily} command \emph{does
+not} support blocks of LilyPond code with explicit
+\texttt{\textbackslash{}score} blocks. Such code must be included with
+the \texttt{ly} environment or as a separate file.
+
 \subsection{\texorpdfstring{Migration from
 \texttt{lilypond-book}}{Migration from lilypond-book}}\label{migration-from-lilypond-book}
 

Modified: trunk/Master/texmf-dist/scripts/lyluatex/lyluatex.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lyluatex/lyluatex.lua	2017-11-27 22:37:27 UTC (rev 45925)
+++ trunk/Master/texmf-dist/scripts/lyluatex/lyluatex.lua	2017-11-27 22:37:58 UTC (rev 45926)
@@ -2,7 +2,7 @@
     name               = "lyluatex",
     version            = '0',
     greinternalversion = internalversion,
-    date               = "2017/11/19",
+    date               = "2017/11/27",
     description        = "Module lyluatex.",
     author             = "The Gregorio Project (see CONTRIBUTORS.md)",
     copyright          = "2008-2017 - The Gregorio Project",
@@ -46,13 +46,13 @@
     ly = ly:gsub('\\par ', '\n'):gsub('\\([^%s]*) %-([^%s])', '\\%1-%2')
     local sortie = TMP..'/'..string.gsub(md5.sumhexa(contenuIntegral(ly))..'-'..facteur..'-'..largeur, '%.', '-')
     if not lfs.isfile(sortie..'-systems.tex') then
-        compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie)
+        compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie, true)
     end
     retour_tex(sortie)
 end
 
 
-function inclure_ly(entree, currfiledir, largeur, facteur)
+function inclure_ly(entree, currfiledir, largeur, facteur, pleinepage)
     facteur = calcul_facteur(facteur)
     nom = splitext(entree, 'ly')
     entree = currfiledir..nom..'.ly'
@@ -61,21 +61,29 @@
     local i = io.open(entree, 'r')
     ly = i:read('*a')
     i:close()
-    local sortie = TMP..'/' ..string.gsub(md5.sumhexa(contenuIntegral(ly))..'-'..facteur..'-'..largeur, '%.', '-')
+    local sortie = TMP..'/' ..string.gsub(md5.sumhexa(contenuIntegral(ly))..'-'..facteur..'-'..largeur..'-', '%.', '-')
+    if pleinepage then sortie = sortie..'-pleinepage' end
     if not lfs.isfile(sortie..'-systems.tex') then
-        compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie, dirname(entree))
+        if pleinepage then
+            compiler_ly(ly, sortie, false, dirname(entree))
+            i = io.open(sortie..'-systems.tex', 'w')
+            i:write('\\includepdf[pages=-]{'..sortie..'}')
+            i:close()
+        else
+            compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie, true, dirname(entree))
+        end
     end
     retour_tex(sortie)
 end
 
 
-function compiler_ly(ly, sortie, include)
+function compiler_ly(ly, sortie, eps, include)
     mkdirs(dirname(sortie))
     local commande = LILYPOND.." "..
         "-dno-point-and-click "..
-        "-dbackend=eps "..
         "-djob-count=2 "..
         "-ddelete-intermediate-files "
+    if eps then commande = commande.."-dbackend=eps " end
     if include then commande = commande.."-I '"..lfs.currentdir().."/"..include.."' " end
     commande = commande.."-o "..sortie.." -"
     local p = io.popen(commande, 'w')

Modified: trunk/Master/texmf-dist/tex/latex/lyluatex/lyluatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lyluatex/lyluatex.sty	2017-11-27 22:37:27 UTC (rev 45925)
+++ trunk/Master/texmf-dist/tex/latex/lyluatex/lyluatex.sty	2017-11-27 22:37:58 UTC (rev 45926)
@@ -8,6 +8,7 @@
 \RequirePackage{keycommand}
 \RequirePackage{environ}
 \RequirePackage{currfile}
+\RequirePackage{pdfpages}
 % Options
 \DeclareStringOption[lilypond]{program}[lilypond]
 \ProcessKeyvalOptions*
@@ -28,13 +29,14 @@
 
 % Commandes principales
 % Inclusion d'un fichier ly
-\newkeycommand*\includely[staffsize=\staffsize][autres][1]{%
+\newkeycommand*\includely[staffsize=\staffsize,fullpage=false][autres][1]{%
 \directlua{%
     inclure_ly(
         "\luatexluaescapestring{#1}",
         "\luatexluaescapestring{\currfiledir}",
         \luatexluaescapestring{\largeur},
-        \luatexluaescapestring{\commandkey{staffsize}}
+        \luatexluaescapestring{\commandkey{staffsize}},
+        \commandkey{fullpage}
     )%
 }%
 }



More information about the tex-live-commits mailing list