
이 MWE에서는 \myfig
수평으로 절반 정도 이동된 것으로 보입니다 \pgflinewidth
.
\documentclass{article}
\usepackage{tikz}
\def\myfig{\includegraphics[height=1cm, width=\linewidth]{example-image-a4-numbered}}
% just fooling around:
\begin{document}
Reference:\\
\myfig
This works:\\
\begin{tikzpicture}
\draw (0,0) node[inner sep=0] { \myfig };
\end{tikzpicture}
Overfull hbox (about 0.4pt too wide):\\
\begin{tikzpicture}
\draw (0,0) node[inner sep=0, anchor=south west] { \myfig };
\end{tikzpicture}
Overfull hbox (about 0.2pt too wide):\\
\begin{tikzpicture}
\draw (0,0) node[inner sep=0, anchor=south west, outer xsep=0] { \myfig };
\end{tikzpicture}
Overfull hbox (about 2pt too wide):\\
\begin{tikzpicture}
\pgfsetlinewidth{10\pgflinewidth}
\draw (0,0) node[inner sep=0, anchor=south west, outer xsep=0] { \myfig };
\end{tikzpicture}
Workaround:\\
\begin{tikzpicture}
\pgfsetlinewidth{100\pgflinewidth}
\draw (0,0) node[inner sep=0, anchor=south west, outer xsep=-\pgflinewidth/2] { \myfig };
\end{tikzpicture}
\end{document}
내가 사용하는 것보다 더 나은 해결 방법이 있습니까?