![使用 XeLaTeX 时 tikzpicture 内的图像定位错误](https://linux22.com/image/250105/%E4%BD%BF%E7%94%A8%20XeLaTeX%20%E6%97%B6%20tikzpicture%20%E5%86%85%E7%9A%84%E5%9B%BE%E5%83%8F%E5%AE%9A%E4%BD%8D%E9%94%99%E8%AF%AF.png)
考虑下面的代码:
\tikzstyle{box}=[draw, fill=brown!40, text width=7em,
text centered, minimum height=7em, rounded corners]
\tikzstyle{usb}=[draw, fill=blue!40, text width=3em,
text centered, minimum height=3em]
\pgfdeclareimage[width=10em]{smarthomes}{smarthomes}
\pgfdeclareimage[width=10em]{ekg}{ekg}
\pgfdeclareimage[width=10em]{quadro}{quadro}
\begin{tikzpicture}
\node (and) [box] {first device};
\path (and)+(5.5em,0) node (usb) [usb] {USB};
\path (and)+(11em,0) node (mk) [box,fill=green!40] {second device};
\path (and)+(25em,10em) node (home) [] {\pgftext{\pgfuseimage{smarthomes}}};
\path (and)+(25em,0) node (quadro) [] {\pgfbox[center,center]{\pgfuseimage{quadro}}};
\path (and)+(25em,-10em) node (ekg) [] {\pgfbox[center,center]{\pgfuseimage{ekg}}};
\draw [thick] (mk.east) to ($(home) - (5em,0)$);
\draw [thick] (mk.east) to ($(quadro) - (5em,0)$);
\draw [thick] (mk.east) to ($(ekg) - (5em,0)$);
\end{tikzpicture}
当我使用 PDFLaTeX 时一切正常,但如果我使用 XeLaTeX,则图像在适当的节点中不会定位。
答案1
这似乎是 XeTeX 驱动程序中的一个错误。如果我使用\includegraphics
(但没有\pfgtext
或\pgfbox
),图像就会正确放置。