From 71b916c0313fe8587d33671598c79cdc1931a6b1 Mon Sep 17 00:00:00 2001 From: Jacques Peron Date: Thu, 28 May 2015 11:13:09 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20option=20pour=20d=C3=A9finir=20?= =?UTF-8?q?le=20chemin=20vers=20lilypond=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Il peut s'agir d'un chemin absolu ou d'un exécutable du PATH. --- lyluatex.lua | 3 ++- lyluatex.sty | 5 +++++ test.tex | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lyluatex.lua b/lyluatex.lua index fcf181d..ec72052 100644 --- a/lyluatex.lua +++ b/lyluatex.lua @@ -10,6 +10,7 @@ local err, warn, info, log = luatexbase.provides_module({ }) +LILYPOND = 'lilypond' TMP = 'tmp_ly' N = 0 @@ -43,7 +44,7 @@ end function compiler_ly(ly, sortie) mkdirs(dirname(sortie)) local p = io.popen( - "lilypond " + LILYPOND.." " .."-dno-point-and-click " .."-dbackend=eps " .."-djob-count=2 " diff --git a/lyluatex.sty b/lyluatex.sty index dd9fc41..9144158 100644 --- a/lyluatex.sty +++ b/lyluatex.sty @@ -1,11 +1,16 @@ \ProvidesPackage{lyluatex} % Dépendances +\RequirePackage{kvoptions} \RequirePackage{graphicx} \RequirePackage{keycommand} \RequirePackage{environ} +% Options +\DeclareStringOption[lilypond]{program}[lilypond] +\ProcessKeyvalOptions* % Script lua \directlua{dofile(kpse.find_file("lyluatex.lua"))} +\directlua{LILYPOND = '\lyluatex@program'} % Une tricherie un peu sale pour récupérer la largeur de ligne \let\bs\textbackslash diff --git a/test.tex b/test.tex index f870d61..6894ef4 100644 --- a/test.tex +++ b/test.tex @@ -1,7 +1,7 @@ \documentclass[a5paper,12pt]{scrbook} \usepackage{fontspec} \usepackage{libertine} -\usepackage{lyluatex} +\usepackage[program=lilypond]{lyluatex} \usepackage{multicol} \title{}