\include "tune1.ly"
\include "tune2.ly"
In your piece-files you might have \tocItem
commands to build the table of contents.
If you replace those \tocItem
commands with the newly defined \part
command, you can use
#(set-toc-section! "section")
in the master file:
#(set-toc-section! "tunes")
\include "tune1.ly"
\include "tune2.ly"
#(set-toc-section! "parts")
\include "part1.ly"
\include "part2.ly"
Now every section is introduced with a section line in the table of contents only if the section title was set before. If you reorder the parts (includes), the sections will still appear in the right place.
This is meant for compiling a collection of pieces, which also compile themselves.
For a complete opus with pieces Please see snippet 368