Da ich Probleme hatte, das Inhaltsverzeichnis per Adobe Acrobat Reader in eine Textdatei zu übertragen, hat
Harm hier eine Lösung gepostet, die das Inhaltsverzeichnis in eine seperate Textdatei ausgibt.
Der Vollständigkeit halber erlaube ich mir, den Code nochmals zu posten
\version "2.18.2"
#(define (oly:create-toc-file layout pages)
(let* ((label-table (ly:output-def-lookup layout 'label-page-table)))
(if (not (null? label-table))
(let* ((format-line (lambda (toc-item)
(let* ((label (car toc-item))
(text (caddr toc-item))
(label-page (and (list? label-table)
(assoc label label-table)))
(page (and label-page (cdr label-page))))
;(format #f "~a, section, 1, {~a}, ~a" page text label)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(format #f "~a, ~a, ~a" page text label)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
)))
(formatted-toc-items (map format-line (toc-items)))
(whole-string (string-join formatted-toc-items ",\n"))
(output-name (ly:parser-output-name))
(outfilename (format "~a.toc" output-name))
(outfile (open-output-file outfilename)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (output-port? outfile)
(display "page, text, label\n" outfile))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (output-port? outfile)
(display whole-string outfile)
(ly:warning (_ "Unable to open output file ~a for the TOC information") outfilename))
(close-output-port outfile)))))
\paper {
#(define (page-post-process layout pages) (oly:create-toc-file layout pages))
}
{
\tocItem "auf Seite 1"
c'1
\pageBreak
\tocItem "auf Seite 2"
d'
\pageBreak
\tocItem "auf Seite 3"
e'
}
Ich habe es bereits ausprobiert, klappt super!!!
"text" und "page" habe ich vertauscht, ich möchte zuerst die Überschrift und dann die Zeilennumer haben.
Mit "label" kann man sicher auch noch was Sinnvolles anfangen, ich muss nur noch rauskriegen was.
