]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/framework-tex.scm
(convert-to-ps): invoke dvips with -t
[lilypond.git] / scm / framework-tex.scm
index 8e2c65b63508754a1663575911aaddbb7f224533..f9b9e454e11f876c9f182b7c1ff19e12b2238dc9 100644 (file)
                     "{" (sanitize-tex-string str) "}%\n")))
 
 (define (header bookpaper page-count classic?)
-  (let ((scale (ly:output-def-lookup bookpaper 'outputscale)))
-
+  (let ((scale (ly:output-def-lookup bookpaper 'outputscale))
+       (texpaper (string-append
+                  (ly:output-def-lookup bookpaper 'papersizename)
+                  "paper"))
+       (landscape? (eq? #t (ly:output-def-lookup bookpaper 'landscape)))
+       )
+    
     (string-append
      "% Generated by LilyPond "
      (lilypond-version) "\n"
      (tex-string-def
       "lilypondpaper" 'linewidth
       (ly:number->string (* scale (ly:output-def-lookup bookpaper 'linewidth))))
-
+     "\\def\\lilyponddocumentclassoptions{"
+     texpaper
+     (if  landscape? ",landscape" "")
+      "}%\n"
      (tex-string-def
       "lilypondpaper" 'interscoreline
       (ly:number->string
 
 (define-public (convert-to-ps book name)
   (let*
-      ((cmd (string-append "dvips -u+ec-mftrace.map -u+lilypond.map -Ppdf "
+      ((bookpaper  (ly:paper-book-book-paper book))
+       (papersize (ly:output-def-lookup bookpaper 'papersizename))
+       (landscape? (eq? #t (ly:output-def-lookup bookpaper 'landscape)))
+       (cmd (string-append "dvips -t " papersize
+                          (if landscape? " -t landscape " " ") 
+                          "  -u+ec-mftrace.map -u+lilypond.map -Ppdf "
                           (basename name ".tex"))))
 
     (display (format #f (_ "Invoking ~S") cmd) (current-error-port))