[Tex/LaTex] Latexmk script could not be found

miktexwindows

So I use Atom for my editing of latex documents and their plugin says that Texify is no longer supported. Before this bites me (I'm still relatively new to LaTeX so I save/build after every few commands I add), I want to make sure to get latexmk working on my computer.

I've installed a Perl interpreter (ActiveState Perl) and when I invoke perl from a commandline, it works fine. However, when I try to run latexmk, I get thrown the following error message.

latexmk.exe: The script could not be found.
latexmk.exe: Data: scriptEngine="perl", name="latexmk", path="scripts/latexmk/perl/latexmk.pl"

I used the MiKTeX package manager and made sure to run it as an administrator, and it installs fine (I can manually verify the existence of the script it's looking for in E:\LaTeX\scripts\latexmk\perl\latexmk.pl), but it just won't run.

I'm not entirely sure why it's not working, but I have a hunch that it's due to the fact Perl is installed on my C:\ drive, while MiKTeX is installed on my E:\ drive.

Best Answer

I have found a solution. I downloaded the latexmk sourcefiles from this link: personal.psu.edu/jcc8//software/latexmk-jcc/latexmk-448.zip

I unzipped the file that I downloaded, and then I copied latexmk.pl and latexmk.bat to the directory of the error. In my case the error directory was scripts/latexmk/perl/latexmk.pl I had to create the latexmk/perl/ directory under C:\Program Files\MiKTeX 2.9\scripts

Then I copied the 2 files to the following directory: C:\Program Files\MiKTeX 2.9\scripts\latexmk\perl And then I ran the MikTex update (admin) tool that came with the installation of MikTeX. I rebooted my computer and then my TexStudio was able to compile the file with latexmk.