;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-(define-module (scm tex)
- :export (tex-output-expression)
- :no-backtrace
- )
-
+(define-module (scm tex) )
+(debug-enable 'backtrace)
(use-modules (scm ps)
(ice-9 regex)
(ice-9 string-fun)
(ice-9 format)
- (guile-user)
(guile)
)
(embedded-ps (list 'bracket arch_angle arch_width arch_height height arch_thick thick)))
(define (dashed-slur thick dash l)
- (embedded-ps (list 'dashed-slur thick dash l)))
+ (embedded-ps (list 'dashed-slur thick dash `(quote ,l))))
(define (hairpin thick w sh eh)
(embedded-ps (list 'hairpin thick w sh eh))
""
)
-
-(define (embedded-ps expr)
- (let
- ((os (open-output-string)))
- (ps-output-expression expr os)
- (string-append "\\embeddedps{" (get-output-string os) "}")
- ))
+(if (or (equal? (minor-version) "4")
+ (equal? (minor-version) "3.4"))
+ (define (embedded-ps expr)
+ (let ((ps-string
+ (with-output-to-string
+ (lambda () (ps-output-expression expr (current-output-port))))))
+ (string-append "\\embeddedps{" ps-string "}")))
+ (define (embedded-ps expr)
+ (let
+ ((os (open-output-string)))
+ (ps-output-expression expr os)
+ (string-append "\\embeddedps{" (get-output-string os) "}"))))
(define (comment s)
(string-append "% " s "\n"))
(ly-gulp-file "music-drawing-routines.ps"))
(if (defined? 'ps-testing) "/testing true def%\n" "")
"}"
- "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale pt\\turnOnPostScript"))
+ "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale "
+ ;; "pt"
+ "mm"
+
+ "\\turnOnPostScript"))
;; Note: this string must match the string in ly2dvi.py!!!
(define (header creator generate)
(string-append
"\n\\" s "{" (inexact->string i 10) "}" ))
-(define (invoke-dim1 s d)
- (string-append
- "\n\\" s "{" (number->dim d) "}"))
-(define (pt->sp x)
- (* 65536 x))
-
;;
;; need to do something to make this really safe.
;;
-(define (output-tex-string s)
+(define-public (output-tex-string s)
(if security-paranoia
(if use-regex
(regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
)
(define (define-origin file line col)
(if (procedure? point-and-click)
- (string-append "\\special{src\\string:"
+ (string-append "\\special{src:" ;;; \\string ?
(point-and-click line col file)
"}" )
"")
; no-origin not yet supported by Xdvi
(define (no-origin) "")
-(define (tex-output-expression expr port)
- (display (eval expr this-module) port )
+(define my-eval-in-module eval)
+
+(if (or (equal? (minor-version) "4")
+ (equal? (minor-version) "3.4"))
+ (begin
+ (set! my-eval-in-module eval-in-module)
+
+ ))
+
+(define-public (tex-output-expression expr port)
+ (display (my-eval-in-module expr this-module) port )
)
+