如何防止在 tabularx 中放置 chemfig 图片时尝试将其外部化时产生错误?

如何防止在 tabularx 中放置 chemfig 图片时尝试将其外部化时产生错误?

我正在尝试将一些chemfig图表放入我的 tabularx。我已经让表格按照我想要的方式显示,但是我只是想将tikz绘图外部化以加快编译速度,结果遇到了错误。我遇到了问题似乎是说,这简单地禁用了外部化的tabu必要性:是否存在类似的问题?他们给出的答案是,只需构建没有的表即可。\write18tikztabularxtabu

我对 Latex 也还很陌生,所以任何建议都非常感谢。谢谢。

tikzpicture此外,文档中还有另一个,但是我在编译之后添加了它,因为chemfig图表已经很慢,并且外部化没有问题。

这是我收到的错误:

Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "tikz/output-figure0" "\def\tikzexternalrealjob{output}\input{output}"' did NOT result in a usable output file 'tikz/output-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -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 'tikz/output-figure0.log'. If you continue now, I'll try to typeset the picture.

在此处输入图片描述

以下是代码:

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[version=4]{mhchem}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{ragged2e}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\usepackage{siunitx}
\usepackage{gensymb}
\usepackage{chemfig}
\usepackage{appendix}
\usepackage{tikz}
\usepackage{comment}

\usetikzlibrary{shapes.geometric, arrows, positioning, external}

\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]

\tikzstyle{arrow} = [thick,->,>=stealth]


\tikzexternalize[prefix=tikz/,optimize command away=\includepdf]

\addbibresource{ref.bib}

\begin{document}
...
\begin{table}[htbp]
    \tiny
    \centering
    \renewcommand\arraystretch{2.2}
    \caption{Overview of ligands and their respective complex's synthesis\\}
    \label{tab:plan-5.1}
    \begin{adjustbox}{center}
    \begin{tabularx}{1.2\textwidth}{*{8}{X}}
        \toprule
         Complex&Final [complex] in solution [M]&Volume of solution required [mL]&Reactants required&Amounts of reactants&Glassware required&Time required&Ligand structure  \\ 
         \midrule \\
         \ce{[Co(OH2)6]^{2+}}       &0.00420    &500    &\ce{Co(NO3)2}\newline deionised \ce{H2O}
                                                        &0.613 [g] \newline 500 [mL]
                                                        & Beaker
                                                        & 5 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{O(-[7]H)(-[5]H)}
                                                        \end{tikzpicture} \\
         \ce{[Co(\textit{gly})3]}   &0.508      &15     &\ce{[Co(OH2)]^{2+}}\newline \ce{H2O2} 3\% \newline sodium glycinate
                                                        &10 [mL] \newline 5 [mL] \newline 0.74 [g]
                                                        &Measuring cylinder, beaker
                                                        &10 mins 
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{O-[7](=[6]O)(-[1]-[7]N(-[6]H)(-[1]H))}
                                                        \end{tikzpicture} \\
         \ce{[Co(ox)3]^{3-}}        &0.421      &20     &\ce{[Co(OH2)]^{2+}}\newline \ce{K2C2O4.H2O}\newline \ce{H2O2} 3\%
                                                        &10 [mL] \newline 1.55 [g] \newline 10 [mL]
                                                        &Measuring cylinder, beaker 
                                                        &20 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{O-[7]C(-[5]O)(-C(-[1]O)(-[7]O))}
                                                        \end{tikzpicture} \\
         \ce{[Co(CO3)3]^{3-}}       &0.00407    &101    &Cobalt(II) nitrate hexahydrate \newline \ce{H2O}\newline \ce{H2O2} 3\%\newline \ce{NaHCO3}
                                                        &2.99 [g] \newline\newline\newline 100 [mL] \newline 1 [mL] \newline 16.96 [g]
                                                        &Measuring cylinder, beaker 
                                                        &5 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{O-[7]C(-[1]O)(=[6]O)}
                                                        \end{tikzpicture} \\
         \ce{[Co(OH2)6]^{3+}}       &0.000814   &100    &\ce{[Co(CO3)3]^{3-}}\newline \ce{HNO3}             
                                                        &20 [mL] \newline 80 [mL]
                                                        &Measuring cylinder, beaker 
                                                        &5 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{O(-[7]H)(-[5]H)}
                                                        \end{tikzpicture} \\
         \ce{[Co(phen)3]^{3+}}      &0.000407   &100    &phenanthroline\newline \ce{[Co(OH2)]^{3+}}\newline \ce{H2O2} 3\%         
                                                        &0.115 [g] \newline 10 [mL] \newline 10 [mL]
                                                        &Measuring cylinder, beaker 
                                                        &10 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig[baseline=(vide)]{*6(=-(*6(-=-(*6(-=-=@{vide}N-))=-))=-N=-)}
                                                        \end{tikzpicture} \\
         \ce{[Co(NO2)6]^{3-}}       &0.00000104 &50     &Cobalt(II) nitrate hexahydrate \newline \ce{NaNO2} \newline \ce{H2O}\newline acetic acid           
                                                        &0.38 [g] \newline\newline\newline 3.07 [g] \newline 50 [mL] \newline 1.5 [mL]
                                                        &Measuring cylinder, beaker 
                                                        &10 mins
                                                        &\begin{tikzpicture}
                                                            \setchemfig{atom style={scale=0.7}}\chemfig{N(-[7]O)(=[5]O)}
                                                        \end{tikzpicture} \\
         \bottomrule
    \end{tabularx}
    \end{adjustbox}
\end{table}
...
\end{document}

相关内容