Marduk Bolaños
2017-09-05 02:16:47 UTC
Dear all,
I implemented in Lisp what Python and Gnuplot do in order to display a
plot inline in TeXmacs:
(defun tm_out (str)
(let ((beg (string (code-char 2)))
(end (string (code-char 5))))
(concatenate 'string beg "ps: " str end)))
(defmfun $ps_out (filename)
(with-open-file (stream filename)
(let ((contents (make-string (file-length stream))))
(read-sequence contents stream)
;; princ does not enclose the string in quotes
(princ (tm_out contents))
(princ "")
)))
This works great inside a Maxima session, but I would also like to use
it in an executable Maxima fold (script).
I have tried a million things and the script output is always
empty. How can I get it done?
Thanks in advance!
Cheers,
Marduk
I implemented in Lisp what Python and Gnuplot do in order to display a
plot inline in TeXmacs:
(defun tm_out (str)
(let ((beg (string (code-char 2)))
(end (string (code-char 5))))
(concatenate 'string beg "ps: " str end)))
(defmfun $ps_out (filename)
(with-open-file (stream filename)
(let ((contents (make-string (file-length stream))))
(read-sequence contents stream)
;; princ does not enclose the string in quotes
(princ (tm_out contents))
(princ "")
)))
This works great inside a Maxima session, but I would also like to use
it in an executable Maxima fold (script).
I have tried a million things and the script output is always
empty. How can I get it done?
Thanks in advance!
Cheers,
Marduk