考虑下面的代码:
\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
),图像就会正确放置。