[Solved] Cannot get sage plugin to work

I am using TexMacs 2.1, SageMath 9.2 on Windows 10 64-bit pro.

I copied the sage plugin files from TexMacs’ plugins github page, and copied the files to %APPDATA%\TeXmacs\plugins\sage\

I have the following file/folders under C:\Users\Amir\AppData\Roaming\TeXmacs\plugins\sage\ :

docs - progs - README.md

But when I go to Insert -> Session , I do not see a Sage session listed… What did I do wrong ?

Many Thanks

Hi @l3gi0n and welcome to the forum—I have seen your message on the mailing list too, but I have been slow to respond there.

After a bit of playing around I have been able to start a session, but I do not know what are the conditions under which it works, so I may offer you only to do some tests on your system (maybe we are lucky and figure out what is not working).

The first thing to try is from the menu Tools->Update->Plugins a few times. If that works, nice :slight_smile:

If it does not work: can you start a Scheme session and run the following command

(url-exists? (sagemath-win-app-url))

and write here the output?

I did that a few times and closed/reopenned Texmacs a few times too and sage is still not listed at insert-> sessions

Here is the output of what you requested:

Perhaps we are onto the reason for the non-functionality. Could you now do

(sagemath-win-app-url)

and check whether the file path you get in output exists in your hard drive?

it doesn’t show any paths to any files:

Ok, we need to fix that. What is the installation path of Sage in your computer?

My Sagemath installation folder is located at:

B:\SageMath 9.2\

Ok. Now (perhaps after having made a copy of the original init-sage.scm file) please substitute this definition for the definition of (sagemath-win-app-url) in init-sage.scm (inside the progs directory)

(define (sagemath-win-app-url) (url-resolve "B:/SageMath*" "r"))

If the different path is the only reason why TeXmacs does not offer a Sage session, you could have it with this substitution.

Ok I edited init-sage.scm and copied the sage folder into 2 places:

(1) C:\Users\Amir\AppData\Roaming\TeXmacs\plugins\
(2) B:\TeXmacs\plugins\

Here is what I get:

But I still do not get a SageMath item at Insert -> Session

here is my init-sage.scm.

Maybe we can investigate more tomorrow (or perhaps some other forum participant has ideas!). I think that you do not need to insert the path of your Sage installation anywhere else, but I might be missing something. In the meantime, make sure to do the updating (Tools->Update->Plugins) a few more times (that might be necessary too).

1 Like

I did (Tools->Update->Plugins) a few more times and Sage showed up in Insert -> Session … and it is working well now

Thank you so much for you help.

Nice! Perhaps I shall submit a pull request for a modification of the Readme file in the repository (or maybe the right change of the plugin is another one, I need to think).

1 Like