Re: What should the relation between \book / \bookpart be?
Simon Albrecht <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.devel |
|---|---|
| Message-ID | <[email protected]> |
On 08/08/2026 19:45, David Kastrup wrote: > Simon Albrecht <[email protected]> writes: > >>> What is wrong with a \bookpart? >> It causes a page break, > That is correct. Maybe some way of being able to merge several > bookparts into one might make sense. I also had the thought of providing Scheme function(s) like (name not scrutinised) \squashIntoOneBookpart #'identifier or similar. >> and I understood your goal was to allow for the greatest possible >> flexibility in reusing segments of a project inside/outside of \book >> and \bookpart. That was me reading between the lines, which I felt to >> be necessary. > Well, the idea was to avoid roadblocks that are hard to understand. > "Why doesn't this work" should have an answer people can get behind. > I just have a bad imagination about "people". Would it be hard to give a clear error message when \book{} blocks are nested for example? >>> If you want to think of things as mere text, you can use include, but >>> then they _are_ mere text without inherent structure, and depending on >>> the syntactic context they are included in, the structure may become >>> different or incoherent. >>> >>> There is a reason text-based macros are a nightmare. You cannot use >>> them as black box. You cannot rely on them being interpreted in a >>> particular manner. >> I don’t understand. Are you arguing against using \include to >> modularise a project? Of course using it always requires smart >> handling of what’s inside and outside any \includes. > That is the point. You need to look inside of the includes. > "Modularisation" means somebody tells you "you can include this file and > it will do this and that" without needing to look inside. And basically > being able to write > > \bookpart { \include "someone else's LilyPond source file" } > > without having to dig into what is in that file would be nice as an > ideal. OF course it will not always work, but one can muse about just > what complications would make sense to people, and which will not > exactly be met with enthusiasm. >