0

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.vim plugin manager.
  • Configured VimTex via my init.vim using 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!

  • Does latexmk work from the command line? – Dai Bowen Sep 05 '22 at 15:17
  • Excellent question! It does not. I have edited my original post to reflect this important piece of information. – iamthelabhras Sep 05 '22 at 18:22
  • So it sounds like your shell isn't recognising the distro installation, presumably even pdflatex isn'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:44
  • Are the binaries in your PATH? – frabjous Sep 07 '22 at 22:42
  • @DaiBowen, to answer your questions: (1) Yes, pdflatex generates a zsh: command not found: pdflatex command 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:54
  • Forgive me, @frabjous. Although I understand the basics of what PATH is 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 my PATH?; (2) Where would I likely find MacTex's binaries on my machine? (Currently accessing MacTex via the Applications folder on my Mac); (3) What is the best/most efficient way to add those binaries to my PATH? – iamthelabhras Sep 08 '22 at 16:56
  • You can type echo $PATH in 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/texbin is one place to look. You could add it to your PATH with export PATH=/Library/TeX/texbin:$PATH, but that will only be active in that shell or any subshells. – frabjous Sep 08 '22 at 22:13
  • If editing your PATH helps 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
  • GMRA @frabjous! Editing my .zshrc to include export PATH="/Library/TeX/texbin:$PATH" worked like a charm. latexmk is now running from the command line and VimTeX is no longer throwing errors when I open a *.tex file in Neovim. – iamthelabhras Sep 09 '22 at 17:55

0 Answers0