Commits

Anonymous committed 53b3a63

fix md5 problems from pausing support; add bits for latexmk; version 2.1.1

Comments (0)

Files changed (5)

 dtxs=$(wildcard *.dtx)
 # the subdir stuff makes the tarball have the directory correct
 srcs=../sagetex/example.tex ../sagetex/README ../sagetex/sagetexpackage.dtx ../sagetex/sagetexpackage.ins
-ver=2.1
+ver=2.1.1
 
 .SUFFIXES:
 
 	makeindex -s gglo.ist -o $(pkg).gls $(pkg).glo 
 	makeindex -s gind.ist -o $(pkg).ind $(pkg).idx
 
-sagetex.sty: py-and-sty.dtx
+sagetex.sty: py-and-sty.dtx $(pkg).dtx
 	yes | latex $(pkg).ins
 
-sagetex.py: py-and-sty.dtx
+sagetex.py: py-and-sty.dtx $(pkg).dtx
 	yes | latex $(pkg).ins
 
 clean: 
 
 # the following bit requires SHELL=bash
 auxclean:
-	rm -f {$(pkg),example}.{glo,gls,aux,sout,out,toc,dvi,pdf,ps,log,ilg,ind,idx,sage}
+	rm -f {$(pkg),example}.{glo,gls,aux,sout,out,toc,dvi,pdf,ps,log,ilg,ind,idx,sage,fdb_latexmk}
 
 install: sagetex.sty sagetex.py
 	cp sagetex.sty $(dest)
 
 Code block which uses a variable \texttt{s} to store the solutions:
 \begin{sageblock}
+ 1+1
  var('a,b,c')
  eqn = [a+b*c==1, b-a*c==0, a+b==5]
  s = solve(eqn, a,b,c)
 %
 % Pull in the |.sout| file if it exists, or do nothing if it doesn't. I
 % suppose we could do this inside an |AtBeginDocument| but I don't see
