5

I am experimenting with using Lilypond from windows. It seems lilypond-book skips sub-files.

I created a minimum working/not-working example in main.lytex, which I'm processing with a CMD-file (see below).

The first two versions (lilypond-environment and lilypondfile) work, while the third one (included in sub-file) doesn't:

enter image description here

Any ideas, why it won't work?
Should I perhaps put all subfiles into a subdirectory and tell lilypond-book to process all files in this directory? (How?)
Did I miss to tell lilypond-book to include a specific directory?

Notes:

  • on Linux it works (using \input instead of \include)
  • on OS it works (using \input instead of \include)


main.lytex:

\documentclass{article}
\begin{document}

\section{Lilypond directly}
\begin{lilypond}
    \relative c'
    {
      c4 d e f | g1
    }
\end{lilypond}

\section{Lilypond via include}
\lilypondfile{sheet.ly}

\section{Lilypond included from subfile}
\include{sub}

\end{document}


sub.tex:

\lilypondfile{sheet.ly}


sheet.ly:

\version "2.16.2"

\score {
  <<
    \relative c'
    {
      c4 d e f | g1
    }
  >>
}


my CMD-file:

set "outputdir=out"
set "includedir=inc"
set "maindir=%CD%"
set "mainfile=main"
set "TEXINPUTS=%TEXINPUTS%;%CD%"

set "lytexfile=%mainfile%.lytex"
set "latexfile=%mainfile%.tex"
set "pdffile=%mainfile%.pdf"

lilypond-book --pdf --output=%outputdir% --loglevel=ERROR %lytexfile% 

cd %outputdir%
pdflatex --interaction=nonstopmode --include-directory=%maindir% %latexfile%

cp %pdffile% ../%pdffile%
cd ..


output on command line:

D:\path_to_working_dir>createPDF.cmd
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9)
entering extended mode
(D:\path_to_working_dir\out\main.tex
LaTeX2e 
Babel  and hyphenation patterns for english, afrikaans, ancientgreek, arabic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, galician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, icelandic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, latvian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usenglishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))
(D:\path_to_working_dir\out\main.aux)
(C:\Users\hardmooth\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (D:\path_to_working_dir\out\87/lily-da14f453-systems.tex

)
(D:\path_to_working_dir\out\05/lily-f1bfdfe8-systems.tex

) [1{C:/Users/hardmooth/AppData/Local/MiKTeX/2.9/pd
ftex/config/pdftex.map}  ] (D:\path_to_working_dir\out\sub.tex
(D:\path_to_working_dir\out\46/lily-dc205d25-systems.tex

! LaTeX Error: File `46/lily-dc205d25-1' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...

l.1 \includegraphics{46/lily-dc205d25-1}
                                        %
)) [2] (D:\path_to_working_dir\out\main.aux
(D:\path_to_working_dir\out\sub.aux)) )
(see the transcript file for additional information)
Output written on main.pdf (2 pages, 37499 bytes).
Transcript written on main.log.
hardmooth
  • 297
  • Does it also fail if you use \input in place of \include? – Brent.Longborough Jun 02 '14 at 08:55
  • @Brent.Longborough: neither \input nor \include work. Besides the obvious difference that include results in a pagebreak, input adds an extra lilypond-book.py: error: file not found: sub as error – hardmooth Jun 02 '14 at 16:41
  • for now I've switched to a virtual linux. That's working and I have more control, but it's not what I was looking for. – hardmooth Jun 22 '14 at 10:10
  • 1
    With \input instead of \include it works in my environment: OS 10.8.5, TexShop with Lilypond-book engine by N. Vitacolonna. –  Jun 04 '14 at 07:05
  • Have you tried to write \input{sub.tex} instead of \input{sub} ? – yo' Sep 06 '14 at 20:45

1 Answers1

0

With lyluatex, included files work. main.lytex should be renamed main.tex, and modified to include lyluatex package:

\documentclass{article}
\usepackage{lyluatex}

\begin{document}

\section{Lilypond directly} \begin{lilypond} \relative c' { c4 d e f | g1 } \end{lilypond}

\section{Lilypond via include} \lilypondfile{sheet.ly}

\section{Lilypond included from subfile} \include{sub}

\end{document}

Other files stay as in the question. Compilation should be done with lualatex and -shell-escape (no preprocessor command is required):

lualatex -shell-escape main
jperon
  • 109
  • 1
  • 7