当我同时拥有tikz-external
和一个chemfig
分子时出错
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzsetfigurename{figure_\arabic{part}.\arabic{section}.} % set figure names
\tikzset{external/system call={%
lualatex \tikzexternalcheckshellescape
--halt-on-error
--shell-escape
--interaction=batchmode
--jobname "\image" "\texsource"
% --jobname "\image" \subfilename
}}
\tikzexternalize[
up to date check={simple}, % faster check
figure list={true}, % generate list of figures file
prefix={./}
] % turn externalization on/off
\usepackage{chemfig}
\begin{document}
\tikzset{external/remake next=true}
\chemfig{
C(-[90,.5])(-[-90,.5])
-C(-[90,.5])(-[-90,.5]Cl)
}
% Cant compile
% \chemfig{-[@{op,.25}]
% C(-[90,.5])(-[-90,.5])
% -C(-[90,.5])(-[-90,.5]Cl)
% -[@{cl,.75}]}
% \polymerdelim{op}{cl}
\end{document}
必须补充一点,即使在没有第二张图的情况下编译得很好,错误似乎也出现在第一个图上。可以看出,所有命令\polymerdelim{op}{cl}
的行为都发生了变化。\chemfig
摘自figure_0.0.0.log
(第一张图)
Runaway argument?
! File ended while scanning use of \tikzexternal@laTeX@collect@until@end@tikzpicture.
<inserted text>
\par
<*> \def\tikzexternalrealjob{main}\input{main}
来自 MS-SPO
取消注释该部分时,错误消息可能是% Cant compile
:
! Package tikz Error: Sorry, the system call 'lualatex -shell-escape --halt-on-
error --shell-escape --interaction=batchmode --jobname "./figure_0.0.0" "\def\t
ikzexternalrealjob{externalChemfig}\input{externalChemfig}"' did NOT result in
a usable output file './figure_0.0.0' (expected one of .pdf:.jpg:.jpeg:.png:).
Please verify that you have enabled system calls. For pdflatex, this is 'pdflat
ex -shell-escape'. Sometimes it is also named 'write 18' or something like that
. Or maybe the command simply failed? Error messages can be found in './figure_
0.0.0.log'. If you continue now, I'll try to typeset the picture.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
在下列情况下似乎没有改变:
- 将编译从 切换
pdflatex
至lualatex
- 移动
chemfig
包裹之前tikz
虽然它可以编译(pdflatex 和 lualatex),但此行一直被注释:
% \polymerdelim{op}{cl}