Source

SageTeX / remote-sagetex.dtx

Diff from to

remote-sagetex.dtx

 % class.
 %
 % \begin{macro}{RemoteSage}
+% \changes{v2.2.1}{2009/06/20}{Fix stupid bug in \texttt{do\_inline()}
+% so that we actually write output to .sout file}
+%
 % This is pretty simple; it's more or less a translation of the examples
 % in \texttt{sage/server/simple/twist.py}.
 %    \begin{macrocode}
         return result
 
     def do_inline(self, code):
-        return self._do_cell(' latex({0})'.format(code))
+        return self._do_cell(' print(latex({0}))'.format(code))
 
     def do_block(self, code):
         result = self._do_cell(code)
         if (not line.startswith(' _st_.goboom') and
             not line.startswith("print 'SageT")):
             h.update(line)
+%    \end{macrocode}
+% Putting the |{1}| in the string, just to replace it with |%|, seems a
+% bit weird, but if I put a single percent sign there, Docstrip won't
+% put that line into the resulting |.py| file---and if I put two percent
+% signs, it replaces them with |\MetaPrefix| which is |##| when this
+% file is generated. This is a quick and easy workaround.
+%    \begin{macrocode}
     sout += """%{0}% md5sum of corresponding .sage file
-% (minus "goboom" and pause/unpause lines)
-""".format(h.hexdigest())
+{1} (minus "goboom" and pause/unpause lines)
+""".format(h.hexdigest(), '%')
 
 printc('Writing .sout file...')
 with open(jobname + '.sout', 'w') as soutf:
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.