Latex Layer配置后build出现错误

各位好,根据spacemacs关于Latex配置的官方指引,我配置如下:

  • 环境macOS

  • 已经安装了TexLive最新版本,使用TexStudio生成pdf一切正常

  • dotspacemacs-configuration-layers增加了:chinese, auto-competion, latex

  • latex配置如下:

    (latex :variables
               latex-build-command "LatexMk"
               latex-enable-auto-fill t
               latex-enable-folding t
               )
    
  • .latexmkrc正常运行,配置如下:

    $pdf_previewer = 'open -a Skim';
    $pdflatex = 'xelatex -synctex=1 -interaction=nonstopmode';
    @generated_exts = (@generated_exts, 'synctex.gz');
    
  • Skim.app已经安装正常运行

在tex buffer下执行:SPC m b时爆出下面的错误: Wrong type argument: stringp, nil

请问这个问题该怎么解呢?

仅凭这点信息看不出来,,M-x toggle-debug-on-error 然后复现一遍,贴下完整的backtrace?

网上有类似的问题,但没有答案: https://emacs.stackexchange.com/questions/58595/spacemacs-wrong-type-argument-stringp-nil-auctex-error-when-building-tex-fi

TeX-command-expand没有收到正确的参数,这个是AucTeX包里面的函数,我怀疑是

scratch里面运行一下(executable-find "latexmk"),如果返回值不是nil的话把这一行去掉spacemacs应该就能自动设置为用latexmk编译

可以找到latexmk的路径, ”/Library/TeX/texbin/latexmk“,去掉latex-build-command之后再次对tex文件编译,相同的错误没有出现变成了下面的内容:

Running `LatexMk' on `master' with ``latexmk -pdf --synctex=1 -interaction=nonstopmode  -file-line-error -shell-escape master.tex''
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LC_ALL = (unset),
	LANG = "en_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Rc files read:
  /Users/xxx/.latexmkrc
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.

------------
Latexmk: Could not find file 'master.tex'.
-- Use the -f option to force complete processing.

看起来是默认编译对象为master.tex,这个是配置问题,我去调整下。

多谢。