Anonymous avatar Anonymous committed 73c02af

Use keyword args only in plotting, to fix issue 2.

Comments (0)

Files changed (3)

 % package for more information!
 
 \documentclass{article}
-\title{Examples of embedding Sage in \LaTeX}
-\author{}
+\title{Examples of embedding Sage in \LaTeX{} with \textsf{SageTex}}
+\author{Dan Drake and others}
 
 \usepackage{sagetex}
 % 
 3D plotting right now is problematic because there's no convenient way
 to produce vector graphics. We can make PNGs, though, and since the
 \verb|sageplot| command defaults to EPS and PDF, \emph{you must specify
-a valid format for 3D plotting}. Sage right now (version 2.10.3) can't
+a valid format for 3D plotting}. Sage right now (version 3.2.2) can't
 produce EPS or PDF files from plot3d objects, so if you don't specify a
 valid format, things will go badly. You can specify the
 ``\texttt{imagemagick}'' option, which will use the Imagemagick

sagetexpackage.dtx

 % function call, so the user can put in keyword arguments there which
 % get interpreted correctly by Python.
 %
-% \begin{macro}{\ST@sageplot} Let's see the real code here. We write a
+% \begin{macro}{\ST@sageplot}
+% \changes{v2.0}{2008/12/16}{Change to use only keyword arguments: see issue
+% 2 on bitbucket tracker}
+% Let's see the real code here. We write a
 % couple lines to the |.sage| file, including a counter, input line
 % number, and all of the mandatory argument; all this is wrapped in
 % another try/except. Note that the |\write| gobbles up line endings, so
 %    \begin{macrocode}
 \def\ST@sageplot[#1][#2]#3{%
 \ST@wsf{try:}%
-\ST@wsf{ _st_.plot(\theST@plot, #3, format='#2')}%
+\ST@wsf{ _st_.plot(\theST@plot, format='#2', _p_=#3)}%
 \ST@wsf{except:}%
 \ST@wsf{ _st_.goboom(\the\inputlineno)}%
 %    \end{macrocode}
 % that \LTX doesn't treat commas and spaces in macro arguments
 % specially, and second, that Python (and Sage plotting functions) has
 % nice support for keyword arguments. The |#3| argument to |\sageplot|
-% becomes |p| and |**kwargs| below.
+% becomes |_p_| and |**kwargs| below.
 %    \begin{macrocode}
-  def plot(self, counter, p, format='notprovided', **kwargs):
+  def plot(self, counter, _p_, format='notprovided', **kwargs):
     if not self.didinitplot:
       self.initplot()
     self.progress('Plot %s' % counter)
         continue
       plotfilename = os.path.join(self.plotdir, 'plot-%s.%s' % (counter, fmt))
       #print('  plotting %s with args %s' % (plotfilename, kwargs))
-      p.save(filename=plotfilename, **kwargs)
+      _p_.save(filename=plotfilename, **kwargs)
 %    \end{macrocode}
 % If the user provides a format \emph{and} specifies the |imagemagick|
 % option, we try to convert the newly-created file into EPS format.
 %
 % \section{Copying and licenses}
 %
+% If you are unnaturally curious about the current state of the \ST
+% package, you can visit \url{http://www.bitbucket.org/ddrake/sagetex/}.
+% There is a Mercurial repository and other stuff there.
+%
+% As for the terms and conditions under which you can copy and modify
+% \ST:
+%
 % The \emph{source code} of the \ST package may be redistributed and/or
 % modified under the terms of the GNU General Public License as
 % published by the Free Software Foundation, either version 2 of the

sagetexpackage.ins

 \Msg{******************************************************************}
 \Msg{*                                                                *}
 \Msg{* To finish the installation, move the following files           *}
-\Msg{* into directories searched by TeX and Sage, respectively.       *}
+\Msg{* into directories searched by TeX and Sage, respectively:       *}
 \Msg{*                                                                *}
 \Msg{*     sagetex.sty                                                *}
 \Msg{*     sagetex.py                                                 *}
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.