-% any particular reason to do that. It will work whenever we load it.
+% any particular reason to do that. It will work whenever we load it. If
+% the |.sout| file isn't found, print the usual \TeX-style message. This
+% allows programs
+% (\href{http://www.phys.psu.edu/~collins/software/latexmk-jcc/}{\texttt{Latexmk}}, for example)
+% that read the |.log| file or terminal output to detect
+% the need for another typesetting run to do so. If the ``\texttt{No
+%   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}{}{}
+\InputIfFileExists{\jobname.sout}{}{\typeout{No file \jobname.sout.}}
 %    \end{macrocode}
+% \changes{v2.1.1}{2009/05/14}{Add typeout if .sout file not found}
 %
 % The user might load the |hyperref| package after this one (indeed, the
 % |hyperref| documentation insists that it be loaded last) or not at
 \AtBeginDocument{\provideenvironment{NoHyper}{}{}}
 %    \end{macrocode}
 %
-% \subsubsection{The \texttt{\bslash sage} macro}
+% \subsubsection{The \texttt{\protect\bslash sage} macro}
 % \label{sec:sagemacro}
 %
 % \begin{macro}{\sage}
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsubsection{The \texttt{\bslash sageplot} macro and friends}
+% \subsubsection{The \texttt{\protect\bslash sageplot} macro and friends}
 % \label{sec:sageplotmacro}
 %
 % Plotting is rather more complicated, and requires several helper
 %
 % \begin{macro}{goboom}
 % When a chunk of Sage code blows up, this function bears the bad news
-% to the user. Normally in Python the traceback is good enough for this,
-% but in this case, we start with a |.sage| file (which is
+% to the user. Normally in Python the traceback is good enough for
+% this, but in this case, we start with a |.sage| file (which is
 % autogenerated) which itself autogenerates a |.py| file---and the
 % tracebacks the user sees refer to that file, whose line numbers are
-% basically useless. We want to tell them where in the \LTX file things
-% went bad, so we do that, give them the traceback, and exit after
-% removing the |.sout.tmp| file.
+% basically useless. We want to tell them where in the \LTX file
+% things went bad, so we do that, give them the traceback, and exit
+% after removing the |.sout.tmp| file.
 %    \begin{macrocode}
   def goboom(self, line):
     print('\n**** Error in Sage code on line %s of %s.tex! Traceback\
 %
 % The answer is to only find the MD5 sum of \emph{part} of the |.sage|
 % file. By design, the source file line numbers only appear in calls to
-% |goboom|, so we will strip those lines out. Basically we are doing
+% |goboom| and pause/unpause lines, so we will strip those lines out.
+% What we do below is exactly equivalent to running
 % \begin{center}
-% \verb+grep -v '^ _st_.goboom' filename.sage | md5sum+
+% \verb+egrep '^( _st_.goboom|print .SageT)' filename.sage | md5sum+
 % \end{center}
-% (In fact, what we do below produces exactly the same sum.) 
+% in a shell.
 %    \begin{macrocode}
   def endofdoc(self):
     sagef = open(self.filename + '.sage', 'r')
     m = hashlib.md5()
     for line in sagef:
-      if line[0:12] != ' _st_.goboom':
+      if line[0:12] != " _st_.goboom" and line[0:12] != "print 'SageT":
         m.update(line)
     s = '%' + m.hexdigest() + '% md5sum of corresponding .sage file\
- (minus "goboom" lines)\n'
+ (minus "goboom" and pause/unpause lines)\n'
     self.souttmp.write(s)
 %    \end{macrocode}
 % Now, we do issue warnings to run Sage on the |.sage| file and an
     self.progress('Sage processing complete. Run LaTeX on %s.tex again.' %\
              self.filename)
 %    \end{macrocode}
+% % \changes{v2.1.1}{2009/05/14}{Fix bug in finding md5 sum introduced by
+% pause facility}
 % \end{macro}
 
 % \endinput

sagetexpackage.dtx

 %<latex>\ProvidesPackage{sagetex}
 %<python>version = """
 %<*latex|python>
-  [2009/05/12 v2.1 embedding Sage into LaTeX documents]
+  [2009/05/14 v2.1.1 embedding Sage into LaTeX documents]
 %</latex|python>
 %<python>"""
 %<*driver>
 %</driver>
 % \fi
 %
-% \CheckSum{313}
+% \CheckSum{315}
 %
 % \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
 %     \href{http://mathsci.kaist.ac.kr/~drake/}
 %     {\texttt{mathsci.kaist.ac.kr/$\sim$drake/}}.}}
 %
+% \iffalse
+% Don't put any other code from this file into the .sty or .py
+% file:
+%<*!latex&!python>
+% This lets us use verbatim environments in the documentation.
+% \fi
+%
 % \maketitle
 %
 % \section{Introduction}
 %
 % Here are some other notes on using \ST.
 %
-% \paragraph{Using Beamer} The \textsc{beamer} package does not play
-% nicely with verbatim-like environments unless you ask it to. To use
-% code block environments in a \textsc{beamer} presentation, do:
+% \subsection{Using Beamer}
+%
+% The \textsc{beamer} package does not play nicely with verbatim-like
+% environments unless you ask it to. To use code block environments in a
+% \textsc{beamer} presentation, do:
 % \begin{quote}
 %  |\begin{frame}[fragile]|\\
 %  |\begin{sageblock}|\\
 %
 % Thanks to Franco Saliola for reporting this.
 %
-% \paragraph{Plotting from Mathematica, Maple, etc.} Sage can use
-% Mathematica, Maple, and friends and can tell them to do plotting, but
-% since it cannot get those plots into a Sage graphics object, you
-% cannot use |\sageplot| to use such graphics. You'll need to use the
-% method described in ``But that's not good enough!''
+% \subsection{Plotting from Mathematica, Maple, etc.}
+%
+% Sage can use Mathematica, Maple, and friends and can tell them to do
+% plotting, but since it cannot get those plots into a Sage graphics
+% object, you cannot use |\sageplot| to use such graphics. You'll need
+% to use the method described in ``But that's not good enough!''
 % (\autoref{sec:notgoodenough}) with some additional bits to get the
 % directory right---otherwise your file will get saved to someplace in a
 % hidden directory.
       long_description="""The SageTeX package allows you to embed code,
   results of computations, and plots from the Sage mathematics
   software suite (http://sagemath.org) into LaTeX documents.""",
-      version='2.1',
+      version='2.1.1',
       author='Dan Drake',
       author_email='ddrake@member.ams.org',
       url='http://mathsci.kaist.ac.kr/~drake',
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.