get space left in markup function
Hello! I have a markup function and inside this function I need to know how much free space is left on page. (The space left parameter displayed with annotate-spacing = ##t). Can anyone tell me how to get this parameter in markup function? -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: get space left in markup function
Robert Kubosz writes: > Hello! > > I have a markup function and inside this function I need to know how much > free space is left on page. (The space left parameter displayed with > annotate-spacing = ##t). Can anyone tell me how to get this parameter in > markup function? At the time markups are evaluated, the page breaking decisions have not yet been made, and of course those decisions depend on what your markup command will produce. So this information is still to be established at this time. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: get space left in markup function
Hmm, maybe I will introduce you to the problem I am now tackling and why I need to know the available free space in markup command. I'm modifying the book template shared by Nicolas Sceaux. Now I'm working on table of contents. The table of contents looks beautiful on one condition: sections don't have a lot of pieces, so the whole section fits on one page in table of contents. Here is an example: https://drive.google.com/file/d/1RDLaqvYw81cdE9zYB_SvpaNxPhaK8Gr0/view?usp=sharing The problem is shown on page 5. The section has so many pieces, that they don't fit on the page (there's a gap between pieces 19-43). Of course, the problem with not fitting them on one page could be fixed with proper page breaking. The result could be as such: blah blah blah foo bar TOC SECTION 1 piece a piece f piece b piece g piece c piece h (page break) piece d piece i piece e piece j SECTION 2 (page break) Result like this above will not satisfy me, because it's just ugly and unprofessional. And it could be frustrating for users of books. I want it to look like this: blah blah blah foo bar TOC SECTION 1 piece a piece d piece b piece e piece c piece f (page break) piece g piece i piece h piece j SECTION 2 (page break) And to generate multi page toc section like this I need to know the space left on page, so markup function could calculate how much toc pieces could fit in the free left space on page and which pieces pass to the next page. On 01.05.2019 12:39, David Kastrup wrote: > > At the time markups are evaluated, the page breaking decisions have not > yet been made, and of course those decisions depend on what your markup > command will produce. So this information is still to be established at > this time. > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: get space left in markup function
Hello Robert, It seems to me wishful thinking to try to get inside the machinery of the markup commands to do your own custom layout. What you are after is what I refer to as newspaper columns, or snaking columns they are sometimes called. This properly belongs to the domain of powerful text processing programs. I suggest instead to trying to second guess the lilypond markup engine that you perhaps should invest the time learning TeX, of some description. If as you mention you are interested in fine book design done professionally. then that would be a good way to go. There are those that maintain that TeX produces the finest typesetting in the world, a view I respect. There are lots of people on the list experienced with integration of lilypond and TeX (all the various variants). As David says, the markup can't know the remaining space as it is not available at that time in the processing chain sequence. Andrew On Thu, 2 May 2019 at 19:33, Robert Kubosz wrote: > Hmm, maybe I will introduce you to the problem I am now tackling and why > I need to know the available free space in markup command. > > I'm modifying the book template shared by Nicolas Sceaux. Now I'm > working on table of contents. The table of contents looks beautiful on > one condition: sections don't have a lot of pieces, so the whole section > fits on one page in table of contents. > > Here is an example: > > https://drive.google.com/file/d/1RDLaqvYw81cdE9zYB_SvpaNxPhaK8Gr0/view?usp=sharing > > The problem is shown on page 5. The section has so many pieces, that > they don't fit on the page (there's a gap between pieces 19-43). > > Of course, the problem with not fitting them on one page could be fixed > with proper page breaking. The result could be as such: > > > > blah blah blah > > foo > > bar > > TOC > > SECTION 1 > > piece apiece f > > piece bpiece g > > piece cpiece h > > (page break) > > piece dpiece i > > piece epiece j > > SECTION 2 > > > (page break) > > > Result like this above will not satisfy me, because it's just ugly and > unprofessional. And it could be frustrating for users of books. I want > it to look like this: > > > > > blah blah blah > > foo > > bar > > TOC > > SECTION 1 > > piece apiece d > > piece bpiece e > > piece cpiece f > > (page break) > > piece gpiece i > > piece hpiece j > > SECTION 2 > > > (page break) > > > And to generate multi page toc section like this I need to know the > space left on page, so markup function could calculate how much toc > pieces could fit in the free left space on page and which pieces pass to > the next page. > > > On 01.05.2019 12:39, David Kastrup wrote: > > > > At the time markups are evaluated, the page breaking decisions have not > > yet been made, and of course those decisions depend on what your markup > > command will produce. So this information is still to be established at > > this time. > > > > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: get space left in markup function
Thanks for your response, Andrew. I really hoped that somehow I could create the snaking columns in my book just using lilypond. It was the very last thing I needed to create a nice book and to finish my typesetting work. I know LaTeX, I wrote some things in it. I will check out lyluatex. -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user