使用带有
以下是显示该行为的最小示例。
main.tex:
-output-directory
参数的 pdflatex 处理外部化的 tikz 图形时会遇到问题。尽管 .md5 文件在我期望的位置创建,但创建外部化图片文件(.pdf、.log、.dpth)的命令失败了。我的假设是,这是因为用于创建这些文件的 pdflatex
没有继承 -output-directory
选项,因此未能将文件创建在正确的位置。以下是显示该行为的最小示例。
main.tex:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikz/]
\begin{document}
Test externalize in combination with -output-directory
\tikzsetnextfilename{testpicture}
\begin{tikzpicture}
\node {Node};
\end{tikzpicture}
\end{document}
bash:
mkdir -p build/tikz
pdflatex -output-directory build -shell-escape main.tex
错误:
===== 'mode=convert with system call': Invoking 'pdflatex
-shell-escape -halt-on-error -interaction=batchmode -jobname
"tikz/testpicture" "\def\tikzexternalrealjob{main}\input{main}"'
======== This is pdfTeX, Version 3.14159265-2.6-1.40.16
(TeX Live 2015/Debian) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
! I can't write on file `tikz/testpicture.log'.
生成的目录结构(tree
输出):
.
├── build
│ ├── main.aux
│ ├── main.auxlock
│ ├── main.log
│ ├── main.pdf
│ └── tikz
│ └── testpicture.md5
└── main.tex
据我所知,日志文件创建失败是由于外部化执行的pdflatex
命令的工作目录中缺少tikz目录。
我的假设是否正确?如果是,我该如何继续进行?