From 4547d6e8f20b2334cc13289bfa36f20ee1b63cbc Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Mon, 7 Jan 2013 18:43:00 +0100 Subject: [PATCH] fix out-of-tree lilypond inclusion --- songbook.py | 11 +++++++---- templates/ancient.tmpl | 2 +- templates/minimal.tmpl | 2 +- tex/crepbook.cls | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/songbook.py b/songbook.py index dfd5d39e..0171e33a 100755 --- a/songbook.py +++ b/songbook.py @@ -156,11 +156,14 @@ def makeTexFile(sb, library, output): content = [ line for line in f if not commentPattern.match(line) ] for index, line in enumerate(content): - if re.compile("getcachedirectory").search(line): - line = line.replace("\\getcachedirectory", cachePath + "/") + if re.compile("getCacheDirectory").search(line): + line = line.replace("\\getCacheDirectory", cachePath + "/") content[index] = line - if re.compile("getlibraryimgdirectory").search(line): - line = line.replace("\\getlibraryimgdirectory", library + "img/") + if re.compile("getLibraryImgDirectory").search(line): + line = line.replace("\\getLibraryImgDirectory", library + "img/") + content[index] = line + if re.compile("getLibraryLilypondDirectory").search(line): + line = line.replace("\\getLibraryLilypondDirectory", library + "lilypond/") content[index] = line f.close() diff --git a/templates/ancient.tmpl b/templates/ancient.tmpl index e75bfc64..12742bfc 100644 --- a/templates/ancient.tmpl +++ b/templates/ancient.tmpl @@ -68,7 +68,7 @@ \newindex{titleidx}{\getname_title} \newauthorindex{authidx}{\getname_auth} -\graphicspath{ {img/}, {\getlibraryimgdirectory}, {\getcachedirectory} } +\graphicspath{ {img/}, {\getLibraryImgDirectory}, {\getLibraryLilypondDirectory}, {\getCacheDirectory} } \definecolor{SongNumberBgColor}{HTML}{\getsongnumberbgcolor} \definecolor{NoteBgColor}{HTML}{\getnotebgcolor} diff --git a/templates/minimal.tmpl b/templates/minimal.tmpl index 25679856..3ac88293 100644 --- a/templates/minimal.tmpl +++ b/templates/minimal.tmpl @@ -41,7 +41,7 @@ \usepackage[italian,portuguese,spanish,english,french]{babel} \lang{\getlang} -\graphicspath{ {img/}, {\getlibraryimgdirectory}, {\getcachedirectory} } +\graphicspath{ {img/}, {\getLibraryImgDirectory}, {\getLibraryLilypondDirectory}, {\getCacheDirectory} } \nosongnumbers \pagestyle{empty} diff --git a/tex/crepbook.cls b/tex/crepbook.cls index d69df6c5..b61d24ac 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -310,7 +310,7 @@ \newcommand{\lilypond}[1]{% \iflilypond% - \IfFileExists{./lilypond/#1.pdf}{\includegraphics{./lilypond/#1}}{}% + \includegraphics{#1}% \fi% }