[OS X TeX] sagetex and TeXShop
Sette Diop
settediop at gmail.com
Sun May 26 13:54:57 EDT 2013
Hello there!
There seems to be something broken in the automation of sagetex in TeXShop in recent updates.
Can someone out there help with this?
Thanks so much!
Sette
I just installed Sage (sage-5.9) in my MacBook Pro (Mac OS 10.8.3). I am using TeXShop 3.18.
- The source file is appended to this message
- The Engine drop-down menu is set to 'sage'.
The console says (among other things):
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex 2013.4.21) 26 MAY 2013 19:08
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**example.tex
(./example.tex
LaTeX2e <2011/06/27>
…
(~/Library/texmf/tex/latex/sagetex/sagetex.sty
Package: sagetex 2012/01/16 v2.3.3-69dcb0eb93de embedding Sage into LaTeX documents
…
No file example.sagetex.sout.
\sagecommandlineskip=\skip44
) (./example.aux)
\openout1 = `example.aux'.
…
\ST at sf=\write4
\openout4 = `example.sagetex.sage'.
...
LaTeX Warning: Reference `@sageinline0' on page 1 undefined on input line 9.
LaTeX Warning: Reference `@sageinline1' on page 1 undefined on input line 21.
LaTeX Warning: Reference `@sageinline2' on page 1 undefined on input line 21.
Package sagetex Warning: Graphics file sage-plots-for-example.tex/plot-0.pdf on
page 1 does not exist. Plot command is on input line 26.
*********************************************************************
Package sagetex Warning: there were undefined Sage formulas and/or plots.
Run Sage on example.sagetex.sage, and then run LaTeX on example.tex again.
*********************************************************************
How do I run Sage on sage_example.sage? Isn't TeXShop supposed to send
this to Sage and get output from Sage without my intervention?
- - - - - -
The whole source file is as below:
% !TEX TS-program = sage
\documentclass{article}
\usepackage{sagetex}
\begin{document}
Using Sage\TeX, one can use Sage to compute things and put them into your \LaTeX{} document.
For example, there are $\sage{number_of_partitions(1269)}$ integer partitions of $1269$.
You don't need to compute the number yourself, or even cut and paste it from somewhere.
Here's some Sage code:
\begin{sageblock}
f(x) = exp(x)*sin(2*x)
\end{sageblock}
The second derivative of $f$ is
\[
\frac{\mathrm{d}^{2}}{\mathrm{d}x^{2}} \sage{f(x)} = \sage{diff(f, x, 2)(x)}.
\]
Here's a plot of $f$ from $-1$ to $1$:
\sageplot{plot(f, -1, 1)}
\end{document}
When I run TeXShop here is the whole .sagetex.sage file:
## -*- encoding: utf-8 -*-
## This file (example.sagetex.sage) was *autogenerated* from example.tex with sagetex.sty version 2012/01/16 v2.3.3-69dcb0eb93de.
import sagetex
_st_ = sagetex.SageTeXProcessor('example', version='2012/01/16 v2.3.3-69dcb0eb93de', version_check=True)
try:
_st_.inline(0, latex(number_of_partitions(1269)))
except:
_st_.goboom(9)
_st_.blockbegin()
try:
f(x) = exp(x)*sin(2*x)
except:
_st_.goboom(16)
_st_.blockend()
try:
_st_.inline(1, latex(f(x)))
except:
_st_.goboom(21)
try:
_st_.inline(2, latex(diff(f, x, 2)(x)))
except:
_st_.goboom(21)
try:
_st_.plot(0, format='notprovided', _p_=plot(f, -1, 1))
except:
_st_.goboom(26)
_st_.endofdoc()
More information about the MacOSX-TeX
mailing list