如何在绘图中插入居中图像?

如何在绘图中插入居中图像?

考虑以下最小工作示例获取一些不错的技术绘图模板:

\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}

输出

相关内容