Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
After experimenting, I suggest the following method. It is based on MikTex 2.9, TeXnicCenter, VMWare player (this one is free for home use), Linux Mint 14 with Cinnamon and of course Sage 5.5. It should be similar if you use VirtualBox. The goal was to use windows as most as possible and linux as little as possible, there is no need here to install TexLive in the virtual machine and to coordinate it with MikTeX.
The big picture is this one, it should be enough for a windows geek, it is followed by a more detailed explanantion.
The result is just great, really worth the installation effort, it will improve the quality of your document avoiding typos in long expressions.
In the following modus operandi, the places where the Sage documentation is insufficient or not up to date are more detailed
Let suppose that your windows working Tex directory is C:\Documents\Maths and your name is usrx
Within VMWare Virtual Machine Settings, tab Options Enable Shared Folders, always enable, uncheck the read only case in properties (the default is RW so it should not be necessary). In the Hardware tab for network adapter use NAT.
Download the package "sage-5.5-linux-32bit-ubuntu_12.04.1_lts-i86-Linux.tar.lzma" from http://www.sagemath.org/download.html and expand it (as a you would do in windows..) in your user directory /home/usrx, rename the directory to sage55 to make it short.
You now have sage installed in the directory /home/usrx/sage55, test it by double clicking the sage icon, choosing run in a terminal (let the directory update run its course)
When you get the
Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories
From the same nemo double click File System then the icon
In this directory you paste the
Now, we get back to windows but do not close the virtual machine, neither the sage terminal, you will use it for sagetex.
Using Administrator rights copy again this directory to your MikTeX installation with your other particular styles for example (I use one called modified
Update MikTex from the program menu, with the Maintenance (Admin) Setting(admin) Refresh FNDB button as usual.
Now we can try to use sagetex.
From TeXnicCenter, create a sample tex file, such as this one
call it SageX.tex, e.g.
Build and view your file once. You will have warnings about unreferenced sage items
and in your /mnt/hgfs/Maths directory, you will find a new file called SageX.sagetex.sage (NOT SageX.sage). The pdf file will have
Go back to the virtual machine, to the sage terminal and sage prompt (sage:) There you need to type a linux instruction followed by return, (Here the sage manual says that a linux instruction should be typed !cd but this does not work)
(change to the share windowslinux directory), you should see this answer /mnt/hgfs/Maths Now type the instruction sage: load SageX.sagetex.sage If all went well you will get the answer
Back to Windows. In C:\Documents\Maths, you have two new files SageX.sagetex.scmd and SageX.sagetex.sout. Run TeXnicCenter again, you should have no more warnings and the factorization of the polynomial in the rationals, computed by sage, will have replaced the
Note that as long as you do not modify the sage instruction, you don't need to run sage again, you can modify your text or add new LaTeX code within windows as long as you don't add (or modify) new sage code (or as long as you delete the three *.sage, *.scmd and *.sout files).
Sagetex is a great product so my hope is that some windows users will try the process and be convinced by the product (and also help in improving this text)...