-% Copyright (C) 200~~8~~ by Dan Drake <ddrake@member.ams.org>

+% Copyright (C) 2009 by Dan Drake <ddrake@member.ams.org>

% -------------------------------------------------------

% See the "Copying and licenses" section at the end of this file for the

%<latex>\NeedsTeXFormat{LaTeX2e}

%<latex>\ProvidesPackage{sagetex}

- [2008/~~12/18~~ v2.0 embedding Sage into LaTeX documents]

+ [2008/01/09 v2.0 embedding Sage into LaTeX documents]

% \changes{v2.0}{2008/12/16}{External Python scripts for parsing

% SageTeX-ified documents, tons of documentation improvements,

% sagetex.py refactored, include in Sage as spkg}

+% \changes{v2.0}{2009/01/09}{Miscellaneous fixes, final 2.0 version.}

% \GetFileInfo{sagetexpackage.dtx}

% you have defined the Sage variable |foo| to be $12$ (using, say, the

% |sageblock| environment), then you can do something like this:

-% |The prime factorization of the current page plus foo is|\\

-% |$\sage{factor(foo + \thepage)}$|.

+% |The prime factorization of the current page number plus foo|\\

+% |is $\sage{factor(foo + \thepage)}$|.

% Here, I'll do just that right now: the prime factorization of the

-% current page plus $12$ is $\sage{factor(\thepage + 12)}$.

-% The |\sage| command doesn't automatically use math mode for its

-% output, so be sure to use dollar signs or a displayed math environment

+% current page number plus $12$ is $\sage{factor(\thepage + 12)}$.

+% (Wrong answer? See footnote.\footnote{Is the above factorization

+% wrong? If the current page number plus $12$ is one larger than the

+% claimed factorization, you need to do another Sage/\LTX cycle on

+% this source file. Why? The first time you run \LTX on this file, the

+% sine graph isn't available, so the text where I've talked about the

+% prime factorization is back one page. Then you run Sage, and it

+% creates the sine graph and does the factorization. When you run \LTX

+% again, the sine graph pushes the text onto the next page, but it

+% uses the Sage-computed value from the previous page. Meanwhile, the

+% |.sage| file has been rewritten with the correct page number, so if

+% you do another Sage/\LTX cycle, you'll get the correct value

+% above.}) The |\sage| command doesn't automatically use math mode for

+% its output, so be sure to use dollar signs or a displayed math

% \DescribeMacro{\percent} If you are doing modular arithmetic or string

% \url{http://creativecommons.org/licenses/by-nc-sa/3.0/} or send a

% letter to Creative Commons, 171 Second Street, Suite 300, San

% Francisco, California, 94105, USA.

-% I've run into a situation where the index wants to start on the very

-% last line of the page, and I actually get errors: ``Package multicol

-% Error: Error saving partial page.'' The problem goes away if I

-% fiddle with some lines so that the index starts elsewhere. Putting

-% in a clearpage below makes the index start nicely in the middle of a

-% page (until my change history gets too long!) and solves all those

-% problems. It can be removed if you're confident the pagebreak

+% I've run into a situation where the index wants to start on the very

+% last line of the page, and I actually get errors: ``Package multicol

+% Error: Error saving partial page.'' The problem goes away if I fiddle

+% with some lines so that the index starts elsewhere. Putting in a

+% clearpage below makes the index start nicely in the middle of a page

+% (until my change history gets too long!) and solves all those

+% problems. It can be removed/pulled into this comment if you're

+% confident the pagebreak problems won't occur.