Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

TexShop sage.engine can't tell if running Sage is necessary

I have switched from sagetex.py version 2012/01/16 v2.3.3-69dcb0eb93de to version 2015/08/26 v3.0-92d9f7a. When I compile a tex file using sage.engine it can't determine whether sage needs to run or not. I've narrowed this down to the if statement in sage.engine

# do we need to run Sage?
if [ -f "$soutname" ]
then
    new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | md5)
    old_sum=$(egrep -o ^%[0-9a-f]{32}% "$soutname" | cut -b 2-33)
    if [ "$new_sum" != "$old_sum" ]
    then
        run_sage=yes
    fi
else
    # no .sout file, so run Sage
    run_sage=yes
fi

I think the first egrep call should also eliminate lines containing current_tex_line but I don't know how.

Any ideas would be much appreciated. Thanks.

TexShop sage.engine can't tell if running Sage is necessary

I have switched from sagetex.py version 2012/01/16 v2.3.3-69dcb0eb93de to version 2015/08/26 v3.0-92d9f7a. When I compile a tex file using sage.engine it can't determine whether sage needs to run or not. I've narrowed this down to the if statement in sage.engine

# do we need to run Sage?
if [ -f "$soutname" ]
then
    new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | md5)
    old_sum=$(egrep -o ^%[0-9a-f]{32}% "$soutname" | cut -b 2-33)
    if [ "$new_sum" != "$old_sum" ]
    then
        run_sage=yes
    fi
else
    # no .sout file, so run Sage
    run_sage=yes
fi

I think the first egrep call should also eliminate lines containing current_tex_line . I've tried

new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "final.sagetex.sage" | egrep -v '^( _st_.current_tex_line|print .SageT)' | md5)

but I don't know how. to no avail.

Any ideas would be much appreciated. Thanks. Thanks.

TexShop sage.engine can't tell if running Sage is necessary

I have switched from sagetex.py version 2012/01/16 v2.3.3-69dcb0eb93de to version 2015/08/26 v3.0-92d9f7a. When I compile a tex file using sage.engine it can't determine whether sage needs to run or not. I've narrowed this down to the if statement in sage.engine

# do we need to run Sage?
if [ -f "$soutname" ]
then
    new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | md5)
    old_sum=$(egrep -o ^%[0-9a-f]{32}% "$soutname" | cut -b 2-33)
    if [ "$new_sum" != "$old_sum" ]
    then
        run_sage=yes
    fi
else
    # no .sout file, so run Sage
    run_sage=yes
fi

I think the first egrep call should also eliminate lines containing current_tex_line. I've tried

new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "final.sagetex.sage" "$sagename" | egrep -v '^( _st_.current_tex_line|print .SageT)' | md5)

but to no avail.

Any ideas would be much appreciated. Thanks.

TexShop sage.engine can't tell if running Sage is necessary

I have switched from sagetex.py version 2012/01/16 v2.3.3-69dcb0eb93de to version 2015/08/26 v3.0-92d9f7a. When I compile a tex file using sage.engine it can't determine whether sage needs to run or not. I've narrowed this down to the if statement in sage.engine

# do we need to run Sage?
if [ -f "$soutname" ]
then
    new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | md5)
    old_sum=$(egrep -o ^%[0-9a-f]{32}% "$soutname" | cut -b 2-33)
    if [ "$new_sum" != "$old_sum" ]
    then
        run_sage=yes
    fi
else
    # no .sout file, so run Sage
    run_sage=yes
fi

I think the first egrep call should also eliminate lines containing current_tex_line. I've tried

new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | egrep -v '^( _st_.current_tex_line|print .SageT)' _st_.current_tex_line)' | md5)

but to no avail.

Any ideas would be much appreciated. Thanks.

TexShop sage.engine can't tell if running Sage is necessary

I have switched from sagetex.py version 2012/01/16 v2.3.3-69dcb0eb93de to version 2015/08/26 v3.0-92d9f7a. When I compile a tex file using sage.engine it can't determine whether sage needs to run or not. I've narrowed this down to the if statement in sage.engine

# do we need to run Sage?
if [ -f "$soutname" ]
then
    new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | md5)
    old_sum=$(egrep -o ^%[0-9a-f]{32}% "$soutname" | cut -b 2-33)
    if [ "$new_sum" != "$old_sum" ]
    then
        run_sage=yes
    fi
else
    # no .sout file, so run Sage
    run_sage=yes
fi

I think the first egrep call should also eliminate lines containing current_tex_line. I've tried

new_sum=$(egrep -v '^( _st_.goboom|print .SageT)' "$sagename" | egrep -v '^( _st_.current_tex_line)' | md5)

but to no avail.

Any ideas would be much appreciated. Thanks.

Here is an example: the test.tex file

% !TEX TS-program = sage
\documentclass[12pt]{article}
\usepackage{sagetex}
\begin{document}
$2+3=\sage{2+3}$
\end{document}

produces among other things a sagetex.sout file that contains

% This file was *autogenerated* from test.sagetex.sage with
 % sagetex.py version 2015/08/26 v3.0-92d9f7a
\newlabel{@sageinline0}{{%
5}{}{}{}{}}
%b22d43e1240df548df8cf6749b32284b% md5sum of corresponding .sage file (minus "goboom", "current_tex_line", and pause/unpause lines)

The sage.engine if statement should compare the md5 value of sagetex.sage minus a few lines to the md5sum in sagetex.sout.