From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailinglists@nawaz.org Subject: SageTeX in export Date: Thu, 16 Aug 2012 21:33:47 -0700 Message-ID: <87a9xuqgr8.fsf@fester.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2EFz-0007ZZ-N3 for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 00:34:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2EFy-00026P-J8 for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 00:33:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:59886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2EFy-00026F-Ci for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 00:33:58 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T2EFx-0005ph-2y for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 06:33:57 +0200 Received: from c-71-237-233-41.hsd1.or.comcast.net ([71.237.233.41]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Aug 2012 06:33:57 +0200 Received: from mailinglists by c-71-237-233-41.hsd1.or.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Aug 2012 06:33:57 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Some background for the interested: Sage (http://www.sagemath.org/) is a free open source mathematics system. It essentially takes a number of well known open source math packages (Pari/GP, Maxima, etc) and provides it all to you under one interface, all glued together with Python. I highly recommend it. There was even a post here a few days ago regarding including Sage into Org-Babel. I want to talk about SageTeX. It's a package that allows you to call Sage code from within your LaTeX document. You insert a Sage command (e.g. plotting some data) and it returns the result - either an image or relevant LaTeX code. Kind of like literate programming. Here's how it works. If your document is file.tex and it uses the SageTeX package, you run pdflatex on the .tex file. This will then produce a sage script called "file.sagetex.sage". You then manually run this sage script using Sage. Then you run pdflatex again and it will include the results from your sage script into the document. I'm finding myself embedding Sage code into a document I'm writing which is meant for a LaTeX export. My problem is that Org mode's LaTeX export can't handle the steps in my previous paragraph. I'm sure it's trivial to do via some hook, but I'm no good at Elisp. All I need is a way for the export to: 1. After running pdflatex, check if there is a file called ".sagetex.sage". 2. If it's present, run sage on it, and then rerun pdflatex. 3. If it's not, nothing more is left to do. I'd really appreciate if someone could tell me how to enable this with Org mode's export. Thanks!