⌂ Using header fields in arbitrary markup
This snippet adds a markup function that allows one to use header fields (e.g. the title, composer, etc.) in arbitrary markup. By default, markups like bookTitleMarkup specified in the \paper block is treated differently than other markup, so that one can access header fields via \fromproperty #'header:fieldname in such markups. This does not work for toplevel markup or markup inside a score, so \fromproperty returns an empty string in this case.
The \markupWithHeader markup function defined in this snippet fixes this problem and makes the header fields available to markups, so that you can now use the same markups as for book/score titles also in other places throughout your score.