Anonymous avatar Anonymous committed f745473

Add code to put "this file was autogenerated from..." line in .sage file.

Comments (0)

Files changed (1)

sagetexpackage.dtx

 %<latex>\NeedsTeXFormat{LaTeX2e}
 %<latex>\ProvidesPackage{sagetex}
 %<*latex>
-  [2008/01/14 v2.0 embedding Sage into LaTeX documents]
+  [2008/01/27 v2.0 embedding Sage into LaTeX documents]
 %</latex>
 %<*driver>
 \documentclass{ltxdoc}
 %    \end{macrocode}
 % \begin{macro}{\ST@wsf}
 % We will write a lot of stuff to that file, so make a convenient
-% abbreviation, then use it to put the initial commands into the |.sage|
-% file.
+% abbreviation, then use it to put the initial commands into the
+% |.sage| file. The hash mark below gets doubled when written to the
+% file, for some obscure reason related to parameter expansion. It's
+% 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.
 %    \begin{macrocode}
 \newcommand{\ST@wsf}[1]{\immediate\write\ST@sf{#1}}%
+\ST@wsf{# This file (\jobname.sage) was *autogenerated* from the file \jobname.tex.}%
 \ST@wsf{import sagetex}%
 \ST@wsf{_st_ = sagetex.SageTeXProcessor('\jobname')}}%
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{initplot}
+% \phantomsection\label{initplot}
 % We only want to create the plots directory if the user actually plots
 % something. This function creates the directory and sets the
 % |didinitplot| flag after doing so. We make a directory based on the
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.