13

I would like to use Atom in Windows as my primary editor for LaTeX documents. However, the synchronization features of Atom's pdf-view (which is leveraged by latex-plus) requires a synctex binary. It will use the binary if it is in the %PATH%, or it can be specified in the settings.

The MikeTeX package I've been using does not seem to ship with any such binary.

Q - What is the best way to obtain the synctex binary that pdf-view is looking for?

References

Background

I'm using MikeTeX 2.9.5496 on a Windows machine, and trying to get Atom set up as my default editor in that environment.

I've been using TeXStudio for a couple years now using the proTeX installer in Windows (and on Ubuntu too with TexLive powering it) and have been very happy with it, but am trying to set up an alternative.

As stated on the LaTeX Editors/IDEs entry, it should work with a combination of plugins for best performance.

I've installed the following plugins to get this working:

  • language-latex
  • linter-chktex
  • latexer
  • latex-plus
  • pdf-view

Everything is working except for the synchronization features.

  • Welcome! Does TeX Live supply a binary for Windows? If so, you could either install TL or request MikTeX to include it. – cfr Nov 08 '16 at 02:08
  • I can't really find any mention anywhere of a standalone SyncTeX binary except in the pdf-view plugin that is looking for it. SyncTeX is a PDF indexing system that is built into pdflatex, I'm not sure what this standalone binary would do. – Jedidiah Bartlett Nov 08 '16 at 03:22
  • I have it. It is part of my TeX Live installation. I'm assuming it is provided by TeX Live on other platforms, too, but I cannot check this. Hence the question. – cfr Nov 08 '16 at 03:24
  • I installed Tex Live on my windows machine, and it didn't appear. But the install threw an error at the end, I think it doesn't want to coexist with MikeTex (which is nice in Windows without a native package management system). I'll give it another try in a VM tomorrow. – Jedidiah Bartlett Nov 08 '16 at 03:30
  • Sorry - I have no idea about Windows. Maybe it only exists for Unix-ish systems. I just don't know. – cfr Nov 08 '16 at 03:52
  • Got it sorted out on Windows and Linux, both using TeXLive installs with Visual Studio Code as the editor. Nice note from ig about using chocolaty to get it for MikeTeX now! Will be good for those that don't want to switch. – Jedidiah Bartlett Dec 02 '18 at 22:44
  • 1
    Have you tried to install the miktex-synctex-bin-x64-2.9 package via the MikTeX Console. I would be interested if this is a good solution to the problem. – Matthias Arras Mar 17 '20 at 10:18
  • @MatthiasArras, I'm using the MikTeX synctex package without kpathseaXXX.dll, and PDF --> source seems to be working properly, but the opposite does not. It may just be a problem with my system though, and I don't have time to test it thoroughly right now. – RobotRaven Mar 25 '20 at 17:29

2 Answers2

14

The binary in question is distributed (only) as part of TeXLive and should be installed in the TeXLive binary folder (something like C:\texlive\2016\bin\win32\synctex.exe). Note, however, that its only installed if you select the full scheme (which is the default). You can probably get away with installing TeXLive, copying the executable and kpathseaXXX.dll to another folder on your PATH and removing the rest of TeXLive, but I've never really tried that.

Incidentally, SyncTeX isn't just built into pdflatex. It consists of both an extension to pdflatex (and friends) which writes a .synctex file and a library for parsing those files into usable records. This latter part is usually embedded in the viewer binary, but TeXLive also provides a binary (synctex) that allows access to the same parsing information via the command line.


Edit: As @ChrisCharabaruk points out in the comments, synctex and the related kpathseaXXX.dll can now be installed using Chocolatey, a package manager for Windows. If you don't have Chocolatey installed, you can install it using the installation instructions found here. Once you have Chocolatey installed, you can install the synctex package, which should be as easy as:

choco install synctex

ig0774
  • 1,970
  • I was able to install TeXLive on my windows machine using the full CD download, and then everything worked. However, because it was being found first in my %PATH%, TeXStudio wouldn't work properly. I'm not sure why, because TeXStudio should just be calling pdflatex, and shouldn't care if it's MikeTeX or TeXLive. – Jedidiah Bartlett Nov 22 '16 at 18:25
  • 3
    To add to @ig0774's comment, I can confirm that just placing synctex.exe and the kpathsea622.dll from the TeXLive snv, into the MiKTeX path \MiKTeX 2.9\miktex\bin\x64 works fine with Atom and pdf-view – Ash Mar 01 '17 at 13:50
  • 3
    Here's an updated link for the kpathsea622.dll:https://github.com/aminophen/w32tex-build/blob/master/kpathsea622.dll – oerpli Apr 28 '17 at 14:01
  • 2
    And the corresponding link for synctex.exe: https://github.com/aminophen/w32tex-build/blob/master/synctex.exe. I haven't tested it, however. – ig0774 Apr 28 '17 at 16:22
  • 1
    It doesn't have to be in Miktex' path. Just somewhere in the PATH. Also the latest exe needs the latest dll from github ( https://github.com/aminophen/w32tex-build/blob/master/kpathsea623.dll ) – domenukk Sep 16 '17 at 09:55
  • 3
    There's now a synctex package for Chocolatey, which should make things a lot easier for anyone who has it installed on their system. – Chris Charabaruk Mar 28 '18 at 14:41
6

For those who found that the above answer did not work.

You can get SyncTeX to work on Atom via the following:

  1. Download synctex.exe and kpathsea623.dll.
  2. Place these inside \MiKTeX 2.9\miktex\bin\x64 or any %PATH%folder for Atom to find.

This should work for VSCode as well.

Remark: The file kpathsea623.dll is what synctex asked for when I clicked the executable; not kpathsea622.dll as the above answer states. Moreover, it worked without kpathsea622.dll being present, so I am not too sure whether it is related to synctex. In any case, if kpathsea623.dll does not work, try kpathsea622.dll or both.

junsheaf
  • 171
  • That source may be an older version (2012?) and on occasion may report no msvcr100 or msvcr120.dll on a computer that does not have Visual C++ from about 2010 or 2012 installed. There are for 32bit users links that lead to in my case http://mirror.ox.ac.uk/sites/ctan.org/systems/win32/w32tex/ where the latest synctex.exe & kpathsea630.dll can be found I have not tested on a 64bit machine as I don't run VScode or Atom perhaps you can check ? –  Dec 03 '18 at 02:46
  • Once you have tested if 32bit runs on 64bit your reward if you can extract from the double xz tar wrapping you will find kpathsea630w64.dll and last weeks 64bit synctex.exe inside https://ctan.org/tex-archive/systems/win32/w32tex/win64 pdftex-w64.tar.xz (7 MB 2018-11-24 ) –  Dec 03 '18 at 03:01
  • The 64bit synctex works well. I won't bother testing out the 32bit synctex since it will most likely work. In any case, for those who would like to use the 64bit synctex, just download the 64bit file mentioned by @KJO, and place both synctex and kpathsea630w64.dll in the x64 MiKTeX folder. Do NOT remove the w64. – junsheaf Dec 07 '18 at 00:33