Using SageTeX within WindowsCreate a local texmf tree in MiKTeXEmacs interacting with MS Windows: how to...
What is the evidence for the "tyranny of the majority problem" in a direct democracy context?
Why "had" in "[something] we would have made had we used [something]"?
15% tax on $7.5k earnings. Is that right?
Why can Carol Danvers change her suit colours in the first place?
A binary search solution to 3Sum
Why is it that I can sometimes guess the next note?
Calculate sum of polynomial roots
How do apertures which seem too large to physically fit work?
Why is so much work done on numerical verification of the Riemann Hypothesis?
Why is short-wave infrared portion of electromagnetic spectrum so sensitive to fire?
Does IPv6 have similar concept of network mask?
What exactly color does ozone gas have?
Did arcade monitors have same pixel aspect ratio as TV sets?
How can mimic phobia be cured?
PTIJ: Haman's bad computer
Make a Bowl of Alphabet Soup
Non-trope happy ending?
How much character growth crosses the line into breaking the character
How does a computer interpret real numbers?
Bridge building with irregular planks
What if you are holding an Iron Flask with a demon inside and walk into Antimagic Field?
Redundant comparison & "if" before assignment
How could a planet have erratic days?
Quoting Keynes in a lecture
Using SageTeX within Windows
Create a local texmf tree in MiKTeXEmacs interacting with MS Windows: how to minimize windowsTeXworks linux vs windowsHow to just print the calculation using sagetexIs it possible to call/reference sagetex within a latex command?How can i compare values from sagetex with ifthenelse?SageTeX: Number formattingSageTeX and Commenting Out CodeBug with optional arguments in sagetex?Integrating SageTex and Kile/TexStudio in LinuxEditors for Windows with automatic completion, environments etc
Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
windows sagetex
add a comment |
Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
windows sagetex
add a comment |
Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
windows sagetex
Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
windows sagetex
windows sagetex
asked Jan 31 '13 at 0:22
c05772c05772
512214
512214
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
INSTALLATION
- Install a virtualization software (VMWare, Virtual Box, Windows
Virtual PC) - Install a Debian Linux distribution (Mint 14 Cinnamon recommended as closest to the Windows look and feel)
- Share your TeX document directory between the host and the guest operating system with R/W rights
- Download and expand the latest sage package (Ubuntu 32 bit)
- "Install" sage in any user directory, sage being "portable", in windows parlance it is just a move of the directory
- Transfer the sage tex directory to the host operating system
- Make sage "known" to MikTeX, like any other new style or package
UTILIZATION
- "Miktexify" your *.tex file using the sagetex package with pdflatex,
- this generate a new *.sagetex.sage in your TeX directory and some warnings
- Open the guest operating system and start sage in a terminal
- Using a DOS, Linux command cd (change directory) at the sage prompt place the sage program in the shared Host/Guest Tex directory
- load (execute) sage your *.sagetex.sage file,
- this will generate two new files *.sagetex.scmd and *.sagetex.sout in your tx directory
- "Miktexify" your *.tex file again, the result of the sage computation will be written to your pdf output.
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
- Install VMWare player from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
- Install your favorite Linux distro (but if you read this, you are obviously not a
Linux fan so use Linux Mint 14 with Cinnamon, the closest to windows
so far). http://www.linuxmint.com/edition.php?id=117
- Install VMWare tools
Let suppose that your windows working Tex directory is C:DocumentsMaths 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 sage: prompt, test it with your favorite instruction, 2+2 may be, if you get 4 you are good to go.

Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories /home/usrx/sage55/local/share/texmf where you get a directory tex, right click and copy it.
From the same nemo double click File System then the icon mnt (mount) and then hgfs. If everything went OK, you should find there your windows directory, Maths shared between the host (Windows) and the guest (Mint 14).
In this directory you paste the tex directory copied from /home/usrx/sage55/local/share/texmf
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 C:Program FilesMiKTeX 2.9texlatexmodified , e.g.) so that you now have C:Program FilesMiKTeX 2.9texlatexmodifiedtex).
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
documentclass{article}
usepackage{sagetex}
begin{document}
Factoring $x^{12}-y^{12}$.
With Sage, for the rationals, we find
begin{sageblock}
L.<x,y>=LaurentPolynomialRing(QQ)
f=x^(12)-y^(12)
end{sageblock}
[sage{f.factor()}]
In the real domain we find
[x^{12}-y^{12}=(x+y)(x-y)left(x^2+y^2right)left(x^2+y^2+xyright)left(x^2+y^2- xyright)left(x^2+x y sqrt{3}+y^2right)left(x^2-x y sqrt{3}+y^2right).]
end{document}
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 ?? where the answer to the factorization should be.

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)

