1

I've recently installed Visual Studio Code's LaTeX Workshop to evaluate as a replacement for TeXworks.

A document which compiles as expected using TeXworks fails in VSC, and initial troubleshooting led me to this odd response trying to run latexmk from the command line:

latexmk: The script is not registered.
latexmk: Data: scriptEngine="java", scriptName="latexmk"

While I see many people diagnosing perl installation problems with the first half of the error, I don't see the "java" reference anywhere, and can't see where latexmk is picking this up.

Strawberry perl is installed and is just behind Rtools in the path; Linter seems to work ok.

I feel like I'm missing something obvious, but don't know where latexmk is getting associated with java... Windows 7, 64 bit work computer; MiKTeX 2.9 is running the latex install.

0

With no real evidence (other than this VSCode works fine with LaTeX Workshop on my Win10 home laptop but not my work Win7 desktop) I installed the Java SDK - and suddenly I was able to call latexmk without error, and VSCode was equally pleased. Nothing to do with windows versions.

I then followed StackExchange advice to get synctex working on the office machine as well, which I'll outline here hoping it'll aid another soul:

  1. Download syntex:
  2. and associated dll:

  3. ... put them in your miktex binaries folder (for me this was C:\Program Files\MiKTeX 2.9\miktex\bin\x64)

  4. make sure VSCode knows where to find the synctex.exe (Ctrl+, search "latex-workshop.synctex.path")

  • 2
    This sounds very strange since LaTeXmk does not use java – daleif Jan 10 at 13:45
  • Right - I looked for any dependencies after seeing the scriptEngine="java" silliness above, dismissed it, but ... then didn't have any better ideas this morning. I have no explanation. – Jeff Jan 10 at 14:56
  • Those links are older / outofdate Latex-workshop acording to answer here uses .json and does not need perl or latexmk --- That's an old synctex latest update was 2018/07/15, most will work but the latest kpathsea is 630 as used in CJK w32/64 TeX – user170109 Jan 10 at 16:35
0

This site by nature has many suggestions that get out of date, so just to be clear,

This answer is for one aspect of the question at one point in time (check for future updates and please edit me when I am stale)

To currently get latest 64 bit Synctex and kpathsea630w64.dll (do not change the name)

You can extract them from the tar.xz wrapping from inside https://ctan.org/tex-archive/systems/win32/w32tex/win64/pdftex-w64.tar.xz (currently 7 MB 2019-01-08)

Find the synctex.exe and kpatsea## .dll and copy them to a path folder e.g. the miktex bin folder

32 bit users can find similar (synctex.exe & kpathsea630.dll) in this page https://ctan.org/tex-archive/systems/win32/w32tex/ ptex-w32.tar.xz (currently 7MB 2019-01-06)

  • 1
    I'm not questioning the correctness of the solution (not least because I can't verify it), but do you have any suggestion as to why SyncTeX and kpathsea are relevant for latexmk? (I mean, I could probably be convinced why kpathsea is relevant, but SyncTeX?) – moewe Jan 10 at 19:43
  • @moewe My answer is not relevant for latexmk per se since the json link suggests VS Code's LaTeX Workshop has no need for perl or the latexmk that triggered it. -- My answer is based on IF you are going to add synctex to a TeX editor repertoire its best if its the current one. but you now have me questioning why we are mixing tex live with MiKTeX which has its own – user170109 Jan 10 at 19:55
  • OK, but does that mean that this answer does not try to address the question on the top at face value? This seems to be more of a supplement to the other answer by the OP (and in particular the second part of the answer that does not deal with the question as asked). I'm only asking because this answer landed in the review queue. – moewe Jan 10 at 20:02
  • @moewe I expected that users would not find an answer to why does LaTeX Workshop fire up a json script but wished to address the OP answer that apart from adding java ! he suggests compounding issues by install an old 32 bit synctex on top of the 64 bit MiKTeX (ok BUT!). – user170109 Jan 10 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.