;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2004--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
(define-module (scm framework-tex)
#:export (output-framework-tex
(use-modules (ice-9 regex)
(ice-9 string-fun)
(ice-9 format)
+ (scm page)
+ (scm paper-system)
(guile)
(srfi srfi-1)
(srfi srfi-13)
(srfi srfi-14)
+ (scm kpathsea)
(lily))
(define (output-formats)
(inexact->exact
(round (* 1000
(ly:font-magnification font)
- (ly:paper-outputscale paper)))))))
+ (ly:paper-output-scale paper)))))))
sub-fonts)))))
(define (simple-font-load-command paper font)
(inexact->exact
(round (* 1000
(ly:font-magnification font)
- (ly:paper-outputscale paper))))))
+ (ly:paper-output-scale paper))))))
(define (font-load-command paper font)
(if (pair? (ly:font-sub-fonts font))
(string-append
;; UGH. FIXME.
"\\def\\lilypondpaperunit{mm}%\n"
- (tex-number-def "lilypondpaper" 'outputscale
+ (tex-number-def "lilypondpaper" 'output-scale
(number->string (exact->inexact
- (ly:paper-outputscale paper))))
+ (ly:paper-output-scale paper))))
(tex-string-def "lilypondpaper" 'papersize
(eval 'papersizename (ly:output-def-scope paper)))
;; paper/layout?
- (tex-string-def "lilypondpaper" 'inputencoding
- (eval 'inputencoding (ly:output-def-scope paper)))
+ (tex-string-def "lilypondpaper" 'input-encoding
+ (eval 'input-encoding (ly:output-def-scope paper)))
(apply string-append
(map (lambda (x) (font-load-command paper x))
"{" (sanitize-tex-string str) "}%\n")))
(define (header paper page-count classic?)
- (let ((scale (ly:output-def-lookup paper 'outputscale))
+ (let ((scale (ly:output-def-lookup paper 'output-scale))
(texpaper (string-append
(ly:output-def-lookup paper 'papersizename)
"paper"))
"")
(tex-string-def
- "lilypondpaper" 'linewidth
- (ly:number->string (* scale (ly:output-def-lookup paper 'linewidth))))
+ "lilypondpaper" 'line-width
+ (ly:number->string (* scale (ly:output-def-lookup paper 'line-width))))
"\\def\\lilyponddocumentclassoptions{"
(sanitize-tex-string texpaper)
(if landscape? ",landscape" "")
"}%\n"
- (tex-string-def
- "lilypondpaper" 'interscoreline
- (ly:number->string
- (* scale (ly:output-def-lookup paper 'interscoreline)))))))
+ )))
(define (header-end)
(string-append
(let* ((filename (format "~a.tex" basename))
(outputter (ly:make-paper-outputter (open-file filename "wb") "tex"))
(paper (ly:paper-book-paper book))
- (pages (ly:paper-book-pages book))
+ (page-stencils (map page-stencil (ly:paper-book-pages book)))
(last-page (car (last-pair pages)))
(with-extents
(eq? #t (ly:output-def-lookup paper 'dump-extents))))
(lambda (x)
(ly:outputter-dump-string outputter x))
(list
- (header paper (length pages) #f)
+ (header paper (length page-stencils) #f)
(define-fonts paper)
(header-end)))
(ly:outputter-dump-string outputter "\\lilypondnopagebreak\n")
(for-each
(lambda (page)
(dump-page outputter page (eq? last-page page) with-extents))
- pages)
+ page-stencils)
(ly:outputter-dump-string outputter "\\lilypondend\n")
(ly:outputter-close outputter)
(postprocess-output book framework-tex-module filename
(ly:number->string
(interval-length (paper-system-extent line Y)))))
- (ly:outputter-dump-stencil putter (ly:paper-system-stencil line))
+ (ly:outputter-dump-stencil putter (paper-system-stencil line))
(ly:outputter-dump-string
putter
(if last?
(string->number
(regexp-substitute/global
#f " *%.*\n?"
- (ly:kpathsea-expand-variable "$extra_mem_top")
+ (ly:kpathsea-expand-variable "extra_mem_top")
'pre "" 'post)))
(base (basename name ".tex"))
(cmd (format