The Problem (Overview)
latexmk is not initializing in Neovim when I open a *.tex file. Furthermore, installation chronically fails when I attempt to install/reinstall latexmk using the TeX Live Utility.
The Problem (Detailed)
I'm a Neovim user looking to begin learning how to take notes & create academic papers using LaTeX. To this end, I recently:
- Installed MacTex on my Macbook (running Catalina Version 10.15.7).
- Installed VimTeX plugin via my
init.vimplugin manager. - Configured VimTex via my
init.vimusing the following settings:
let g:vimtex_view_method='skim'
let g:vimtex_quickfix_enabled=0
let g:tex_flavor='latex'
set conceallevel=2
However, when I open a *.tex file in Neovim, I receive the following errors:
VimTeX: latexmk is not executable
VimTeX: Compiler was not initialized!
A bit of sleuthing turned up this old TeX - LaTeX Stack Exchange post which appeared to reference a near identical error. Opening TeX Live Utility on my machine and searching for "latexmk" under Packages shows that universal-darwin is installed on my machine; however, attempting to reinstall universal-darwin (or any of the other versions of latexmk) consistently returns an "Install failed" message.
Opening the log reveals:
2022-09-05 00:20:50 +0000 Notice -[TLMMainWindowController _isCorrectDatabaseVersionAtURL:][7166] Checking database version in case preferences have been changed…
2022-09-05 00:20:50 +0000 Notice -[TLMMainWindowController _installPackagesWithNames:reinstall:][7166] Beginning install of (
latexmk
)
from https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/
2022-09-05 00:20:50 +0000 Notice -[TLMAuthorizedOperation main][7166] Checking code signature before running tlu_ipctask as root…
2022-09-05 00:20:50 +0000 Notice /usr/bin/codesign[7166] /Applications/TeX/TeX Live Utility.app/Contents/MacOS/tlu_ipctask: valid on disk
/Applications/TeX/TeX Live Utility.app/Contents/MacOS/tlu_ipctask: satisfies its Designated Requirement
2022-09-05 00:20:50 +0000 Notice -[TLMAuthorizedOperation main][7166] Signature was valid, okay to run tlu_ipctask
2022-09-05 00:20:54 +0000 Notice -[TLMAuthorizedOperation main][7166] Invoking privileged task via AuthorizationExecuteWithPrivileges
2022-09-05 00:20:54 +0000 Notice tlu_ipctask[15405] dropped privileges to user nobody
2022-09-05 00:20:55 +0000 Notice -[TLMAuthorizedOperation setWrapperPID:][7166] tlu_ipctask checking in: tlu_ipctask pid = 15405
2022-09-05 00:20:56 +0000 Notice -[TLMAuthorizedOperation setUnderlyingPID:][7166] tlu_ipctask checking in: pid = 15406 (/Library/TeX/texbin/tlmgr --machine-readable --repository https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/ --persistent-downloads install --reinstall latexmk)
2022-09-05 00:20:56 +0000 Notice tlu_ipctask[15405] tlu_ipctask: child HOME = '/var/root'
2022-09-05 00:20:56 +0000 Notice tlu_ipctask[15405] tlu_ipctask: current HOME = '/var/empty'
2022-09-05 00:20:58 +0000 Warning tlu_ipctask[15405] start load https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/
2022-09-05 00:20:59 +0000 Warning tlu_ipctask[15405] finish load https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/
2022-09-05 00:20:59 +0000 Warning tlu_ipctask[15405] tlmgr: Terminating; please see warning above!
2022-09-05 00:20:59 +0000 Notice tlu_ipctask[15405] location-url https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/
2022-09-05 00:21:00 +0000 Notice -[TLMAuthorizedOperation _runUntilChildExit][7166] kqueue noted that pid 15406 exited (/Library/TeX/texbin/tlmgr --machine-readable --repository https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/ --persistent-downloads install --reinstall latexmk)
2022-09-05 00:21:00 +0000 Notice tlu_ipctask[15405] child process pid = 15406 exited
2022-09-05 00:21:01 +0000 Notice tlu_ipctask[15405] exit status of pid = 15406 was 255
2022-09-05 00:21:01 +0000 Notice -[TLMAuthorizedOperation _runUntilChildExit][7166] exit status of pid = 15405 was 255
2022-09-05 00:21:01 +0000 Notice -[TLMAuthorizedOperation _runUntilChildExit][7166] kqueue noted that tlu_ipctask (pid = 15405) exited with status 255
To add to the confusion, although TeX Live Utility indicates that latexmk is installed, it is not available on the command line:
$ latexmk
zsh: command not found: latexmk
Furthermore - and I'm not sure if this is related at all to this issue, but I'll mention it here just in case - running tlmgr on the command line returns the same message:
$ tlmgr
zsh: command not found: tlmgr
As I mentioned earlier, I'm new to LaTex, so I'm afraid this problem is completely opaque to me. I presume the issues with the compiler will resolve if I can get latexmk to work...but I'm not 100% sure about that.
Any insight, help, or suggestions would be greatly appreciated!
latexmkwork from the command line? – Dai Bowen Sep 05 '22 at 15:17pdflatexisn't working from terminal? Are you able to run latex through a gui? Given your other question have you restarted since installing? – Dai Bowen Sep 06 '22 at 14:44PATH? – frabjous Sep 07 '22 at 22:42pdflatexgenerates azsh: command not found: pdflatexcommand line error; (2) Yes, I am able to run LaTeX via the LaTexiT auto-installed by/within MacTex; (3) Yes, I have restarted my Macbook since installing. – iamthelabhras Sep 08 '22 at 16:54PATHis and how it works, in situations like this I find I learn more from experienced users when I ask questions that presume zero previous knowledge of Unix, Linux, the CLI, etc.. That said: (1) I'm running Zsh. How can I check the binaries in myPATH?; (2) Where would I likely find MacTex's binaries on my machine? (Currently accessing MacTex via theApplicationsfolder on my Mac); (3) What is the best/most efficient way to add those binaries to myPATH? – iamthelabhras Sep 08 '22 at 16:56echo $PATHin the terminal to see your current PATH. What you'll get is a list of folders separated by colons:. These are where commands are looked for. I think it's already clear that they aren't in your path or you wouldn't be getting those "command not found" errors. I use linux, not mac, so I don't know where MacTeX installs its binaries, but part of the log you posted makes it look like/Library/TeX/texbinis one place to look. You could add it to your PATH withexport PATH=/Library/TeX/texbin:$PATH, but that will only be active in that shell or any subshells. – frabjous Sep 08 '22 at 22:13PATHhelps and you want to make it permanent, I don't know from firsthand experience the best way to do that on a mac so it also affects programs launched from the GUI (I only know how I'd do it on linux), but this article suggests editing to/etc/paths. To be clear, I don't know how to solve your problem, but this might help pinpoint the cause. – frabjous Sep 08 '22 at 22:16.zshrcto includeexport PATH="/Library/TeX/texbin:$PATH"worked like a charm.latexmkis now running from the command line and VimTeX is no longer throwing errors when I open a*.texfile in Neovim. – iamthelabhras Sep 09 '22 at 17:55