Question

When doing Ctrl+B on SublimeText3, the following error is output:

[Compiling first.tex]

TraditionalBuilder: Invoking latexmk... 

COULD NOT COMPILE!

Attempted command:latexmk -cd -e $pdflatex='pdflatex -interaction=nonstopmode -synctex=1 %S %O' -f -pdf first.tex
Build engine: Traditional Builder

Running the exact same command compiles a pdf file just fine.

This answer does not solve the problem, as I've

  • Removed spaces around "="

  • Done a "Reconfigure LaTeXTools and migrate settings".

  • Made sure pdflatex is installed.

  • Made sure the path for texpath is correct.

Was it helpful?

Solution

If your command runs on terminal then most likely there is an issue either with the path or with the command itself (in the file). There has been some update to the README file by the developer:

  • some distros do not want a space before and after the = in $pdflatex = %E. But some do want the space there (sigh!)
  • sometimes latexmk is not on the PATH, or the path is not correctly picked up by ST. In this case, instead of "latexmk", use "/usr/bin/latexmk" or wherever latexmk is in your system.
  • some distros require quoting the $pdflatex assignment, as in "$pdflatex = \"'%E -interaction=nonstopmode -synctex=1 %S %O'\""

So it might take a while but you'll find it eventually in the settings or the traditionalbuilder.py file. Also when I tried putting /usr/bin/latexmk, latex did not produce the correct pdf (I checked it with few changes and it just opened the old pdf) but in your case it might work. Also, at least in Arch Linux I can't run sublime with sublime-text but instead with subl so I changed that too in the settings (I don't know if it actually matters) and I needed to change the permissions for the files because user-run sublime could not access my settings files!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top