Home Download Buy Blog Forum Support

Unofficial LaTeXTools port to ST3

Re: Unofficial LaTeXTools port to ST3

Postby Talaf on Thu Jun 06, 2013 10:58 am

Hi,

No it didn't. I actually debugged it a bit, and the problem seems to be on the DDE connection to Sumatra's service... I "fixed" it by simply using the command line rather than DDE to forward search. I changed the code in jumptoPDF.py as follow, from line 84 :
Code: Select all
      elif plat == 'win32':
         # determine if Sumatra is running, launch it if not
         print("Windows, Calling Sumatra")
         # hide console
         startupinfo = subprocess.STARTUPINFO()
         startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
         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 str(tasks):
            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
         setfocus = 0 if keep_focus else 1
         if forward_sync:
                                # Use the command line facility rather than DDE to forward search
            subprocess.Popen("SumatraPDF.exe -reuse-instance -forward-search %s %d %s" % (srcfile,line,pdffile))


This is probably not ideal, that being said DDE is an old facility. It is also probably related to Python 3 rather than Sublime... I'll use this method for now and I'll go back to more tests later if I have more time ;-)
Talaf
 
Posts: 4
Joined: Thu May 30, 2013 2:32 pm

Re: Unofficial LaTeXTools port to ST3

Postby randy3k on Thu Jun 06, 2013 1:34 pm

Talaf wrote:Hi,

No it didn't. I actually debugged it a bit, and the problem seems to be on the DDE connection to Sumatra's service... I "fixed" it by simply using the command line rather than DDE to forward search. I changed the code in jumptoPDF.py as follow, from line 84 :
Code: Select all
      elif plat == 'win32':
         # determine if Sumatra is running, launch it if not
         print("Windows, Calling Sumatra")
         # hide console
         startupinfo = subprocess.STARTUPINFO()
         startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
         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 str(tasks):
            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
         setfocus = 0 if keep_focus else 1
         if forward_sync:
                                # Use the command line facility rather than DDE to forward search
            subprocess.Popen("SumatraPDF.exe -reuse-instance -forward-search %s %d %s" % (srcfile,line,pdffile))


This is probably not ideal, that being said DDE is an old facility. It is also probably related to Python 3 rather than Sublime... I'll use this method for now and I'll go back to more tests later if I have more time ;-)

Nice solution.
By the way, your solution doesn't work for filenames with spaces.
It may be better.
Code: Select all
subprocess.Popen(["SumatraPDF.exe","-reuse-instance","-forward-search", srcfile, str(line), pdffile])
randy3k
 
Posts: 47
Joined: Sun Nov 18, 2012 5:16 am

Re: Unofficial LaTeXTools port to ST3

Postby bianjiang on Thu Jun 06, 2013 8:34 pm

Desilusionado wrote: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? :D


Don't have a linux box... so not sure...
bianjiang
 
Posts: 9
Joined: Tue Mar 12, 2013 1:54 am

Re: Unofficial LaTeXTools port to ST3

Postby phyllisstein on Tue Jun 11, 2013 10:48 am

Hi all,
Apologies for missing some of the activity on this forum. I get so used to attending mostly to the Github "Issues" interface that I sometimes forget it's here! But my grateful thanks to @bianjiang for pointing out the self.envi issue. @Desilusionado, could you confirm that you're still experiencing your problem with the latest Github commits? I found that some code I pulled in to help the plugin work with the temporary directory was causing silent, low-level issues with LaTeX, and though I think I have it fixed under OS X/Linux I'm still not sure about Windows. If you'd like to help debug it, please get in touch via e-mail; my address is d-at-daniel-dot-sh.

And finally, thanks for the new jumpToPDF code, @randy3k. I'm always hesitant to make sweeping changes to the original author's work, but I'll definitely consider pulling that or something similar in if DDE is causing serious problems.
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Unofficial LaTeXTools port to ST3

Postby Marciano on Sun Jun 30, 2013 9:06 am

Hi all,

I'm the original LaTeXTools author. Good news: I'm in the process of producing an "official" port of LaTeXTools to ST3, which no includes westacular's super-good ref/cite completion code. Bad news: I've only just started :) Of course, I'm drawing freely from phyllisstein's EXCELLENT work, so things will move on quickly, I hope.

I didn't pull in phyllisstein's code directly because (1) he added a few things (e.g. different directory for aux files, other previewers) that I'd like to do differently and in any case later, and (2) some of the recent fixes/additions would have required further work merging. In any case, I'm consulting (make that cut-and-pasting) phyllisstein's code extensively!

You can follow what I"m doing in the 'st3' branch. WARNING: right now things are basically still broken, so keep using phyllisstein's port for now. I'll let you know when you can start pulling my branch.

phyllisstein, I've already thanked you in private, but I'll do so publicly now: THANKS!!! I'll have several questions and requests for you soon :)

Thanks for your patience! M
Marciano
 
Posts: 146
Joined: Fri Sep 18, 2009 2:55 am

Re: Unofficial LaTeXTools port to ST3

Postby Marciano on Mon Jul 01, 2013 8:13 am

Ends up I was too pessimistic. Official announcement:

viewtopic.php?f=5&t=12940&start=0

Cheers,
Marciano.
Marciano
 
Posts: 146
Joined: Fri Sep 18, 2009 2:55 am

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests