LaTeXTools plugin: a slew of fixes

I finally got around to committing a bunch of fixes for my LaTeX plugin for the Sublime Text 2 editor. I describe the main changes below. First though I really want to give a shout-out to the outstanding Package Control plugin, which makes it trivially easy to install and update LaTeXTools and most other Sublime Text 2 plugins. If you have Package Control installed, getting LaTeXTools on your Mac or PC is just a matter of invoking Package Control: Install Package via either the Command Palette or the Preferences menu. See the aforelinked page for details. Incidentally, I didn’t have to do anything to make sure LaTeXTools was picked up by Package Control: it happened automagically, to my surprise and delight. Yay!

Now for the fixes. In no particular order:

  • I expanded the README file so it now covers most, if not all, of the current functionality. I also provide some ideas on how to troubleshoot issues. By the way, if you do find something is wrong, please let me know!
  • I finally understood that latexmk does not automatically force the TeX engine (e.g. pdflatex) to work in batch mode. Errors will cause latexmk to stop. You can check this by running it from the command line. However, on OS X, somehow invoking latexmk via subprocess.Popen still works, in the sense that all processes terminate regularly and the plugin can then look for errors in the TeX log file. On the other hand, on Windows, using TeXlive, this is not the case: the build command essentially hangs, and even if you terminate it, the pdflatex process keeps waiting for input in the background. This makes further compilations fail (because the synctex file is locked), and forces you to terminate the stray process with Task Manager. Ugly! Well, I hope I have fixed at least the most egregious causes of such inappropriate behavior by passing the -silent option to latexmk.
  • A user had a lot of trouble with on-the-fly conversion of EPS files to PDF on OS X, using the epstopdf package. Ends up the problem was path-related: epstopdf relies on Ghostscript, and MacTeX puts Ghostscript in /usr/local/bin rather than /usr/texbin. When compiling from the command line, everything worked–because MacTeX also helpfully fixes your $PATH; but, building from Sublime Text 2 always failed. Adding the former path in LaTeX.sublime-build fixed the issue. Thanks Jon and Sublimator for helping me track down this bug!
  • SumatraPDF, the supported PDF reader on Windows, only reloads recently changed files if they are local: it does not automatically reload files on network shares when they change. As a result, recompiling a file on a network share resulted in SumatraPDF not automatically showing the updated text. This was a problem for me when running Windows in a Parallels virtual machine: Mac directories are accessible are network drives, and there is no problem editing files with Sublime Text 2 on the virtual Windows side; however, I had to manually reload PDF files every time. Bottom line: I now explicitly force a reload before issuing the forward search DDE command.

Enjoy, and as usual report back any issues you may have!

4 responses to “LaTeXTools plugin: a slew of fixes

  1. Pingback: LaTeXTools plugin: new features | Tech, TeX and Theory

  2. Hi, You have specified to open the complied teX file in Sumatra PDF. But Can you give guidelines to open the output with Adobe Acrobad reader in Windows 7.

    Thanks,
    Uday

  3. Hi there! This is my first comment here so I just wanted to give a quick shout
    out and tell you I truly enjoy reading your articles.
    Can you suggest any other blogs/websites/forums that cover
    the same topics? Many thanks!

  4. LaTeXTools is great! I am have a similar problem on windows with getting epstopdf. It looks like it’s running the correct epstopdf command, but no pdf file is showing up. I’ve tried adding –shell-escape to the pdflatex call from latexmk, but no luck. My log looks as follows:

    Package epstopdf Info: Source file:
    (epstopdf) date: 2014-09-20 17:51:43
    (epstopdf) size: 40391 bytes
    (epstopdf) Output file:
    (epstopdf) Command:
    (epstopdf) \includegraphics on input line 34.
    runsystem(epstopdf –outfile=graphs/pretreat_comparisons_noci-eps-converted-to.
    pdf graphs/pretreat_comparisons_noci.eps)…executed.

    Package epstopdf Info: Result file: .

    ! Package pdftex.def Error: File `graphs/pretreat_comparisons_noci-eps-converte
    d-to.pdf’ not found.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s