-(define (self-evaluating? x)
- (or (number? x) (string? x) (procedure? x) (boolean? x)))
-
-(define (texify x)
- x)
-
-(define (scm->texi x)
- (string-append "@code{" (texify (scm->string x)) "}"))
-
-
+(define (scm->texi val)
+ (let* (; always start on a new line
+ (open-texi (if (pretty-printable? val)
+ "\n@verbatim\n"
+ "\n@code{"))
+ (close-texi (if (pretty-printable? val)
+ "@end verbatim"
+ "}")))
+ (string-append open-texi (scm->string val) close-texi)))