tikzexternalize 在 FreeBSD 上生成损坏的 makefile

tikzexternalize 在 FreeBSD 上生成损坏的 makefile

下面mwe.tex创建一个 makefile,它不能在 FreeBSD 上运行;它主要取自手册pgfplots

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[mode=list and make]

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
\caption{Our first external graphics example}
\end{figure}

\end{document}

它被编译pdflatex mwe.tex并生成以下 makefile。

ALL_FIGURE_NAMES=$(shell cat mwe.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.

mwe-figure0.pdf: 
    pdflatex -halt-on-error -interaction=batchmode -jobname "mwe-figure0" "\def\tikzexternalrealjob{mwe}\input{mwe}"

mwe-figure0.pdf: mwe-figure0.md5

调用失败,make -f mwe.makefile输出如下

/tmp/tmp.GXQ4YxVM [ make -f mwe.makefile                                                        ] 4:18 nachm.
make: "/tmp/tmp.GXQ4YxVM/mwe.makefile" line 9: Could not find .dep
make: Fatal errors encountered -- cannot continue
make: stopped in /tmp/tmp.GXQ4YxVM

答案1

FreeBSD有自己的实现,make但与GNU实现;库生成的 makefileexternalize使用的不仅仅是POSIX的功能集make

使用GNU makeFreeBSD 提供的命令gmake,该命令gmake -f mwe.makefile生成以下输出

mkdir -p "./"
touch "mwe-figure0.dep" # will be filled later.
pdflatex -halt-on-error -interaction=batchmode -jobname "mwe-figure0" "\def\tikzexternalrealjob{mwe}\input{mwe}"
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
All images exist now. Use make -B to re-generate them.

相关内容