1. Dan Drake
  2. SageTeX

Commits

Dan Drake  committed f745473

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

Comments (0)

Files changed (1)

File sagetexpackage.dtx Modified

View file
  • Ignore whitespace
  • Hide word diff
 %<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