Commits

Anonymous committed 1565d1f

first take on ".sagetex.sage" and ".sagetex.sout". Not tested, no documentation. Whee!

Comments (0)

Files changed (2)

 %    \begin{macrocode}
 \AtBeginDocument{\@ifundefined{ST@final}{%
 \newwrite\ST@sf%
-\immediate\openout\ST@sf=\jobname.sage%
+\immediate\openout\ST@sf=\jobname.sagetex.sage%
 %    \end{macrocode}
 % \begin{macro}{\ST@wsf}
 %   We will write a lot of stuff to that file, so make a convenient
 %   valid Python, though, so I haven't bothered figuring out how to get
 %   a single hash. We are assuming that the extension is |.tex|; see the
 %   |initplot| documentation on page~\pageref{initplot} for discussion
-%   of file extensions. The ``|(\jobname.sage)|'' business is there
-%   because the comment below will get pulled into the autogenerated
-%   |.py| file (second order autogeneration!) and I'd like to reduce
-%   possible confusion if someone is looking around in those files.
-%   Finally, we check for version mismatch and bail if the .py and .sty
-%   versions don't match and the user hasn't disabled checking. Note
-%   that we use |^^J| and not |^^J%| when we need indented lines. Also,
-%   |sagetex.py| now includes a |version| variable which eliminates all
-%   the irritating string munging below, and later we can remove this
-%   stuff and just use |sagetex.version|.
+%   of file extensions. The ``|(\jobname.sagetex.sage)|'' business is
+%   there because the comment below will get pulled into the
+%   autogenerated |.py| file (second order autogeneration!) and I'd like
+%   to reduce possible confusion if someone is looking around in those
+%   files. Finally, we check for version mismatch and bail if the .py
+%   and .sty versions don't match and the user hasn't disabled checking.
+%   Note that we use |^^J| and not |^^J%| when we need indented lines.
+%   Also, |sagetex.py| now includes a |version| variable which
+%   eliminates all the irritating string munging below, and later we can
+%   remove this stuff and just use |sagetex.version|.
 %   \changes{v2.2.4}{2010/02/15}{Add version mismatch checking.}
 %    \begin{macrocode}
 \newcommand{\ST@wsf}[1]{\immediate\write\ST@sf{#1}}%
 \ST@wsf{%
-# This file (\jobname.sage) was *autogenerated* from \jobname.tex with
+# This file (\jobname.sagetex.sage) was *autogenerated* from \jobname.tex with
 sagetex.sty version \ST@ver.^^J%
 import sagetex^^J%
 _st_ = sagetex.SageTeXProcessor('\jobname')^^J%
 %    \begin{macrocode}
 \DeclareOption{final}{%
   \newcommand{\ST@final}{x}%
-  \IfFileExists{\jobname.sout}{}{\AtEndDocument{\PackageWarningNoLine{sagetex}%
-  {`final' option provided, but \jobname.sout^^Jdoesn't exist! No Sage
+  \IfFileExists{\jobname.sagetex.sout}{}{\AtEndDocument{\PackageWarningNoLine{sagetex}%
+  {`final' option provided, but \jobname.sagetex.sout^^Jdoesn't exist! No Sage
     input will appear in your document. Remove the `final'^^Joption and
     rerun LaTeX on your document}}}}
 %    \end{macrocode}
 %   file foo.sout}'' line doesn't work for some software package, please
 % let me know and I can change it to use |PackageInfo| or whatever.
 %    \begin{macrocode}
-\InputIfFileExists{\jobname.sout}{}{\typeout{No file \jobname.sout.}}
+\InputIfFileExists{\jobname.sagetex.sout}{}
+{\typeout{No file \jobname.sagetex.sout.}}
 %    \end{macrocode}
 % \changes{v2.1.1}{2009/05/14}{Add typeout if .sout file not found}
 %
 %    \begin{macrocode}
 {\typeout{*********************************************************************}
 \PackageWarningNoLine{sagetex}{there were undefined Sage formulas and/or
-plots.^^JRun Sage on \jobname.sage, and then run LaTeX on \jobname.tex
+plots.^^JRun Sage on \jobname.sagetex.sage, and then run LaTeX on \jobname.tex
 again}}
 \typeout{*********************************************************************}}
 %    \end{macrocode}
 % seems reasonable to add it. Add in the version to help debugging
 % version mismatch problems.
 %    \begin{macrocode}
-    self.souttmp = open(self.filename + '.sout.tmp', 'w')
+    self.souttmp = open(self.filename + '.sagetex.sout.tmp', 'w')
     self.souttmp.write("""% This file was *autogenerated* from {0}.sage with
  % sagetex.py version {1}\n""".format(os.path.splitext(jobname)[0], version))
 %    \end{macrocode}
     print('\n**** Running Sage on {0}.sage failed! Fix {0}.tex and try\
  again.'.format(self.filename))
     self.souttmp.close()
-    os.remove(self.filename + '.sout.tmp')
+    os.remove(self.filename + '.sagetex.sout.tmp')
     sys.exit(int(1))
 %    \end{macrocode}
 % We use |int(1)| above to make sure |sys.exit| sees a Python integer;
 % in a shell.
 %    \begin{macrocode}
   def endofdoc(self):
-    sagef = open(self.filename + '.sage', 'r')
+    sagef = open(self.filename + '.sagetex.sage', 'r')
     m = hashlib.md5()
     for line in sagef:
       if line[0:12] != " _st_.goboom" and line[0:12] != "print 'SageT":
 % tell the user we're done.
 %    \begin{macrocode}
     self.souttmp.close()
-    os.rename(self.filename + '.sout.tmp', self.filename + '.sout')
+    os.rename(self.filename + '.sagetex.sout.tmp', self.filename + '.sagetex.sout')
     self.progress('Sage processing complete. Run LaTeX on {0}.tex again.'.format(
              self.filename))
 %    \end{macrocode}

sagetexpackage.dtx

 %</driver>
 % \fi
 %
-% \CheckSum{452}
+% \CheckSum{454}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.