lilypond-user
[Top][All Lists]
Advanced

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

Re: Make TOC entries available to LaTeX


From: Federico Bruni
Subject: Re: Make TOC entries available to LaTeX
Date: Thu, 24 May 2018 08:52:17 +0200



Il giorno gio 26 apr 2018 alle 8:48, Urs Liska <address@hidden> ha scritto:
[...]

3)
I think the inclusion in the TeX TOC can (now?) be done in a simpler way
using the catchfile package:

\documentclass{article}
\usepackage{pdfpages,catchfile}
\newcommand\includelilypond[1]{%
   \begingroup
     \CatchFileDef\currentlilypondtoc{#1.toc}{}

\edef\x{\noexpand\includepdf[pages=-,addtotoc={\currentlilypondtoc}]{#1.pdf}}
   \expandafter\endgroup\x
}
\begin{document}
\tableofcontents
\includelilypond{test}
\end{document}


(Answer from
https://tex.stackexchange.com/questions/428239/merge-in-manual-toc-entries-in-a-lualatex-document)

There's only one issue: The TOC will create wrong entries when LilyPond's first page number is not 1. So there should actually be an offset in place. How can I read the value of the first-page-number variable to set up this
offset?
page-post-process has the layout-variable.
(ly:output-def-lookup layout 'first-page-number) should do the trick.

Thanks, this works.
What do you think: this example code is much easier to understand than the one currently in the manual. Should I propose an update?


+1 for the update!

Urs, can you show a minimal example using the first-page-number?
How do you use it all the above in combination with lyluatex?

I have an almost finished book to give to a guitarist tomorrow!

Thanks in advance
Federico






reply via email to

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