To create or modify build tools, go to Settings --> Configure Kile, and select Tools --> Build in the left panel. You have to create two new tools, one for just running sage filename.sage, one for the sequence of tools.
Tool for running sage
- Click the New button below the list of existing tools, call the new tool for example Sage.
- Click Next and then Finish, you don't have to specify the class.
- In the General tab for the new tool, type
sage as the command, and '%S.sage' as an option. %S is, as I understand it, a placeholder for the filename without extension. (I just looked at how other tools, e.g. MakeIndex, is set up.)
In the Advanced tab you can fill in source and target extension, but I do not know if this is necessary to include. If it is, I guess the source extension is sage and the target sout. (According to http://www.sagemath.org/doc/tutorial/sagetex.html)
Tool for the sequence
- Create a new tool with a reasonable name, but this time select Quick build as the class.
- In the General tab, you can choose from existing tools, and combine these in a sequence. Select tool you want from the drop-down menu and click Add to add it to the sequence. Add the PDFLaTeX tool twice, and the Sage tool you just created in between.
The new tool is found under Build --> Other. You can add a keyboard shortcut if you like, by going to Settings --> Configure Shortcuts.
filename.sagetex.sage, notfilename.sagetex.tex. Second, reading on sagemath.org, I see thatsagetexproduces a file calledfilename.sage, notfilename.sagetex.sage, so the OP apparently made a mistake. I'll fix it immediately. No idea why the ViewPDF failed though. – Torbjørn T. Feb 07 '13 at 08:10.sagetex.sage. Just as a personal preference, on the tool for sequence under the tab Menu, I selected Add to Build menu: Compile. That way I have easy access along with the other tools for compilation – Prastt Feb 07 '13 at 19:48