Permalink
Browse files

First commit

  • Loading branch information...
Stemby committed Jul 28, 2010
0 parents commit 374060fc61c48ca920ae9605c4d719d6a828361d
Showing with 70 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +11 −0 README
  3. +16 −0 lilypond.sty
  4. +13 −0 lilytex.py
  5. +9 −0 test.tex
  6. +14 −0 testlily.ly
@@ -0,0 +1,7 @@
+*.log
+*.aux
+*.lil
+*.eps
+*.dvi
+*.pdf
+testlily-*
11 README
@@ -0,0 +1,11 @@
+This project provides:
+* a LaTeX package (lilypond.sty) to include lilypond-typeset music into a LaTeX document
+* a Python script (lilytex.py) to get the music images
+* the test files (test.tex and testlily.ly)
+
+How to build the example:
+1a. pdflatex test.tex
+1b. latex test.tex
+2. python lilytex.py test.lil
+3a. pdflatex test.tex
+3b. latex test.tex
@@ -0,0 +1,16 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lilypond}
+
+\RequirePackage{graphicx}
+
+\newcommand{\lilypondfile}[1]{%
+ \newwrite\conffile
+ \immediate\openout\conffile\jobname.lil
+ \immediate\write\conffile{[Config]}
+ \immediate\write\conffile{filename: #1.ly}
+ \immediate\closeout\conffile
+ \par
+% \noindent\includegraphics{#1}
+ \IfFileExists{#1.eps}{\noindent\includegraphics{#1}}
+ \par\par % why 2 \par ???
+}
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+import os, sys
+from ConfigParser import ConfigParser
+
+def main():
+ lil = ConfigParser()
+ lil.read(sys.argv[1])
+ filename = lil.get('Config','filename')
+ os.system('lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts %s' % filename)
+
+if __name__ == '__main__':
+ main()
@@ -0,0 +1,9 @@
+%test.tex
+\documentclass{article}
+\usepackage{lilypond}
+
+\begin{document}
+Test: integrating \LaTeX\ and LilyPond.
+\lilypondfile{testlily}
+Not too bad, isn't it?
+\end{document}
@@ -0,0 +1,14 @@
+\version "2.12.2"
+
+\paper{
+ indent=0\mm
+ line-width=120\mm
+ oddFooterMarkup=##f
+ oddHeaderMarkup=##f
+ bookTitleMarkup = ##f
+ scoreTitleMarkup = ##f
+}
+
+\relative c'' {
+c d e c
+}

0 comments on commit 374060f

Please sign in to comment.