1#!/usr/bin/env python 2# This is a small wrapper script, because running sage on a 3# *.sagetex.sage file in a subdirectory is broken. Once this 4# works fine, and produces the sout file in the subdirectory, 5# this script is no longer necessary -> modify latexmkrc ! 6import sys, os 7print("run-sagetex.py -- START".center(80, "-")) 8dir, file = sys.argv[1].split(os.path.sep) 9os.system("cd %s && sage %s" % (dir, file)) 10print("run-sagetex.py -- END".center(80, "-")) 11 12