izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Filename should be quoted in SyncTeX -o option #91

Closed xax closed 8 years ago

xax commented 8 years ago

The filename should be quoted (might work cross platform) or escaped, when being passed to SyncTeX via the -o page:x:y:file option, otherwise e.g. path specifications containing a space make reverse sync fail.

This might happen in onCanvasClick regarding the variable clickspec.

50Wliu commented 8 years ago

So this is probably why Synctex isn't working for me. My PDF file has a space in it.

izuzak commented 8 years ago

Thanks for the report, @xax (and for the confirmation from @50Wliu)! I'd be happy to review a pull request if you'd like to submit one to fix this.

l0calh05t commented 8 years ago

I was testing on a different machine today, where synctex is NOT on the path and synctexPath is therefore set. On this system, paths with spaces work fine as execFile automatically takes care of quoting. For systems where synctexPath is not set, exec is used instead with a regular string. Is it possible to call a program that is on the path via execFile which is generally much safer?

So setting the path explicitly is a good workaround for now.

izuzak commented 8 years ago

There's a new version now which has changes from https://github.com/izuzak/atom-pdf-view/issues/95 -- let me know if you can still reproduce the problem