1. Dan Drake
  2. SageTeX


Dan Drake  committed 73c02af

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

  • Participants
  • Parent commits 7f5b80c
  • Branches main

Comments (0)

Files changed (3)

File example.tex

View file
 % package for more information!
-\title{Examples of embedding Sage in \LaTeX}
+\title{Examples of embedding Sage in \LaTeX{} with \textsf{SageTex}}
+\author{Dan Drake and others}
 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

File sagetexpackage.dtx

View file
 % 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}
-\ST@wsf{ _st_.plot(\theST@plot, #3, format='#2')}%
+\ST@wsf{ _st_.plot(\theST@plot, format='#2', _p_=#3)}%
 \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.progress('Plot %s' % counter)
       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

File sagetexpackage.ins

View file
 \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                                                 *}