From 2a80f222cd53cf2de19d0380615886cb1755e55b Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Mon, 7 Jan 2013 17:49:52 +0100 Subject: [PATCH] support the songs library's image path for pictures --- songbook.py | 5 ++++- templates/ancient.tmpl | 2 +- templates/minimal.tmpl | 2 +- templates/patacrep.tmpl | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/songbook.py b/songbook.py index d8741a08..677cf6cc 100755 --- a/songbook.py +++ b/songbook.py @@ -159,6 +159,9 @@ def makeTexFile(sb, library, output): 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/") + content[index] = line f.close() out.write(''.join(content)) @@ -198,7 +201,7 @@ def makeDepend(sb, library, output): # write .d file out = open(output, 'w') out.write('{0} {1} : {2}\n'.format(output, name+".tex", ' '.join(deps))) - out.write('{0} : {1}\n'.format(name+".pdf", ' '.join(map(lambda x: x+".sbx",idx)+map(lambda x: "lilypond/"+x+".pdf", lilypond)))) + out.write('{0} : {1}\n'.format(name+".pdf", ' '.join(map(lambda x: x+".sbx",idx)+map(lambda x: library+"lilypond/"+x+".pdf", lilypond)))) out.write('\t$(LATEX) {0}\n'.format(name+".tex")) out.write('{0} : {1}\n'.format(' '.join(map(lambda x: x+".sxd",idx)), name+".aux")) out.close() diff --git a/templates/ancient.tmpl b/templates/ancient.tmpl index 76edaeab..e75bfc64 100644 --- a/templates/ancient.tmpl +++ b/templates/ancient.tmpl @@ -68,7 +68,7 @@ \newindex{titleidx}{\getname_title} \newauthorindex{authidx}{\getname_auth} -\graphicspath{ {img/}, {\getcachedirectory} } +\graphicspath{ {img/}, {\getlibraryimgdirectory}, {\getcachedirectory} } \definecolor{SongNumberBgColor}{HTML}{\getsongnumberbgcolor} \definecolor{NoteBgColor}{HTML}{\getnotebgcolor} diff --git a/templates/minimal.tmpl b/templates/minimal.tmpl index e9033363..25679856 100644 --- a/templates/minimal.tmpl +++ b/templates/minimal.tmpl @@ -41,7 +41,7 @@ \usepackage[italian,portuguese,spanish,english,french]{babel} \lang{\getlang} -\graphicspath{ {img/}, {\getcachedirectory} } +\graphicspath{ {img/}, {\getlibraryimgdirectory}, {\getcachedirectory} } \nosongnumbers \pagestyle{empty} diff --git a/templates/patacrep.tmpl b/templates/patacrep.tmpl index 3ce21261..92ce7427 100644 --- a/templates/patacrep.tmpl +++ b/templates/patacrep.tmpl @@ -68,7 +68,7 @@ \newindex{titleidx}{\getname_title} \newauthorindex{authidx}{\getname_auth} -\graphicspath{ {img/}, {\getcachedirectory} } +\graphicspath{ {img/}, {\getlibraryimgdirectory}, {\getcachedirectory} } \definecolor{SongNumberBgColor}{HTML}{\getsongnumberbgcolor} \definecolor{NoteBgColor}{HTML}{\getnotebgcolor}