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
- 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.