![如何在绘图中插入居中图像?](https://linux22.com/image/478561/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%BB%98%E5%9B%BE%E4%B8%AD%E6%8F%92%E5%85%A5%E5%B1%85%E4%B8%AD%E5%9B%BE%E5%83%8F%EF%BC%9F.png)
考虑以下最小工作示例获取一些不错的技术绘图模板:
\documentclass{report}
\pagestyle{empty}
\usepackage[a3paper, landscape]{geometry}
\usepackage{circuitikz}
\begin{document}
\begin{tikzpicture}[overlay, remember picture]
\draw (current page.center) ++(-20,14) coordinate (NW) % using 40x28cm because A3 has 420x297
-- ++(40,0) coordinate (NE)
-- ++(0,-28) coordinate (SE)
-- ++(-40,0) coordinate (SW)
-- cycle;
\foreach \x [count=\i from 1] in {0,5,...,35}
\draw (NW) ++(\x,0) rectangle ++(5,-1) ++(-2.5, 0.5) node[]{\i};
\end{tikzpicture}
\end{document}
结果截图:
问题:
如何插入位于白色区域中间的图像?
如果我只是使用\includegraphics{filename}
整个边框就会移出页面......
所需状态的屏幕截图:
答案1
\documentclass{report}
\pagestyle{empty}
\usepackage[a3paper, landscape]{geometry}
\usepackage{circuitikz}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}[overlay, remember picture]
\draw[blue] (current page.center) ++(-20,14) coordinate (NW) % using 40x28cm because A3 has 420x297
-- ++(40,0) coordinate (NE)
-- ++(0,-28) coordinate (SE)
-- ++(-40,0) coordinate (SW)
-- cycle;
\foreach \x [count=\i from 1] in {0,5,...,35}
\draw (NW) ++(\x,0) rectangle ++(5,-1) ++(-2.5, 0.5) node{\i};
% ^ the yshift is half this number "-1", in this case, -0.5.
\node[yshift=-0.5cm] at (current page.center){\includegraphics[scale=3]{example-image}};
\end{tikzpicture}
\end{document}