Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
I had forgotten I even asked the question. Thanks! –  Anthony Jan 21 '13 at 4:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.