sage: cd /mnt/hgfs/Maths
(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
sage: load SageX.sagetex.sage
Processing Sage code for SageX.tex...
Code block begin...end
Inline formula 0
Sage processing complete. Run LaTeX on SageX.tex again.
Back to Windows. In C:DocumentsMaths, 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)...
sagetexcan be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.
– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
add a comment |
There is a way to use sagetex on windows:
Step 1: Install miktex 2.9, full install
Step 2: Install Texniccenter 2.02 (I think another
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f96107%2fusing-sagetex-within-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
INSTALLATION
- Install a virtualization software (VMWare, Virtual Box, Windows
Virtual PC) - Install a Debian Linux distribution (Mint 14 Cinnamon recommended as closest to the Windows look and feel)
- Share your TeX document directory between the host and the guest operating system with R/W rights
- Download and expand the latest sage package (Ubuntu 32 bit)
- "Install" sage in any user directory, sage being "portable", in windows parlance it is just a move of the directory
- Transfer the sage tex directory to the host operating system
- Make sage "known" to MikTeX, like any other new style or package
UTILIZATION
- "Miktexify" your *.tex file using the sagetex package with pdflatex,
- this generate a new *.sagetex.sage in your TeX directory and some warnings
- Open the guest operating system and start sage in a terminal
- Using a DOS, Linux command cd (change directory) at the sage prompt place the sage program in the shared Host/Guest Tex directory
- load (execute) sage your *.sagetex.sage file,
- this will generate two new files *.sagetex.scmd and *.sagetex.sout in your tx directory
- "Miktexify" your *.tex file again, the result of the sage computation will be written to your pdf output.
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
- Install VMWare player from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
- Install your favorite Linux distro (but if you read this, you are obviously not a
Linux fan so use Linux Mint 14 with Cinnamon, the closest to windows
so far). http://www.linuxmint.com/edition.php?id=117
- Install VMWare tools
Let suppose that your windows working Tex directory is C:DocumentsMaths 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 sage: prompt, test it with your favorite instruction, 2+2 may be, if you get 4 you are good to go.

Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories /home/usrx/sage55/local/share/texmf where you get a directory tex, right click and copy it.
From the same nemo double click File System then the icon mnt (mount) and then hgfs. If everything went OK, you should find there your windows directory, Maths shared between the host (Windows) and the guest (Mint 14).
In this directory you paste the tex directory copied from /home/usrx/sage55/local/share/texmf
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 C:Program FilesMiKTeX 2.9texlatexmodified , e.g.) so that you now have C:Program FilesMiKTeX 2.9texlatexmodifiedtex).
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
documentclass{article}
usepackage{sagetex}
begin{document}
Factoring $x^{12}-y^{12}$.
With Sage, for the rationals, we find
begin{sageblock}
L.<x,y>=LaurentPolynomialRing(QQ)
f=x^(12)-y^(12)
end{sageblock}
[sage{f.factor()}]
In the real domain we find
[x^{12}-y^{12}=(x+y)(x-y)left(x^2+y^2right)left(x^2+y^2+xyright)left(x^2+y^2- xyright)left(x^2+x y sqrt{3}+y^2right)left(x^2-x y sqrt{3}+y^2right).]
end{document}
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 ?? where the answer to the factorization should be.

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)

sage: cd /mnt/hgfs/Maths
(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
sage: load SageX.sagetex.sage
Processing Sage code for SageX.tex...
Code block begin...end
Inline formula 0
Sage processing complete. Run LaTeX on SageX.tex again.
Back to Windows. In C:DocumentsMaths, 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)...
sagetexcan be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.
– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
add a comment |
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.
INSTALLATION
- Install a virtualization software (VMWare, Virtual Box, Windows
Virtual PC) - Install a Debian Linux distribution (Mint 14 Cinnamon recommended as closest to the Windows look and feel)
- Share your TeX document directory between the host and the guest operating system with R/W rights
- Download and expand the latest sage package (Ubuntu 32 bit)
- "Install" sage in any user directory, sage being "portable", in windows parlance it is just a move of the directory
- Transfer the sage tex directory to the host operating system
- Make sage "known" to MikTeX, like any other new style or package
UTILIZATION
- "Miktexify" your *.tex file using the sagetex package with pdflatex,
- this generate a new *.sagetex.sage in your TeX directory and some warnings
- Open the guest operating system and start sage in a terminal
- Using a DOS, Linux command cd (change directory) at the sage prompt place the sage program in the shared Host/Guest Tex directory
- load (execute) sage your *.sagetex.sage file,
- this will generate two new files *.sagetex.scmd and *.sagetex.sout in your tx directory
- "Miktexify" your *.tex file again, the result of the sage computation will be written to your pdf output.
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
- Install VMWare player from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
- Install your favorite Linux distro (but if you read this, you are obviously not a
Linux fan so use Linux Mint 14 with Cinnamon, the closest to windows
so far). http://www.linuxmint.com/edition.php?id=117
- Install VMWare tools
Let suppose that your windows working Tex directory is C:DocumentsMaths 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 sage: prompt, test it with your favorite instruction, 2+2 may be, if you get 4 you are good to go.

Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories /home/usrx/sage55/local/share/texmf where you get a directory tex, right click and copy it.
From the same nemo double click File System then the icon mnt (mount) and then hgfs. If everything went OK, you should find there your windows directory, Maths shared between the host (Windows) and the guest (Mint 14).
In this directory you paste the tex directory copied from /home/usrx/sage55/local/share/texmf
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 C:Program FilesMiKTeX 2.9texlatexmodified , e.g.) so that you now have C:Program FilesMiKTeX 2.9texlatexmodifiedtex).
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
documentclass{article}
usepackage{sagetex}
begin{document}
Factoring $x^{12}-y^{12}$.
With Sage, for the rationals, we find
begin{sageblock}
L.<x,y>=LaurentPolynomialRing(QQ)
f=x^(12)-y^(12)
end{sageblock}
[sage{f.factor()}]
In the real domain we find
[x^{12}-y^{12}=(x+y)(x-y)left(x^2+y^2right)left(x^2+y^2+xyright)left(x^2+y^2- xyright)left(x^2+x y sqrt{3}+y^2right)left(x^2-x y sqrt{3}+y^2right).]
end{document}
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 ?? where the answer to the factorization should be.

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)

