[Maxima] TeXmacs can't render Maxima matrix very well

Update: All right, I tried to configure TeXmacs and Maxima again under windows system. The result is still the same. It is worth noting that the version of Maxima under Windows is 5.42.2 which is different from the version under manjaro. So I can probably be sure that the problem lies in the TeXmacs link.

I’m using TeXmacs as the front-end of Maxima to learn symbolic mathmatical equation. By using Maxima plugin session, every symbol generayed by Maxima is renderd by TeXmacs very well. When I test the symbolic matrix part, I find a showing problem about Maxima symbolic matrix. The problem is shown in the picture below. As you can see that the output 3(%o3) and output 4(%o4) are great, except output 2, the right answer is included in the unknown codes.
And here is some extra information about my Maxima and system:

Maxima version:

My operating system:

Is there any fellow who can help me solve this problem? Thank a lot !!!

Do not know how to solve this, but maybe I can give a useful piece of information: with Maxima 5.41.0 (so an earlier version than the one the OP is using) it works. Here is a screenshot:


Debian Unstable, Maxima 5.42.1

The matrix does not render correctly too.

I suggest that you should use an older Maxima version (< 5.42.0). I have no experience of common lisp and have no idea how to fix it.

Tomio Arisaka(@tomio-arisaka) once created a Pull Request on the maxima plugin. I think he is the right guy to fix it.

@marduk I wonder if you are able to fix it.

Maxima 5.42 changed the LaTeX output of matrices. Adding the following code to ~/.TeXmacs/plugins/maxima/lisp/texmacs-maxima.lisp matrices render correctly again:

(defprop $matrix tex-matrix tex)

(defun tex-matrix(x l r) ;;matrix looks like ((mmatrix)((mlist) a b) ...)
  (append l `("\\pmatrix{")
          (mapcan #'(lambda(y)
                      (tex-list (cdr y) nil (list "\\cr ") "&"))
                  (cdr x))
          '("}") r))

@sadhen I would recommend including this code (which I extracted from Maxima 5.40) in the Maxima plugin


Thank you very much!
I checked the path “~/.TeXmacs/plugins/”, and I surprisingly found that under the path is totally empty :cry::cry:, did I miss installed somthing?
Again, thanks for your advice about the rendering problem!

OK, I got it, I need to install the Maxima plugin for TeXmacs from github to override the system one, thank you pal, I have learned a lot.

@marduk Thanks, I have verified your fix and committed.

@zhm There are tricks to make @marduk 's patch work.

For you, just install maxima according to https://github.com/texmacs/maxima .

This is the full patch: https://github.com/texmacs/maxima/commit/b623287cb8706438a1bfab064e1d4115a55a1b6b

We have to check if $TEXMACS_HOME_PATH/plugins/maxima exists and launch the user’s texmacs-maxima.lisp instead of the system’s.

@sadhen Thank you so much! I have been struggling on this issue for almost a week. :grinning:

Last question I promise :grin:, Should I set the "$TEXMACS_HOME_PATH "in my .zshrc file?

No need. Just clone the repo and it will work as expected.