Skip to content

Commit

Permalink
Ajout d'une option pour définir le chemin vers lilypond (#2)
Browse files Browse the repository at this point in the history
Il peut s'agir d'un chemin absolu ou d'un exécutable du PATH.
  • Loading branch information
jperon committed May 28, 2015
1 parent fe54c55 commit 71b916c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lyluatex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local err, warn, info, log = luatexbase.provides_module({
})


LILYPOND = 'lilypond'
TMP = 'tmp_ly'
N = 0

Expand Down Expand Up @@ -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 "
Expand Down
5 changes: 5 additions & 0 deletions lyluatex.sty
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\documentclass[a5paper,12pt]{scrbook}
\usepackage{fontspec}
\usepackage{libertine}
\usepackage{lyluatex}
\usepackage[program=lilypond]{lyluatex}
\usepackage{multicol}

\title{}
Expand Down

0 comments on commit 71b916c

Please sign in to comment.