lilypond-user
[Top][All Lists]
Advanced

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

Re: Nesting paper blocks


From: Peter Crighton
Subject: Re: Nesting paper blocks
Date: Fri, 20 Mar 2020 12:50:23 +0100

Let me better explain my file structure, which looks something like this with each .ily file prodviding a variable that is named after the file it is in:

score.ly
|-- editions
|   |-- categoryOne.ily
|   |-- categoryTwo.ily
|   |-- categoryThree.ily
|-- includes
|   |-- paperGlobal.ily
|   |-- paperSize
|   |-- |-- paperSizeOne.ily
|   |-- |-- paperSizeTwo.ily
|   |-- |-- paperSizeThree.ily
|   |-- paperCategory
|   |-- |-- paperCategoryOne.ily
|   |-- |-- paperCategoryTwo.ily
|   |-- |-- paperCategoryThree.ily

The score.ly could look like:

\version "2.20.0"
\include "editions/categoryOne.ily"
\include "editions/categoryTwo.ily"
\include "includes/paperGlobal.ily"
\include "includes/paperSize/paperSizeTwo.ily"
\include "includes/paperSize/paperSizeThree.ily"
\include "includes/paperCategory/paperCategoryOne.ily"
\include "includes/paperCategory/paperCategoryTwo.ily"

\book {
  \score {
    \categoryOne
  }
  \paper {
    % including these three variables does not work, but I need their contents all combined
    \paperGlobal
    \paperSizeTwo
    \paperCategoryOne
  }
}

\book {
  \score {
    \categoryOne
  }
  \paper {
    % different paper size for this edition
    \paperGlobal
    \paperSizeThree
    \paperCategoryOne
  }
}

\book {
  \score {
    \categoryTwo
  }
  \paper {
    % different category for this edition
    \paperGlobal
    \paperSizeThree
    \paperCategoryTwo
  }
}

With categories being different types of scores I want to do for the same song (namely music sheets with all the music, including notes, chords and lyrics; chord sheets with only chord symbols; and lyric sheets with just lyrics and chords).

So I need to be flexible with what paper variables I choose for each book. I can include just those that I need, but I still need to access a combination of them. That’s why chaining them all together does not work. \paperCategoryOne in one case would need to include \paperSizeOne, but in another case \paperSizeTwo. \paperGlobal needs to be included always, which is no problem; I can just include that into all the \paperSize variables, for example.

So far, all the \paperX variables are \paper blocks in themselves. Ideally, there would be a way to just inject the literal content of a variable inside a paper block, so this would work:

someVariable = {
  indent = 0
}
\paper {
  \someVariable
}

But I don’t know if that’s possible. Maybe all it needs is some other syntax around the content of someVariable, other than curly braces, or it is possible with some Scheme magic, but I’m out of ideas.

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de


On Thu, 19 Mar 2020 at 22:29, Kevin Barry <address@hidden> wrote:
Hi Peter,

I accomplish something similar by putting paper definitions into
various .ily files. Then just include the ones I want with \include.
It seems it's OK to have multiple \paper blocks as a result of many
\includes. Have you tried that?

Kevin

 
On Thu, 19 Mar 2020 at 22:30, Knute Snortum <address@hidden> wrote:
Just so I am clear, you don't want to do something like this:

\version "2.20.0"

paperGlobal = \paper {
  indent = 0
}

paperGlobalLine = \paper {
  \paperGlobal
  line-width = 10 \cm
}

paperGlobalLineCategory = \paper {
  paperGlobalLine
  system-system-spacing.basic-distance = 30
}

\paper {
  \paperGlobalLineCategory
}

\relative c' {
  c1 \break
  c1
}


---
Knute Snortum
(via Gmail)


On Thu, Mar 19, 2020 at 10:44 AM Peter Crighton <address@hidden> wrote:
Hello all,

I have my paper variables split up across separate files. Depending on the project I am working on, I need to include several of them. paperGlobal is always included, paperSize depends on the paper size I want to produce, and paperCategory depends on what type of project I am working on. I can use paperGlobal from inside paperSizeX, but to allow for flexibility it is not possible (or at least desirable) to nest them further and use paperSizeX inside of paperCategoryX.
See the commented line below for what I am trying to achieve, which is not possible. Is there any way to inject the content of a variable directly into the paper block like I am trying to do there?

\version "2.20.0"

paperGlobal = \paper {
  indent = 0
}

paperSizeOne = \paper {
  \paperGlobal
  line-width = 10 \cm
}

paperCategoryThree = \paper {
  system-system-spacing.basic-distance = 30
}

\paper {
  \paperSizeOne
  % \paperCategoryThree
}

\relative c' {
  c1 \break
  c1
}


Thanks,
Peter

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de

reply via email to

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