SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 366 forks source link

Extremely slow compilation using auto-pst-pdf and -shell-escape #319

Open adamal opened 10 years ago

adamal commented 10 years ago

I mentioned this in a comment on another issue, but it's probably worth it's own post.

To use psfrag and the like with pdflatex, one needs to use something like auto-pst-pdf. This requires calling pdflatex with the -shell-escape. This feature is not yet fully (as in easily switchable) incorporated into LaTeXtools (working solution).

However, compiling becomes extremely slow. For example the code below takes 13s to compile through ST, while it takes 3s to compile in TeXShop. This quickly grows to unusable heights. The first 4 pages of my master thesis - with 1 figure - takes 38s through ST, and 7s through TeXShop.

This really is a shame, since the comfort of cmd+b, doesn't really make up for time lost. With most real-world documents, opening the project with TeXShop and compiling would still be a lot faster.

\documentclass{article}
\usepackage[pdf]{pstricks}
\usepackage{psfrag}
\begin{document}
\psfrag{[Mp]}{$N_p*$}
\includegraphics{example.eps}
\end{document}```
chid commented 10 years ago

I don't use a mac so I'm not quite sure, but have you tried timing how long the compiling command takes to run in the command line?

Is it possible for you to find out what the compiling script that is called from TeXShop is?

adamal commented 10 years ago

I have actually never compiled directly from terminal, so I'm not sure how to do that. This also means I know very little about the build-system and who does what and when - sorry.

The closest I can find in TeXShop's settings, is pdflatex --shell-escape --synctex=1 under "engine", but what it's actually used for is not labeled very clearly (pdfTeX, Latex).

Maybe of inspiration: Googling around, I have found a few posts from people having noticed speed differences between TextMate and. TeXShop. The threads I found didn't reveal any technicalities. Following the TextMate lead a bit further, they mention that the preamble is only recompiled if changed. That feeling being strengthened by this post about Makefile and TeXShop - stating that TeXShop doesn't really have one. Maybe some devilry is going on to only do partial recompiles?

msiniscalchi commented 10 years ago

Just a shot in the dark --- LaTeXTools currently uses latexmk to drive compilation. That means that it has to invoke perl, then run the latexmk script, which in turn runs pdflatex & friends. This would obviously make things slower.

In the mbuilder branch, you can run your own script, or use a "simple builder" which launches pdflatex twice, then bibtex if necessary, then pdflatex (actually it does a bit more than that). It doesn't set shell-escape, but one could modify it to do so. It's a thought.

On Mon, Feb 3, 2014 at 4:36 PM, adamal notifications@github.com wrote:

I have actually never compiled directly from terminal, so I'm not sure how to do that. This also means I know very little about the build-system and who does what and when - sorry.

The closest I can find in TeXShop's settings, is pdflatex --shell-escape --synctex=1 under "engine", but what it's actually used for is not labeled very clearly (pdfTeX, Latex).

Maybe of inspiration: Googling around, I have found a few posts from people having noticed speed differences between TextMate and. TeXShop. The threads I found didn't reveal any technicalities. Following the TextMate lead a bit furtherhttps://github.com/textmate/latex.tmbundle/blob/master/Support/help.markdown, they mention that the preamble is only recompiled if changed. That feeling being strengthened by this post about Makefile and TeXShophttp://mimi.kaktusteam.de/blog-posts/2012/09/latex-makefile-with-texshop/- stating that TeXShop doesn't really have one. Maybe some devilry is going on to only do partial recompiles?

Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/319#issuecomment-34009122 .

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661