Monday, February 8, 2010

How to use TeXmacs + Maxima under cygwin

TeXmacs is a great front-end for Maxima. Although both of them have native win32 port, the one for TeXmacs is no longer updated, and doesn't support some handy features such as directly inserting xfig figures etc. On the other hand, although TeXmacs has a updated version in cygwin, Maxima is not supported in cygwin.

In this post, I summarized how to make Texmacs in cygwin working with a native win32 Maxima.

  1. Install maxima-5.20.1.exe from to your preferred location (in my case, it's C:\Tools\Maxima-5.20.1").
  2. Add "C:\Tools\Maxima-5.20.1\bin" to PATH (right click "My Computer"->"Properties"->"Advanced"->"Environmental Variables").
  3. Install cygwin (select the following packages: xinit, texmacs, xfig, gvim) to your preferred location (in my case, it's C:\Tools\cygwin\)
  4. Open a cygwin shell, and type the following commands:
    cp /usr/share/TeXmacs/plugins/maxima/lisp/texmacs-maxima-5.9.2.lisp ~/texmacs.lisp
  5. Edit C:\Tools\cygwin\usr\share\TeXmacs\plugins\maxima\progs\init-maxima.scm, and in the last section, change the following line
    (:launch "maxima.bat -p texmacs.lisp")

  6. Now it's ready to go! Start Maxima in TeXmacs by Insert->Session->Maxima.


Anonymous said...

thank you for this help.
I completed all the step successfully but in my Texmacs gui, ther is no "maxima" in insert session. I don't know hows to proceed to get it ther.

can i get tips please... thank you.

Unknown said...

I would suggest the following:
(1) Check whether maxima is in your PATH. This can be done by opening a cmd window, and type "maxima", and see whether the program loads. If not, maybe you need a reboot for the environment variables to take effect.
(2) Is the maxima the one from cygwin?
(3) I found that the hack in the post only works if you start TeXmacs by entering the command "texmacs" in your home directory (where there is a copy of "texmacs.lisp"). So make sure you have a copy of texmacs.lisp at the directory you want to start texmacs.

Hope this helps.