Permalink
Browse files

setting LilyPond default configuration

  • Loading branch information...
1 parent 9b26372 commit 27e188c35e4e4c092653acbf7927012639df37e3 @Stemby committed Aug 9, 2010
Showing with 36 additions and 9 deletions.
  1. +1 −0 .gitignore
  2. +34 −1 lilytex
  3. +1 −8 testlily.ly
View
@@ -6,3 +6,4 @@
*.dvi
*.pdf
testlily-*
+config.ly
View
@@ -1,15 +1,48 @@
#!/usr/bin/env python
import os, sys
-from subprocess import Popen
from ConfigParser import ConfigParser
+from subprocess import Popen
+
+def lilyconf(cw, dn):
+ print cw # NOTE: debug
+ f = open('config.ly', 'w')
+ f.write(
+'''%% Automatically generated by lilytex
+
+%% no indent
+%% line-width = LaTeX \columnwidth
+%% no titles
+
+\paper {
+ indent=0\mm
+ line-width=%s\pt
+ oddFooterMarkup=##f
+ oddHeaderMarkup=##f
+ bookTitleMarkup = ##f
+ scoreTitleMarkup = ##f
+}
+
+
+%% no bar numbers
+
+\layout {
+ \context {
+ \Score
+ \\remove "Bar_number_engraver"
+ }
+}
+''' % cw[:-2])
+ f.close()
def main():
lil = ConfigParser()
lil.read(sys.argv[1])
path = lil.get('Config','filename')
dirname = os.path.dirname(path)
basename = os.path.basename(path)
+ columnwidth = lil.get('Config','columnwidth')
+ lilyconf(columnwidth, dirname) # TODO: manage dirname
# See:
# http://lilypond.org/doc/v2.13/Documentation/usage/lilypond-output-in-other-programs
args = ['lilypond', '-dbackend=eps', '-dno-gs-load-fonts',
View
@@ -1,13 +1,6 @@
\version "2.12.2"
-\paper{
- indent=0\mm
- line-width=120\mm
- oddFooterMarkup=##f
- oddHeaderMarkup=##f
- bookTitleMarkup = ##f
- scoreTitleMarkup = ##f
-}
+\include "config.ly"
\relative c'' {
c d e c

0 comments on commit 27e188c

Please sign in to comment.