Adding MMA Mathematica plugin on Windows

As far as I can see, https://github.com/hammerfunctor/tm-mathematica is the only way to use Mathematica inside TeXmacs on Windows.

I downloaded the zip file to the TeXmacs plugin folder on Windows and renamed it to mma as stated in the instructions on GitHub.
Moreover, I ran the menu entry Tools > Update > Plugins.

Running

(url-exists-in-path? "wolframscript")

returns #t, indicating that TeXmacs can find the code.

However, there is no menu entry like Mathematica in the Insert > Session menu.

Maybe @sharkc has an idea which additional diagnostics I could run to pin down the problem.

I carefully read http://forum.texmacs.cn/t/texmacs-unable-to-run-mma-mathematica-plugin-in-mac-m2/2015, but this shouldn’t affect Windows.

The plugin 's name is mma. Could you look for that entry in the Insert > Session menu?

No, excuse me, I should have mentioned this.
I can only see the Options for Scheme, R and MATLAB.
Scheme sessions are the only ones which work.

I tried it with both Windows and Linux Ubuntu and it worked for me in both cases.

On Windows, the mma menu entry did not appear at program startup. I run the the menu entry Tools > Update > Plugins four times and it appeared, but checked for the menu entry only after the fourth time.

I am using TeXmacs version 2.1.2 on Windows, 2.1.4 on Linux.

Could you try updating the plugins a few times—in case it helps? If not, I think we can try some debugging.

Try (supports-mma?). Unbound variable means it doesn’t detect files while #t or #f tell you conditions are met or not.

Thanks @pireddag and @sharkc for your comments.

Updating the plugins multiple times doesn’t make any difference.

Indeed, (supports-mma?) returns Unbound variable.

I’m also struggling a bit, because on Windows I can’t see the status bar. On my Linux computer I can see it.

I installed Octave on my Windows computer to ensure that it would correctly activate the corresponding plugin and it worked.

If you’re pretty sure those files are sitting where they should be, try to run the setup program with texmacs -S. If it still does not work, try to reboot your PC. That’s all I can say about this situation.

Thanks nonetheless.

I found some interesting information on http://forum.texmacs.cn/t/install-texmacs-with-maxima-on-mac-with-m1/614/51.
It is actually about the Maxima plugin on Mac OS, but there are some generally helpful hints about debugging plugins.

Here I understand that the files @sharkc is referring to are Scheme files belonging to TeXmacs. The fact that TeXmacs is not detecting them means “something is wrong with the TeXmacs installation”. @sharkc please correct me if I am wrong.

Sorry I should be more specific. I was saying TeXmacs is not aware the files associated to mma plugin. And since @SausageDog cannot even see the status bar, there are definitely some problems with the TeXmacs installation. There are a couple of things to do:

  • try some of the latest builds from https://www.texmacs.org/builds/ until TeXmacs, by itself, behaves as expected (status bar is shown and so on)
  • if TeXmacs works well but the mma plugin doesn’t, start TeXmacs with the command line parameter texmacs -S, which refresh some caches that could cause problems
  • if the plugin still doesn’t work, first close TeXmacs, delete the whole dir mma, and re-download and unpack it. look into your plugins/mma/progs/init-mma.scm to make sure everything is normal.

Along the way, please always start TeXmacs from a command line environment so that you can see errors and warnings in the first place

If @SausageDog is on Windows, here is how to see error messages: https://texmacs.github.io/notes/docs/windows-output-error.html

Running the latest Windows build from https://www.texmacs.org/builds/ works with an error message about the Jupyter plugin. (It disappears when removing the corresponding plugin folder)

The Insert tab shows now a limited number of only around 5 menu items with the Insert menu being no longer present.

Running TeXmacs via PowerShell as in

Start-Process -FilePath "C:\Users\AK126250\AppData\Local\Programs\TeXmacs\bin\texmacs.exe" -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt

works and creates an stderr.txt file, but this file is empty.

Further messages

PS C:\Users\user\AppData\Roaming\TeXmacs\plugins\mma> Executable directory is: C:\Users\user\AppData\Local\Programs\TeXmacs\bin
TEXMACS_PATH is autoset to: C:\Users\user\AppData\Local\Programs\TeXmacs
TeXmacs] With linked TrueType support

PS C:\Users\user\AppData\Roaming\TeXmacs\plugins\mma> QThreadStorage: entry 2 destroyed before end of thread 0x20d8cc7c950
QThreadStorage: entry 1 destroyed before end of thread 0x20d8cc7c950

Please don’t invest too much time in this issue:
In the end, its about calling a proprietary program (Mathematica) on a proprietary OS (Windows).

Calling Maxima and all the other beautiful open source CAS systems on Linux works perfectly well!

I don’t have the feeling that the malfunctioning comes from both Windows and Mathematica being proprietary programs, and I’d still try to debug.

Does your mma directory in the plugin directory of TeXmacs personal files look like this?

1 Like

It works!

After having tried on a University administered notebook (Windows 11), I finally got it running on my private one (Windows 10).

I would but happy to tell the difference making it work, but I can’t: Installation paths and approach were exactly the same. Maybe a permission issue? This is the problem I was referring to with proprietary software.

Thanks @pireddag for patiently anwering my questions and to @sharkc for developing the plugin.
Please apologize taking your time.

1 Like

There is no need for apologies. Here anyone answers if they want to answer, and no one is forced to.