sage: cd /mnt/hgfs/Maths
(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
sage: load SageX.sagetex.sage
Processing Sage code for SageX.tex...
Code block begin...end
Inline formula 0
Sage processing complete. Run LaTeX on SageX.tex again.
Back to Windows. In C:DocumentsMaths, 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)...
sagetexcan be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.
– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
add a comment |
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.
INSTALLATION
- Install a virtualization software (VMWare, Virtual Box, Windows
Virtual PC) - Install a Debian Linux distribution (Mint 14 Cinnamon recommended as closest to the Windows look and feel)
- Share your TeX document directory between the host and the guest operating system with R/W rights
- Download and expand the latest sage package (Ubuntu 32 bit)
- "Install" sage in any user directory, sage being "portable", in windows parlance it is just a move of the directory
- Transfer the sage tex directory to the host operating system
- Make sage "known" to MikTeX, like any other new style or package
UTILIZATION
- "Miktexify" your *.tex file using the sagetex package with pdflatex,
- this generate a new *.sagetex.sage in your TeX directory and some warnings
- Open the guest operating system and start sage in a terminal
- Using a DOS, Linux command cd (change directory) at the sage prompt place the sage program in the shared Host/Guest Tex directory
- load (execute) sage your *.sagetex.sage file,
- this will generate two new files *.sagetex.scmd and *.sagetex.sout in your tx directory
- "Miktexify" your *.tex file again, the result of the sage computation will be written to your pdf output.
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
- Install VMWare player from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
- Install your favorite Linux distro (but if you read this, you are obviously not a
Linux fan so use Linux Mint 14 with Cinnamon, the closest to windows
so far). http://www.linuxmint.com/edition.php?id=117
- Install VMWare tools
Let suppose that your windows working Tex directory is C:DocumentsMaths 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 sage: prompt, test it with your favorite instruction, 2+2 may be, if you get 4 you are good to go.

Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories /home/usrx/sage55/local/share/texmf where you get a directory tex, right click and copy it.
From the same nemo double click File System then the icon mnt (mount) and then hgfs. If everything went OK, you should find there your windows directory, Maths shared between the host (Windows) and the guest (Mint 14).
In this directory you paste the tex directory copied from /home/usrx/sage55/local/share/texmf
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 C:Program FilesMiKTeX 2.9texlatexmodified , e.g.) so that you now have C:Program FilesMiKTeX 2.9texlatexmodifiedtex).
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
documentclass{article}
usepackage{sagetex}
begin{document}
Factoring $x^{12}-y^{12}$.
With Sage, for the rationals, we find
begin{sageblock}
L.<x,y>=LaurentPolynomialRing(QQ)
f=x^(12)-y^(12)
end{sageblock}
[sage{f.factor()}]
In the real domain we find
[x^{12}-y^{12}=(x+y)(x-y)left(x^2+y^2right)left(x^2+y^2+xyright)left(x^2+y^2- xyright)left(x^2+x y sqrt{3}+y^2right)left(x^2-x y sqrt{3}+y^2right).]
end{document}
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 ?? where the answer to the factorization should be.

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)

