ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 22 Mar 2019 16:42:53 -0500How to use Sagetex with windows?http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/Installed Virtual Box on my computer to run Sage-8.0.
Used MiKTeX_2.9;
For me, the following code:
----------
\documentclass{article}
\usepackage{sagetex}
\begin{document}
For example, there are
$\sage{number_of_partitions(1269)}$
integer partitions of $1269$.
\end{document}
----------
Gives this output:
For example, there are ?? integer partitions of 1269.
----------
Can anyone please give me a specific tutorial to fix this?
Much appreciated!!!
Mon, 27 Nov 2017 03:14:02 -0600http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/Answer by Arensoft for <p>Installed Virtual Box on my computer to run Sage-8.0.
Used MiKTeX_2.9;</p>
<p>For me, the following code:</p>
<hr>
<pre><code>\documentclass{article}
\usepackage{sagetex}
\begin{document}
For example, there are
$\sage{number_of_partitions(1269)}$
integer partitions of $1269$.
\end{document}
</code></pre>
<hr>
<p>Gives this output:</p>
<p>For example, there are ?? integer partitions of 1269.</p>
<hr>
<p>Can anyone please give me a specific tutorial to fix this?
Much appreciated!!!</p>
http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?answer=45876#post-id-45876There is a way to use sagetex on windows:
Step 1: Install miktex 2.9 64-bit, full install.
Step 2: Install Texniccenter 2.02 64-bit (I think another program like texworks, texmaker, winedt, etc will work).
Step 3: Install Sagemath 8.6 64-bit or better.
Step 4: Sagetex version in miktex is different to sagetex version in Sagemath 8.6. Then you should install in miktex same version of sagetex as you have in Sagemath.
This can be done copying al files in **c:\Program Files\SageMath 8.6\runtime\opt\sagemath-8.6\local\share\texmf\tex\latex\sagetex\** into **c:\Program Files\MiKTeX 2.9\tex\latex\sagetex\**
Now using sagetex on windows is possible according this:
1.- Use texniccenter to compile your .tex document. Remember you have to load sagetex package: *\usepackage{sagetex}*
2.- Sagemath installation on windows has 3 shotcurts. You should open **Sagemath 8.6**, not **Sagemath 8.6 Shell** or **Sagemat 8.6 Notebook**. Remember, **Sagemath 8.6**. After that a shell is opened and when we see **sage:**, sagemath is ready.
3.- Navigate to folder where our files are using "cd" command, like *cd documents*. Is important, if your folder's name has spaces placing it between ' ', i.e. *cd 'folder 1'*
4.- When you are into your destination folder, you can see its contents with "ls". There should be your sagetex.sage file. To process the file you have to write **load(file.sagetex.sage')** (file is the name of your .tex file) and the procces will start when you press enter.
5.- Finaly, use texniccenter to compile again the .tex file.
When you need to use again sage, you don't need to write the command, because using up arrow on your keyboard will apear the command and you only have to press enter.
I think will be possible automatize 3 steps using postprocessor on texniccenter, but I don't know how to do it right now.Fri, 22 Mar 2019 16:42:53 -0500http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?answer=45876#post-id-45876Answer by Emmanuel Charpentier for <p>Installed Virtual Box on my computer to run Sage-8.0.
Used MiKTeX_2.9;</p>
<p>For me, the following code:</p>
<hr>
<pre><code>\documentclass{article}
\usepackage{sagetex}
\begin{document}
For example, there are
$\sage{number_of_partitions(1269)}$
integer partitions of $1269$.
\end{document}
</code></pre>
<hr>
<p>Gives this output:</p>
<p>For example, there are ?? integer partitions of 1269.</p>
<hr>
<p>Can anyone please give me a specific tutorial to fix this?
Much appreciated!!!</p>
http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?answer=39819#post-id-39819To get the result you expect from Sage\TeX (e. g. in a file named tex.foo), you have to :
1. \LaTeX your .tex file (i. e. ```pdflatex foo.tex``` : the ```\sagexxx``` macros will generate a Sage program ```foo.sagetex.sage``` and (via the ```foo.aux``` file) leave _references_ to the sage outputs, which are yet to be generated ; these (unfilled) references will print as ```??``` in the output file.
2. Execute your Sage program (i. e. ```sage foo.sagetex.sage```). This will compute the outputs, place them in specific files, and, IIRC, update the ```foo.aux``` file.
3. Re-\LaTeX your .tex file ; now that the Sage outputs exist and are referenceg in ```foo.aux```, they will be inserted in your output PDF.
All of this is well-documented in ```$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/sagetex.tex``` ; reading and modifying ```$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/example.tex``` is also useful.
Now, since you use MikTeX (a Windows port of \LaTeX), you have to work both from Windows (to execute ```pdflatex```) and from the Linux VM (to run ```sage```), unless you have managed to create a Windows link able to call Sage from a Windows command line. Thes two have to work on the same directory (for example by creating a shared directory and ```cd```ing to it from both sides).
HTH,Mon, 27 Nov 2017 09:51:26 -0600http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?answer=39819#post-id-39819Comment by ortollj for <p>To get the result you expect from Sage\TeX (e. g. in a file named tex.foo), you have to :</p>
<ol>
<li><p>\LaTeX your .tex file (i. e. <code>pdflatex foo.tex</code> : the <code>\sagexxx</code> macros will generate a Sage program <code>foo.sagetex.sage</code> and (via the <code>foo.aux</code> file) leave _references_ to the sage outputs, which are yet to be generated ; these (unfilled) references will print as <code>??</code> in the output file.</p></li>
<li><p>Execute your Sage program (i. e. <code>sage foo.sagetex.sage</code>). This will compute the outputs, place them in specific files, and, IIRC, update the <code>foo.aux</code> file.</p></li>
<li><p>Re-\LaTeX your .tex file ; now that the Sage outputs exist and are referenceg in <code>foo.aux</code>, they will be inserted in your output PDF.</p></li>
</ol>
<p>All of this is well-documented in <code>$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/sagetex.tex</code> ; reading and modifying <code>$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/example.tex</code> is also useful.</p>
<p>Now, since you use MikTeX (a Windows port of \LaTeX), you have to work both from Windows (to execute <code>pdflatex</code>) and from the Linux VM (to run <code>sage</code>), unless you have managed to create a Windows link able to call Sage from a Windows command line. Thes two have to work on the same directory (for example by creating a shared directory and <code>cd</code>ing to it from both sides).</p>
<p>HTH,</p>
http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?comment=41111#post-id-41111what do you mean by 1.\LaTeX your .tex file ??
what command do I have to use ?
(I'm under the prompt sage: in a command shell SageMath Linux VM)
I would like to create a pdf from the file example.tex
sage: pwd
u'/home/sage/sage-8.0/local/share/texmf/tex/latex/sagetex'
sage:Wed, 14 Feb 2018 00:49:46 -0600http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?comment=41111#post-id-41111Comment by PHPirates for <p>To get the result you expect from Sage\TeX (e. g. in a file named tex.foo), you have to :</p>
<ol>
<li><p>\LaTeX your .tex file (i. e. <code>pdflatex foo.tex</code> : the <code>\sagexxx</code> macros will generate a Sage program <code>foo.sagetex.sage</code> and (via the <code>foo.aux</code> file) leave _references_ to the sage outputs, which are yet to be generated ; these (unfilled) references will print as <code>??</code> in the output file.</p></li>
<li><p>Execute your Sage program (i. e. <code>sage foo.sagetex.sage</code>). This will compute the outputs, place them in specific files, and, IIRC, update the <code>foo.aux</code> file.</p></li>
<li><p>Re-\LaTeX your .tex file ; now that the Sage outputs exist and are referenceg in <code>foo.aux</code>, they will be inserted in your output PDF.</p></li>
</ol>
<p>All of this is well-documented in <code>$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/sagetex.tex</code> ; reading and modifying <code>$SAGE_ROOT/local/share/texmf/tex/latex/sagetex/example.tex</code> is also useful.</p>
<p>Now, since you use MikTeX (a Windows port of \LaTeX), you have to work both from Windows (to execute <code>pdflatex</code>) and from the Linux VM (to run <code>sage</code>), unless you have managed to create a Windows link able to call Sage from a Windows command line. Thes two have to work on the same directory (for example by creating a shared directory and <code>cd</code>ing to it from both sides).</p>
<p>HTH,</p>
http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?comment=40161#post-id-40161FYI, Sagemath 8 is ported to Windows, released this summer :)Thu, 14 Dec 2017 12:01:59 -0600http://ask.sagemath.org/question/39812/how-to-use-sagetex-with-windows/?comment=40161#post-id-40161