Home Download Buy Blog Forum Support

Unofficial LaTeXTools port to ST3

Unofficial LaTeXTools port to ST3

Postby phyllisstein on Fri Feb 15, 2013 8:39 am

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.
Last edited by phyllisstein on Mon Jul 01, 2013 5:23 pm, edited 2 times in total.
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Unofficial LaTeXTools port to ST3

Postby gregor.hoch on Fri Feb 15, 2013 6:10 pm

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?
https://github.com/SublimeText/LaTeXTools/pull/120
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

Re: Unofficial LaTeXTools port to ST3

Postby phyllisstein on Sun Feb 17, 2013 11:19 pm

gregor.hoch wrote: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?
https://github.com/SublimeText/LaTeXTools/pull/120


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.
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Unofficial LaTeXTools port to ST3

Postby teoric on Mon Feb 18, 2013 7:38 am

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.
teoric
 
Posts: 6
Joined: Wed Jan 23, 2013 10:52 am

Re: Unofficial LaTeXTools port to ST3

Postby RazerM on Tue Feb 19, 2013 12:41 am

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: Select all
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
RazerM
 
Posts: 3
Joined: Tue Feb 19, 2013 12:38 am

Re: Unofficial LaTeXTools port to ST3

Postby badger on Wed Feb 20, 2013 2:40 pm

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 :)

Is the intention for this plugin to be named LaTexTools or LaTexTools3?
badger
 
Posts: 5
Joined: Thu Oct 11, 2012 6:21 pm

Re: Unofficial LaTeXTools port to ST3

Postby phyllisstein on Thu Feb 21, 2013 2:46 pm

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!
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Unofficial LaTeXTools port to ST3

Postby RazerM on Thu Feb 21, 2013 9:25 pm

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.

Code: Select all
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
RazerM
 
Posts: 3
Joined: Tue Feb 19, 2013 12:38 am

Re: Unofficial LaTeXTools port to ST3

Postby phyllisstein on Fri Feb 22, 2013 12:31 am

RazerM wrote: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.


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.
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Unofficial LaTeXTools port to ST3

Postby RazerM on Tue Feb 26, 2013 7:30 pm

phyllisstein wrote:
RazerM wrote: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.


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.


Yeah the error is gone now.
RazerM
 
Posts: 3
Joined: Tue Feb 19, 2013 12:38 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 15 guests