lilypond-user
[Top][All Lists]
Advanced

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

Re: get space left in markup function


From: Andrew Bernard
Subject: Re: get space left in markup function
Date: Thu, 2 May 2019 19:44:33 +1000

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 <address@hidden> 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 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
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

reply via email to

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