sagemath / sagetex

Embed code, results of computations, and plots from the Sage mathematics software suite (https://www.sagemath.org) into LaTeX documents. Source repository for https://pypi.org/project/sagetex/ and https://ctan.org/pkg/sagetex
https://ctan.org/pkg/sagetex
Other
58 stars 23 forks source link

LatexMk does not run 'sage sagetex.sage' #14

Closed Poetastrophe closed 6 years ago

Poetastrophe commented 6 years ago

Using the given code in the .latexmkrc

add_cus_dep('sagetex.sage', 'sagetex.sout', 0, 'makesout');
$hash_calc_ignore_pattern{'sage'} = '^( _st_.goboom| ?_st_.current_tex_line|print .SageT)';
sub makesout {
    system("sage '$_[0].sagetex.sage'");
}

Seems to have no effect when producing a pdf file. Whereas if I do it manually there is no problem. Is the latexmkrc code outdated?

Poetastrophe commented 6 years ago

Ok I needed some code. It worked wonderfully with this:

`
$pdf_mode = 1; $pdf_previewer = 'start zathura';

$latex = "$latex ; python /usr/share/texmf/tex/latex/sagetex/run-sagetex-if-necessary.py %B"; $pdflatex = "$pdflatex ; python /usr/share/texmf/tex/latex/sagetex/run-sagetex-if-necessary.py %B";

add_cus_dep( 'sage', 'sout', 0, 'makesout' ); $hash_calc_ignore_pattern{'sage'} = '^( st.goboom|print .SageT)'; sub makesout { system( "sage \"$_[0].sage\"" ); } `