Sublime Forum

Unofficial LaTeXTools port to ST3

#1

Good news, everyone! The official package has been ported, and so my changes are no longer relevant. You can find the announcement here and the ST3 fork of the real deal here. Once the new version has stabilized a bit, I’ll be submitting code for hiding intermediary files and all that sort of thing.

0 Likes

#2

This is great! I have been waiting for this one! Are you going to sent to pull request to the main repro?

EDIT: Any chance to get the changes from this pull request in ST3?
github.com/SublimeText/LaTeXTools/pull/120

0 Likes

#3

[quote=“gregor.hoch”]This is great! I have been waiting for this one! Are you going to sent to pull request to the main repro?

EDIT: Any chance to get the changes from this pull request in ST3?
github.com/SublimeText/LaTeXTools/pull/120[/quote]

I’ll look into making those changes, but bear in mind that I don’t know the code all that intimately: I just did some basic refactoring and added the trick with the temporary folder; the plugin on the whole is out of my current depth. I will, though, see what I can do.

Github is also something of a mystery to me, but I think I have to re-fork it and add a separate branch or something like that before submitting a pull request. I’ll figure that one out, too, when I get a moment.

0 Likes

#4

Great, thank you for taking the time and initiative!

I notice, though, that your trick with the temporary directory seems to break latex building if you rely on a local file (in my case already the document class, so nothing works). Would it be possible to make this trick optional? (Otherwise one would have to tweak all *INPUTS environment variables (for latex, bibtex bib, bibtex bst, etc.), which seems rather unfortunate.

0 Likes

#5

I use LaTeXTools all the time, glad to see it work on ST3. I had to make one small change to make it run on Windows.

I’ve attached a patch even though it’s only one line; not sure if that’s the best thing to do.

[code]commit 8fef9bdbbf2ce4de92f2078c558ed3b19775c068
Author: Frazer McLean frazergmclean@gmail.com
Date: Tue Feb 19 00:13:05 2013 +0000

Incorrect str type in jumpToPDF

diff --git a/jumpToPDF.py b/jumpToPDF.py
index 4af93a0…d5ec960 100644
— a/jumpToPDF.py
+++ b/jumpToPDF.py
@@ -85,7 +85,7 @@ class JumpToPdfCommand(sublime_plugin.TextCommand):
tasks = subprocess.Popen(“tasklist”], stdout=subprocess.PIPE,
startupinfo=startupinfo).communicate()[0]
# Popen returns a byte stream, i.e. a single line. So test simply:

  •   	if "SumatraPDF.exe" not in tasks:
    
  •   	if "SumatraPDF.exe" not in str(tasks, encoding='utf8' ):
      		print("Sumatra not running, launch it")
      		self.view.window().run_command("view_pdf")
      		time.sleep(0.5) # wait 1/2 seconds so Sumatra comes up
    

[/code]

0 Likes

#6

Thanks for starting this port. On linux I found I had to rename a few occurances of ‘LaTexTools’ to ‘LaTexTools3’. Now I press ctrl-B and I see my document - perfect :smile:

Is the intention for this plugin to be named LaTexTools or LaTexTools3?

0 Likes

#7

Hey all, sorry for the delay in getting back to you, but thanks for the feedback, testing, and fixes! I’ve adjusted things so that the temporary directory trick is no longer enabled by default, and added a setting to enable it along with a note explaining that paths will have to be specified absolutely, I’ve incorporated RazerM’s fix for Windows, and I think I’ve rooted out the last couple of places where “LaTeXTools” wasn’t changed to “LaTeXTools3”. (As far as naming goes, I wanted it to be easily distinguishable from the ST2 version without diverting credit and kudos from the original authors, so I just jammed a “3” on there. Sort of a lazy solution, but.)

The Github repository has been updated; let me know if it breaks anything new!

0 Likes

#8

I noticed another error, which isn’t preventing compilation or launching Sumatra, but it is appearing in the console.

Appears to be a bug from the switch to Python 3, but I don’t know enough about Python yet to fix it.

Got request for DDE! Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 412, in run_ return self.run(edit, **args) File "C:\Users\frazer\AppData\Roaming\Sublime Text 3\Packages\LaTeXTools3\DDEExecute.py", line 37, in run pData = c_char_p(command) TypeError: bytes or integer address expected instead of str instance

