Der liebe @TeXnician hat aus meinem fehlerhaften Ansatz eine funktionierende arara-Regel geschrieben:
!config
# SageTeX-Rule for arara.
#
# Dear Windows-users, please check the paths
# pathToBashExecutive and pathToSageStartfile
# due to your Sage-installation!
#
identifier: sagetex
name: SageTeX
authors:
- TeXnician (Author)
- cis (Idea)
arguments: []
commands:
- name: A SageTeX Rule for arara
command: >
@{
pathToBashExecutive = "C:\\Programme\\SageMath8.9\\runtime\\bin\\bash";
pathToSageStartfile = "C:/Programme/SageMath8.9/runtime/opt/sagemath-8.9/sage";
pathOfCurrentWorkingFolder = currentFile().getParent();
theWindowsCommand = getCommand(pathToBashExecutive, "-l", pathToSageStartfile, "-c", "os.chdir('" + pathOfCurrentWorkingFolder + "'); load('" + getBasename(currentFile()) + ".sagetex.sage')");
return isWindows(theWindowsCommand, getCommand("sage", getBasename(file) + ".sagetex.sage"));
}
Der Lauf ist damit:
% arara: pdflatex
% arara: sagetex
% arara: pdflatex
\documentclass{report}
\usepackage{sagetex}
\begin{document}
\sage{2^1234}
\end{document}