summaryrefslogtreecommitdiff
path: root/support/latexmk/example_rcfiles/sagetex_latexmkrc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/latexmk/example_rcfiles/sagetex_latexmkrc
Initial commit
Diffstat (limited to 'support/latexmk/example_rcfiles/sagetex_latexmkrc')
-rw-r--r--support/latexmk/example_rcfiles/sagetex_latexmkrc21
1 files changed, 21 insertions, 0 deletions
diff --git a/support/latexmk/example_rcfiles/sagetex_latexmkrc b/support/latexmk/example_rcfiles/sagetex_latexmkrc
new file mode 100644
index 0000000000..a97702a9c7
--- /dev/null
+++ b/support/latexmk/example_rcfiles/sagetex_latexmkrc
@@ -0,0 +1,21 @@
+# This is to allow the use of sagetex package
+# (http://www.ctan.org/pkg/sagetex)
+# with latexmk. Sagetex outputs a file with the extension .sage.
+# This file is to be processed by sage software (http://sagemath.org)
+# to make a file with extension .sout. This file is then read in by
+# sagetex during a later run of (pdf)latex.
+#
+# This can be done by normal custom dependency. However the .sage
+# contains unimportant information about line numbers for error
+# reporting. It is useful not to rerun sage if this is the only
+# information that has changed in the .sage file. So the
+# hash_calc_ignore_pattern variable is used to configure latexmk to
+# ignore this lines when computing whether the .sage file has
+# changed.
+
+
+add_cus_dep( 'sage', 'sout', 0, 'makesout' );
+$hash_calc_ignore_pattern{'sage'} = '^( _st_.goboom|print .SageT)';
+sub makesout {
+ system( "sage \"$_[0].sage\"" );
+}