3

I have TeXworks 5.4.1.

I read Martin Thoma's tutorial and Lilypond seemed like the easiest option with the best support. I copied and pasted his example file.

Surprise surprise, I'm getting the ! LaTeX Error: Environment lilypond undefined. error.

I don't see a usepackage command in his Lilypond example like I see with MusiXTeX and ABC. Is that all I'm missing?

MusiXTeX seems to have a lot to recommend it but it seems to involve a 3-pass compilation on the command line.

I would like something as straightforward as TikzPlot: I put in a usepackage{tikz} command and, aside from my occasional TikzPlot syntax mistake, I've had no problem with it.

The document I'm working on has a few dozen equations, two or three Tikz diagrams and a couple of music examples.

EDIT: Silly me, I forgot to include this link: http://martin-thoma.com/how-to-write-music-with-latex/ It says "Make sure that you have installed GNU LilyPond and LaTeX." I have TeXworks, so checkmark for the latter. I downloaded LilyPond yesterday and ran the test file, it went through okay.

  • it might help if you posted (or gave a link to) the example but you will need to use a package or class or something to define a lilypond environment it isn't defined in the latex format. – David Carlisle Jan 06 '16 at 09:06
  • Is your workflow lilypond-book --pdf yourfile.pdftex and pdflatex yourfile.tex? – Arash Esbati Jan 06 '16 at 09:14
  • @Arash I hardly do anything on the command line nowadays. When my file was just paragraphs, equations and Tikz diagrams, I just pushed the "play" button that has a dropdown menu with pdflatex selected. – Robert Soupe Jan 06 '16 at 13:01
  • Although now that I review Martin's tutorial, I do see he lists six command line commands to compile LilyPond and just one for ABC... – Robert Soupe Jan 06 '16 at 13:10
  • @RobertSoupe - It should be possible to teach TeXworks to run the 2 commands. – Arash Esbati Jan 06 '16 at 13:48
  • @ArashEsbati I'm sure that's possible. But there's another thing that gives me pause: I read somewhere that LilyPond creates a rasterized image of the music and then inserts that into the final document. Is that right? And if so, is it any better than just creating the example in Finale or Sibelius, rasterizing it in Photoshop and then sticking it into the TeX document? – Robert Soupe Jan 07 '16 at 04:21
  • @RobertSoupe - Lilypond can also produce pdf pictures and include them in your document. I suggest you give its documentation a try. – Arash Esbati Jan 07 '16 at 20:14
  • @ArashEsbati You say "also" as if that's something I would prefer, it's not. Unless it somehow takes up less space and looks just as good as if the music was vector-based rather than rasterized. – Robert Soupe Jan 08 '16 at 04:34
  • @RobertSoupe - You should get vector-based documents with --pdf option, judge yourself and see for example a source file and the result. – Arash Esbati Jan 08 '16 at 21:57
  • @ArashEsbati Alright, I tried grabbing something from the first measure as if it were text: – Robert Soupe Jan 09 '16 at 06:16

1 Answers1

2

Lyluatex's workflow is exactly as required in the question: add \usepackage{lyluatex} to the preamble, then use lualatex -shell-escape DOC.tex.

jperon
  • 109
  • 1
  • 7