-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lisp
87 lines (71 loc) · 2.28 KB
/
init.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
;; This file was stolen from the cantor project (https://github.com/KDE/cantor)
(in-package :maxima)
#+clisp (defvar *old-suppress-check-redefinition*
custom:*suppress-check-redefinition*)
#+clisp (setf custom:*suppress-check-redefinition* t)
(setf *alt-display2d* 'latex-print)
(setf *alt-display1d* 'regular-print)
(setf *prompt-prefix* "<p>")
;;the newline at the end of the next line is needed, as we otherwise might run into
;;weird issues with KPtyProcess caching the line of the prompt, and sending it twice
;;to readStdOut()
(setf *prompt-suffix* "</p>
")
;(setf *general-display-prefix* "DISPLAY_PREFIX")
;(setf *maxima-prolog* "Hello World")
;(setf *maxima-epilog* "Bye!")
(setf $display2d t)
;#-gcl(setf *debug-io* (make-two-way-stream *standard-input* *standard-output*))
;#+(or cmu sbcl scl)
;(setf *terminal-io* (make-two-way-stream *standard-input* *standard-output*))
;; Small changes to mactex.lisp for interfacing with TeXmacs
;; Andrey Grozin, 2001-2006
;(defun main-prompt ()
; (format () "~A(~A~D) ~A" *prompt-prefix*
; (tex-stripdollar $inchar) $linenum *prompt-suffix*))
(declare-top
(special lop rop ccol $gcprint $inchar)
(*expr tex-lbp tex-rbp))
(defconstant texport *standard-output*)
(defun tex-stripdollar (x)
(let ((s (quote-% (maybe-invert-string-case (symbol-name (stripdollar x))))))
(if (> (length s) 1)
(concatenate 'string s)
s)))
(defprop mtimes ("\\*") texsym)
(defun latex-print (x)
(princ "<r>")
(princ "<t>")
(linear-displa x )
(princ "</t>")
(let ((ccol 1))
(mapc #'princ
(tex x '("<l>") '("</l>") 'mparen 'mparen)))
(princ "</r>")
)
(defun regular-print (x)
(princ "<r>")
(princ "<t>")
(linear-displa x)
(princ "</t>")
(princ "</r>")
)
(defun cantor-inspect (var)
($disp var)
(mapc #'(lambda (x)
($disp (eval x))
($disp "-cantor-value-separator-")
)
(cdr var)
)
)
;; Fix bug with maxima tex output, LaTeX and amsmath, until Maxima team don't solve it
;; More info: https://sourceforge.net/p/maxima/bugs/3432/
;;(defun tex-matrix(x l r)
;; (append l `("\\begin{pmatrix}")
;; (mapcan #'(lambda(y)
;; (tex-list (cdr y) nil (list "\\\\ ") "&"))
;; (cdr x))
;; '("\\end{pmatrix}") r))
#+clisp (setf custom:*suppress-check-redefinition*
*old-suppress-check-redefinition*)