ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 10 Aug 2016 10:16:42 -0500how can I speed up latexmk (sagetex) on a Mac?https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/I'm running latexmk on a Mac with sage 7.2 installed.
I'm confused about why the compilation process with tex files that use sagetex seem to take either 15-20 seconds or less than a second. I understand that there may be previously-generated files (plots, etc), but I have controlled for that by removing those files before each compilation.
Is there any way I can get consistent (and hopefully fast) compile times for my sagetex documents?Sat, 06 Aug 2016 22:18:23 -0500https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/Comment by kcrisman for <p>I'm running latexmk on a Mac with sage 7.2 installed.</p>
<p>I'm confused about why the compilation process with tex files that use sagetex seem to take either 15-20 seconds or less than a second. I understand that there may be previously-generated files (plots, etc), but I have controlled for that by removing those files before each compilation.</p>
<p>Is there any way I can get consistent (and hopefully fast) compile times for my sagetex documents?</p>
https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34411#post-id-34411Hmm, that workflow is not part of my experience, so I don't know if that would have something to do with it. My only comment is my first one (if you haven't used Sage in a bit then it takes longer to load up) and that usually, in a tex-sage-tex flow the second tex call takes much less time - but consistently, presumably because some aux file is happy?Wed, 10 Aug 2016 10:16:42 -0500https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34411#post-id-34411Comment by crucalculus for <p>I'm running latexmk on a Mac with sage 7.2 installed.</p>
<p>I'm confused about why the compilation process with tex files that use sagetex seem to take either 15-20 seconds or less than a second. I understand that there may be previously-generated files (plots, etc), but I have controlled for that by removing those files before each compilation.</p>
<p>Is there any way I can get consistent (and hopefully fast) compile times for my sagetex documents?</p>
https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34409#post-id-34409My workflow comes in two cases:
FIRST:
I use Sublime text editor on my Mac to write LaTeX code with embedded sage (\sage, \sagesilent, \sageplot, etc.) The build system in Sublime allows me to run the following latexmk command:
"command": ["latexmk", "-cd", "-e", "$pdflatex = '%E -shell-escape -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"]
I also have a latexmkrc file with this:
add_cus_dep('sage', 'sout', 0, 'makesout');
$hash_calc_ignore_pattern{'sage'} = '^( _st_.goboom|print .SageT)';
sub makesout {
system("/Applications/sage_72/sage '$_[0].sage'");
}
SECOND:
I have a Mongo database with many individual latex snippets that are sorted by keyword. I have a python script that pulls each of these snippets out, builds a small tex file, then runs latexmk.Wed, 10 Aug 2016 08:12:36 -0500https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34409#post-id-34409Comment by crucalculus for <p>I'm running latexmk on a Mac with sage 7.2 installed.</p>
<p>I'm confused about why the compilation process with tex files that use sagetex seem to take either 15-20 seconds or less than a second. I understand that there may be previously-generated files (plots, etc), but I have controlled for that by removing those files before each compilation.</p>
<p>Is there any way I can get consistent (and hopefully fast) compile times for my sagetex documents?</p>
https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34410#post-id-34410I apologize for the reference to "too long"
In reality, it really isn't that big of a deal. I'm just a little confused about why sage can take such varied amounts of time to do essentially the same task. I've done some research, but can't figure out exactly what's happening.Wed, 10 Aug 2016 08:14:09 -0500https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34410#post-id-34410Comment by kcrisman for <p>I'm running latexmk on a Mac with sage 7.2 installed.</p>
<p>I'm confused about why the compilation process with tex files that use sagetex seem to take either 15-20 seconds or less than a second. I understand that there may be previously-generated files (plots, etc), but I have controlled for that by removing those files before each compilation.</p>
<p>Is there any way I can get consistent (and hopefully fast) compile times for my sagetex documents?</p>
https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34374#post-id-34374I think in this case we would really need to see a minimal example that is "too long". I will say that from my experience using SageTeX, if Sage needs to start fresh, it takes quite a while, and then following ones much less time (which is true of anything you do with Sage). Can you give more details about your exact workflow? (E.g., do you use the Sage engine in TeXShop - I guess not, if you use a different maker?)Mon, 08 Aug 2016 10:40:20 -0500https://ask.sagemath.org/question/34362/how-can-i-speed-up-latexmk-sagetex-on-a-mac/?comment=34374#post-id-34374