ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 23 Jun 2012 05:35:10 +0200How "run a .sage file"?https://ask.sagemath.org/question/8915/how-run-a-sage-file/I'm trying to use the sagetex style file in LaTeX. After trying to process the example.tex file provided with sagetex, I get error messages in the log that say to "Run Sage on example.sagetex.sage".
On my OS X system, Sage is installed as a clickable .app. After I start the app, I know how to start a Terminal command session of Sage by using the right-click menu from the Sage icon in the dock.
But how do I process such a .sage file in there?Sun, 22 Apr 2012 15:56:12 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/Answer by Ivan Andrus for <p>I'm trying to use the sagetex style file in LaTeX. After trying to process the example.tex file provided with sagetex, I get error messages in the log that say to "Run Sage on example.sagetex.sage".</p>
<p>On my OS X system, Sage is installed as a clickable .app. After I start the app, I know how to start a Terminal command session of Sage by using the right-click menu from the Sage icon in the dock.</p>
<p>But how do I process such a .sage file in there?</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?answer=13498#post-id-13498If you just double-click the sage file that will run it with Sage.app.
If you use Emacs and AUCTeX, then I'm working on support for automatically detecting and running Sage as necessary, together with support for automatically finding the sage executable in Sage.app.Wed, 25 Apr 2012 13:57:12 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?answer=13498#post-id-13498Answer by John Palmieri for <p>I'm trying to use the sagetex style file in LaTeX. After trying to process the example.tex file provided with sagetex, I get error messages in the log that say to "Run Sage on example.sagetex.sage".</p>
<p>On my OS X system, Sage is installed as a clickable .app. After I start the app, I know how to start a Terminal command session of Sage by using the right-click menu from the Sage icon in the dock.</p>
<p>But how do I process such a .sage file in there?</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?answer=13489#post-id-13489If your Sage app is `/Applications/Sage.app`, for example, then from a Terminal window, run
$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
You can instead add the directory `/Applications/Sage.app/Contents/Resources/sage` to your `$PATH`, and then you'll be able to do
$ sage example.sagetex.sage
Actually, once you add the sage directory to your `$PATH`, if you have [latexmk](http://www.phys.psu.edu/~collins/software/latexmk-jcc/), you can just do
$ latexmk example.tex
and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).
Sun, 22 Apr 2012 23:04:42 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?answer=13489#post-id-13489Comment by T. Verron for <p>If your Sage app is <code>/Applications/Sage.app</code>, for example, then from a Terminal window, run</p>
<pre><code>$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
</code></pre>
<p>You can instead add the directory <code>/Applications/Sage.app/Contents/Resources/sage</code> to your <code>$PATH</code>, and then you'll be able to do</p>
<pre><code>$ sage example.sagetex.sage
</code></pre>
<p>Actually, once you add the sage directory to your <code>$PATH</code>, if you have <a href="http://www.phys.psu.edu/~collins/software/latexmk-jcc/">latexmk</a>, you can just do</p>
<pre><code>$ latexmk example.tex
</code></pre>
<p>and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19523#post-id-19523On my machine, this setting (with others) was also available in `[TexLive2011Path]/texmf-dist/doc/support/latexmk/example_rcfiles `Sat, 23 Jun 2012 05:19:26 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19523#post-id-19523Comment by Ivan Andrus for <p>If your Sage app is <code>/Applications/Sage.app</code>, for example, then from a Terminal window, run</p>
<pre><code>$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
</code></pre>
<p>You can instead add the directory <code>/Applications/Sage.app/Contents/Resources/sage</code> to your <code>$PATH</code>, and then you'll be able to do</p>
<pre><code>$ sage example.sagetex.sage
</code></pre>
<p>Actually, once you add the sage directory to your <code>$PATH</code>, if you have <a href="http://www.phys.psu.edu/~collins/software/latexmk-jcc/">latexmk</a>, you can just do</p>
<pre><code>$ latexmk example.tex
</code></pre>
<p>and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19866#post-id-19866I should have thought to look there. Thanks.Wed, 25 Apr 2012 13:58:33 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19866#post-id-19866Comment by John Palmieri for <p>If your Sage app is <code>/Applications/Sage.app</code>, for example, then from a Terminal window, run</p>
<pre><code>$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
</code></pre>
<p>You can instead add the directory <code>/Applications/Sage.app/Contents/Resources/sage</code> to your <code>$PATH</code>, and then you'll be able to do</p>
<pre><code>$ sage example.sagetex.sage
</code></pre>
<p>Actually, once you add the sage directory to your <code>$PATH</code>, if you have <a href="http://www.phys.psu.edu/~collins/software/latexmk-jcc/">latexmk</a>, you can just do</p>
<pre><code>$ latexmk example.tex
</code></pre>
<p>and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19868#post-id-19868Hmm. I seem to have some customizations in my .latexmkrc file, apparently downloaded from https://bitbucket.org/ddrake/sagetex/wiki/UsingSageTeX. Wed, 25 Apr 2012 11:27:51 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19868#post-id-19868Comment by Ivan Andrus for <p>If your Sage app is <code>/Applications/Sage.app</code>, for example, then from a Terminal window, run</p>
<pre><code>$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
</code></pre>
<p>You can instead add the directory <code>/Applications/Sage.app/Contents/Resources/sage</code> to your <code>$PATH</code>, and then you'll be able to do</p>
<pre><code>$ sage example.sagetex.sage
</code></pre>
<p>Actually, once you add the sage directory to your <code>$PATH</code>, if you have <a href="http://www.phys.psu.edu/~collins/software/latexmk-jcc/">latexmk</a>, you can just do</p>
<pre><code>$ latexmk example.tex
</code></pre>
<p>and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19869#post-id-19869I didn't know latexmk will run sage for you. Does it need special configuration, because the one I have installed (from MacTeX) doesn't seem to do it automatically?Wed, 25 Apr 2012 04:52:09 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19869#post-id-19869Comment by T. Verron for <p>If your Sage app is <code>/Applications/Sage.app</code>, for example, then from a Terminal window, run</p>
<pre><code>$ /Applications/Sage.app/Contents/Resources/sage/sage example.sagetex.sage
</code></pre>
<p>You can instead add the directory <code>/Applications/Sage.app/Contents/Resources/sage</code> to your <code>$PATH</code>, and then you'll be able to do</p>
<pre><code>$ sage example.sagetex.sage
</code></pre>
<p>Actually, once you add the sage directory to your <code>$PATH</code>, if you have <a href="http://www.phys.psu.edu/~collins/software/latexmk-jcc/">latexmk</a>, you can just do</p>
<pre><code>$ latexmk example.tex
</code></pre>
<p>and it will run LaTeX and sage as many times as needed for the document (and also bibtex and any other needed TeX components).</p>
https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19522#post-id-19522I would also add `push @generated_exts, "sage";`to the .latexmkrc file, it should prevent latexmk from trying to run sage on the .sage file before the first latex run (useful in case there was a syntax error in your sage code for example).Sat, 23 Jun 2012 05:35:10 +0200https://ask.sagemath.org/question/8915/how-run-a-sage-file/?comment=19522#post-id-19522