sage: cd /mnt/hgfs/Maths
(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
sage: load SageX.sagetex.sage
Processing Sage code for SageX.tex...
Code block begin...end
Inline formula 0
Sage processing complete. Run LaTeX on SageX.tex again.
Back to Windows. In C:DocumentsMaths, 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)...
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.
INSTALLATION
- Install a virtualization software (VMWare, Virtual Box, Windows
Virtual PC) - Install a Debian Linux distribution (Mint 14 Cinnamon recommended as closest to the Windows look and feel)
- Share your TeX document directory between the host and the guest operating system with R/W rights
- Download and expand the latest sage package (Ubuntu 32 bit)
- "Install" sage in any user directory, sage being "portable", in windows parlance it is just a move of the directory
- Transfer the sage tex directory to the host operating system
- Make sage "known" to MikTeX, like any other new style or package
UTILIZATION
- "Miktexify" your *.tex file using the sagetex package with pdflatex,
- this generate a new *.sagetex.sage in your TeX directory and some warnings
- Open the guest operating system and start sage in a terminal
- Using a DOS, Linux command cd (change directory) at the sage prompt place the sage program in the shared Host/Guest Tex directory
- load (execute) sage your *.sagetex.sage file,
- this will generate two new files *.sagetex.scmd and *.sagetex.sout in your tx directory
- "Miktexify" your *.tex file again, the result of the sage computation will be written to your pdf output.
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
- Install VMWare player from https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
- Install your favorite Linux distro (but if you read this, you are obviously not a
Linux fan so use Linux Mint 14 with Cinnamon, the closest to windows
so far). http://www.linuxmint.com/edition.php?id=117
- Install VMWare tools
Let suppose that your windows working Tex directory is C:DocumentsMaths 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 sage: prompt, test it with your favorite instruction, 2+2 may be, if you get 4 you are good to go.

Now, using Nemo, (here Windows users can read Explorer, the file icon at the bottom of the screen) open the directories /home/usrx/sage55/local/share/texmf where you get a directory tex, right click and copy it.
From the same nemo double click File System then the icon mnt (mount) and then hgfs. If everything went OK, you should find there your windows directory, Maths shared between the host (Windows) and the guest (Mint 14).
In this directory you paste the tex directory copied from /home/usrx/sage55/local/share/texmf
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 C:Program FilesMiKTeX 2.9texlatexmodified , e.g.) so that you now have C:Program FilesMiKTeX 2.9texlatexmodifiedtex).
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
documentclass{article}
usepackage{sagetex}
begin{document}
Factoring $x^{12}-y^{12}$.
With Sage, for the rationals, we find
begin{sageblock}
L.<x,y>=LaurentPolynomialRing(QQ)
f=x^(12)-y^(12)
end{sageblock}
[sage{f.factor()}]
In the real domain we find
[x^{12}-y^{12}=(x+y)(x-y)left(x^2+y^2right)left(x^2+y^2+xyright)left(x^2+y^2- xyright)left(x^2+x y sqrt{3}+y^2right)left(x^2-x y sqrt{3}+y^2right).]
end{document}
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 ?? where the answer to the factorization should be.

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)

sage: cd /mnt/hgfs/Maths
(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
sage: load SageX.sagetex.sage
Processing Sage code for SageX.tex...
Code block begin...end
Inline formula 0
Sage processing complete. Run LaTeX on SageX.tex again.
Back to Windows. In C:DocumentsMaths, 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)...
edited Feb 1 '13 at 19:25
answered Jan 31 '13 at 0:22
c05772c05772
512214
512214
sagetexcan be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.
– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
add a comment |
sagetexcan be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.
– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
sagetex can be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.– Speravir
Mar 1 '13 at 1:52
sagetex can be installed with the package manager in MiKTeX. I cannot judge, though, whether this is the recent version; otherwise regarding “transfer sage directory and make sage known to MiKTeX” I want to point to Create a local texmf tree in MiKTeX. And: For Sage there exists a Windows binary, what actually is a VirtualBox image, as written by you.– Speravir
Mar 1 '13 at 1:52
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
I would like to add that this wasn't sufficient for me to work. Sage could not compile plots. Running " sudo apt-get install python-numpy " in the terminal got me what was missing and now it works. But thanks for the step by step tutorial.
– Jean-Sébastien
Feb 6 '14 at 22:57
add a comment |
There is a way to use sagetex on windows:
Step 1: Install miktex 2.9, full install
Step 2: Install Texniccenter 2.02 (I think another
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
There is a way to use sagetex on windows:
Step 1: Install miktex 2.9, full install
Step 2: Install Texniccenter 2.02 (I think another
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
There is a way to use sagetex on windows:
Step 1: Install miktex 2.9, full install
Step 2: Install Texniccenter 2.02 (I think another
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
There is a way to use sagetex on windows:
Step 1: Install miktex 2.9, full install
Step 2: Install Texniccenter 2.02 (I think another
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 2 mins ago
Pedro Jose Moreno GarciaPedro Jose Moreno Garcia
1
1
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Pedro Jose Moreno Garcia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f96107%2fusing-sagetex-within-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown