我一直在尝试使用 tikz 精确定位图像article
,但当我\includegraphics
在定义的节点上使用时,垂直和水平方向都会有一些小的偏移。我希望下面的代码能够生成一个黑色矩形,完美地适合我绘制的线条,并且如果我不必手动添加负移位来让东西用眼睛对齐,我会更喜欢它。
任何帮助或见解都将不胜感激!
\documentclass[letterpaper]{article}
\usepackage{tikz}
\usepackage[left=0in,top=0in,right=0in,bottom=0in,verbose,nohead,nofoot]{geometry}
\usepackage[absolute,overlay]{textpos}
\thispagestyle{empty}
\begin{document}
%
\begin{tikzpicture}[remember picture,overlay]
\node [shift={(-8.5in,-11in)}] at (current page.north east)
{%
\begin{tikzpicture}[remember picture, overlay]
%
\path (0.5in,0.25in) node (p1) {};
\path (3in,0.25in) node (p2) {};
\path (8in,0.25in) node (p3) {};
\path (0.5in,3.75in) node (p4) {};
\path (8in,3.75in) node (p5) {};
\path (0.5in,10.75in) node (p6) {};
\path (3in,10.75in) node (p7) {};
%
\node[anchor=south west] at (p1.center)
{\includegraphics[width=2.5in,height=3.5in]{./black.png}};
%
\draw[very thin, blue!50] (p1.center) to (p3.center);
\draw[very thin, blue!50] (p4.center) to (p5.center);
\draw[very thin, blue!50] (p1.center) to (p6.center);
\draw[very thin, blue!50] (p2.center) to (p7.center);
%
\end{tikzpicture}
};
%
\end{tikzpicture}
\end{document}