0 Likes

#9

[quote=“RazerM”]I noticed another error, which isn’t preventing compilation or launching Sumatra, but it is appearing in the console.

Appears to be a bug from the switch to Python 3, but I don’t know enough about Python yet to fix it.[/quote]

I’m not terrific with ctypes either, but try the commit from just now and see if that helps. You should just need to replace DDEExecute.py. Sorry I can’t test it myself, but I don’t have access to a Windows machine right now.

0 Likes

#10

[quote=“phyllisstein”]

[quote=“RazerM”]I noticed another error, which isn’t preventing compilation or launching Sumatra, but it is appearing in the console.

Appears to be a bug from the switch to Python 3, but I don’t know enough about Python yet to fix it.[/quote]

I’m not terrific with ctypes either, but try the commit from just now and see if that helps. You should just need to replace DDEExecute.py. Sorry I can’t test it myself, but I don’t have access to a Windows machine right now.[/quote]

Yeah the error is gone now.

0 Likes

#11

Thank you for this port!

Are the “crtl+l,x” or the “crtl+l,crtl+space” keybindings working for anyone?

0 Likes

#12

The citation autocomplete won’t work. I fixed that and PDF jump:

Citations
Pdf jump

Might get merged into the main repo.

0 Likes

#13

[quote=“zmk”]The citation autocomplete won’t work. I fixed that and PDF jump:

Citations
Pdf jump

Might get merged into the main repo.[/quote]

I just merged your changes; thanks for helping out!

0 Likes

#14

zmk,

This is great. Thank you.

0 Likes

#15

[quote=“gregor.hoch”]This is great! I have been waiting for this one! Are you going to sent to pull request to the main repro?

EDIT: Any chance to get the changes from this pull request in ST3?
github.com/SublimeText/LaTeXTools/pull/120[/quote]

I agree that incorporating some elements of that pull request, in particular the support for multiple references, would be tremendous. In fact, support for multiple references (the “,” trigger developed by Westacular) is really the only thing I’m missing right now in this ST3 LaTeXTools port.

0 Likes

#16

Hi!

Thanks for the plugin update, all I missed to go to ST3 :wink:

I have some issues though, main one being that DdeConnect (for Windows/Sumatra) generates like 10s of lags on forward searches. Any idea?

I’ll try the 32 bits version rather than 64.

0 Likes

#17

Hey There!

I’m trying to get Latextools to work with ST3 but i’m currently stuck.

I checked out the st3 branch from github, I installed latexmk and evince but when I try building a .tex file it just shows [Compiling …tex] and does nothing. On the console I get the following error:

‘latexmk’, ‘-cd’, ‘-e’, “$pdflatex = ‘pdflatex %O -interaction=nonstopmode -synctex=1 %S’”, ‘-f’, ‘-pdf’, ‘/home/…/Documents/BA/thesis.tex’]
2
Welcome to thread Thread-1
Exception in thread Thread-1:
Traceback (most recent call last):
File “X/threading.py”, line 639, in _bootstrap_inner
File “/home/…/.config/sublime-text-3/Packages/LaTeXTools/makePDF.py”, line 53, in run
env = self.caller.envi.copy()
AttributeError: ‘MakePdfCommand’ object has no attribute ‘envi’

Working on Archlinux 64bit.

cheers

0 Likes

#18

Try this pull request… github.com/phyllisstein/LaTeXTools/pull/6

Looks like the self.envi isn’t defined in all cases in the MakePDFCommand class…

0 Likes

#19

Thanks for the quick response! I got rid of the error above, but got a new one.

After the build command it said on the console, that a .log file could not be found so I just created the file it was looking for. After that I see no errors, evince starts but is unable to open the document (Error opening file: No such file or directory).

What the hell am I doing wrong? :smiley:

0 Likes

#20

[quote=“Talaf”]Hi!

Thanks for the plugin update, all I missed to go to ST3 :wink:

I have some issues though, main one being that DdeConnect (for Windows/Sumatra) generates like 10s of lags on forward searches. Any idea?

I’ll try the 32 bits version rather than 64.[/quote]

I confirmed it too.
Does 32 bit version work?

0 Likes