简而言之,我正在使用 tikz externalize。使用以下命令编译我的主要 tex 文件:
pdflatex --enable-write18 --extra-mem-bot=10000000 --synctex=1 lecture-notes.tex
它会生成一个 make 文件。然后,当我尝试使用以下命令运行它时:
sudo make -f lecture-notes.makefile
我收到此错误:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "lecture-notes-figure0" "\def\tikzexternalrealjob{lecture-notes}\input{lecture-notes}"
/bin/sh: 1: pdflatex: not found
lecture-notes.makefile:16: recipe for target 'lecture-notes-figure0.pdf' failed
make: *** [lecture-notes-figure0.pdf] Error 127
由于某种原因,make 无法找到 pdflatex。有趣的是,当我自己在控制台中运行该命令时:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "lecture-notes-figure0" "\def\tikzexternalrealjob{lecture-notes}\input{lecture-notes}"
它运行完美。
我尝试了建议的解决方法这里,但这对我不起作用。
最后,我想说一下,当我自己运行 makefile 中的第一个配方时,然后将其注释掉,最后运行:
sudo make -f lecture-notes.makefile
我得到了期望的输出。
有任何想法吗?
编辑:这是 makefile 的前几行(之后,它只是按照下面的模式重复)
ALL_FIGURE_NAMES=$(shell cat lecture-notes.figlist)
ALL_FIGURES=$(ALL_FIGURE_NAMES:%=%.pdf)
allimages: $(ALL_FIGURES)
@echo All images exist now. Use make -B to re-generate them.
FORCEREMAKE:
-include $(ALL_FIGURE_NAMES:%=%.dep)
%.dep:
mkdir -p "$(dir $@)"
touch "$@" # will be filled later.
lecture-notes-figure0.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "lecture-notes-figure0" "\def\tikzexternalrealjob{lecture-notes}\input{lecture-notes}"
lecture-notes-figure0.pdf: lecture-notes-figure0.md5
externalized_figures/lecture-notes-figure1.pdf:
PATH=/usr/texbin:$PATH
externalized_figures/lecture-notes-figure1.pdf: externalized_figures/lecture-notes-figure1.md5
externalized_figures/lecture-notes-figure2.pdf:
PATH=/usr/texbin:$PATH
externalized_figures/lecture-notes-figure2.pdf: externalized_figures/lecture-notes-figure2.md5