From: Leo B. <leo...@um...> - 2021-03-08 18:07:30
|
Hi Eric, I think that you have found a bug in alt-display. With the attached patch, your code works fine for me. I have taken the liberty to re-write your my_display function so that it uses printf, rather multiple calls to princ. Can you test out the patch, please? Leo #+begin_src maxima (load("mactex-utilities"), load("alt-display.mac")); (set_prompt('prefix, "prompt;>>",'suffix, "<<prompt;"), my_display(x):=(printf(true,"out;>>(~a) ~a~a~a~%<<out;",?cadr(x),"$$",tex1(?caddr(x)),"$$")), set_alt_display(2,my_display)) $ #end_src #+RESULTS: :RESULTS: $ ~/maxima/sandbox/git/maxima-code/maxima-local --init=/dev/null Maxima branch_5_44_base_272_g8dac75087 http://maxima.sourceforge.net using Lisp SBCL 2.1.1.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) (load("mactex-utilities"), load("alt-display.mac")); (%o1) /home/work/maxima/sandbox/git/maxima-code/share/contrib/alt-display/alt-\ display.mac (%i2) (set_prompt('prefix, "prompt;>>",'suffix, "<<prompt;"), my_display(x):=(printf(true,"out;>>(~a) ~a~a~a~%<<out;",?cadr(x),"$$",tex1(?caddr(x)),"$$")), set_alt_display(2,my_display)) $ prompt;>>(%i3) <<prompt;L: sqrt(1 - 1/(R^2)); out;>>(%o3) $$\sqrt{1-\frac{1}{R^2}}$$ <<out; prompt;>>(%i4) <<prompt;integrate(x, x, 0, L); prompt;>>Is R positive or negative? <<prompt; p; out;>>(%o4) $$\frac{R^2-1}{2\,R^2}$$ <<out; prompt;>>(%i5) <<prompt; :END: Leo |