When you compile a file with AUCTeX, it will prompt you to re-run LaTeX and BibTeX as necessary. Is there a way to get it to also run
sage when using SageTeX?
If you haven’t already discovered an answer: If I under stand correctly, you want to be able to do the sage 'compile' step from emacs. If that's the case, add this to your .emacs:
;; SageTeX setup ;; This adds the command sage when in LaTeX mode (to invoke type C-C C-c sage) (eval-after-load "tex" '(setq TeX-command-list (append TeX-command-list (list (list "sage" "sage %s.sagetex.sage" 'TeX-run-command nil t :help "Run SAGE on the SAGE file corresponding to this LaTeX file (run latex first).")))))
source: with slight modification ( sage generated files are now x.sagetex.sage ).
It still will not prompt you that sage should be run (output will simply be ...unresolved references... if you do not run sage), but its better than switching to a terminal.