lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilypondbook with multiple files


From: Susan Dittmar
Subject: Re: lilypondbook with multiple files
Date: Fri, 1 Oct 2010 12:45:41 +0200
User-agent: Mutt/1.5.9i

Dear Stefan,

looks like lilypond-book does not honor the \input command, which means you
will have to process those parts one by one. I would even appreciate this
behaviour if my assumption is correct, as it reduces the workload for
lilypond in case of changes in only one of the part files.

I did not work with lilypondbook yet, but I would try this approach:

- move partone.tex to partone.lytex
- move parttwo.tex to parttwo.lytex
Do *not* change the \input calls in master.tex!

When processing the main document, you'd have to

- process partone.lytex:
  lilypond-book --pdf partone.lytex
  (I removed the output directory as I suspect that would raise new
  problems for TeX. They can be solved, but I want to keep this one
  simple. Once it works we can try to re-introduce that.)
  Do *not* pdflatex that part, as it is no complete document!
  If I understand correctly, it generates a file partone.tex.
- process parttwo.lytex:
  lilypond-book --pdf parttwo.lytex
- Now process the main document. As it does not include any lilypond
  code, no lilypond preprocessing is necessary. So you only need to
  run it through the TeX engine:
  pdflatex master.tex

This can be done using the 'make' command and a Makefile like this (replace
the <tab> by true tab keystrokes; they are important!):

#### Makefile begin #############

default: master.pdf

master.pdf: master.tex partone.tex parttwo.tex
<tab>pdflatex master.tex

.SUFFIXES:
.SUFFIXES: .lytex .tex

.lytex.tex:
<tab>lilypond-book --pdf $(basename $(notdir $@)).lytex

#### Makefile end ################

Unfortunately I do not have a running lilypond at the moment, so all this
is untested.

Hope it helps nonetheless,

        Susan

PS: If you have any questions about what the individual commands do or
    mean, feel encouraged to ask!

Quoting Stefan Thomas (address@hidden):
> Dear community,
> I have problems processing a latex-file with lilypond-book and latex, which
> consists of more than one parts.
> Here is my example:
> %%%% the "master file" %%%%%%%%%%%
> \documentclass[a4paper]{article}
> 
> \begin{document}
> \input partone.tex
> \input parttwo.tex
> \end{document}
> % the file partone.tex
> This is an example with text and music! \\
> \begin{lilypond}
>  \version"2.12.2"
> \relative {c4 d e f g a b c}
> \end{lilypond} \\
> % the file parttwo.tex
> This is another example with text and music! \\
> \begin{lilypond}
>  \version"2.12.2"
> \relative c'' {c4 b a g f e d c}
> \end{lilypond} \\
> I tried to process it with the following script:
> #!/bin/zsh
> mkdir -p out/
> lilypond-book --pdf $1.tex --output=out
> cd out/ &&
> pdflatex "$1".tex
> mv "$1".pdf ../
> cd ../ &&
> rm -r out/
> 
> When I do so, I get the message:
> ! I can't find file `partone.tex'.
> l.6 \input partone.tex
> Please type another input file name:
> 
>  I can't find my mistake.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]