I'm getting a small difference in horizontal alignment when using the two ways of placing an image as shown in my code below. I know it doesn't look like there's much point in what I've done, but this is just a minimal example showing the problem.
Anyone know why this happens? Or how to fix it?
Thanks for any help.
\documentclass{article}
\usepackage{graphicx,caption}
\newcommand{\scalebar}[1]{\includegraphics[width=0.5\textwidth]{#1}
}
\begin{document}
\begin{figure}[!hptb]
\centering
\includegraphics[width=0.5\textwidth]{image}
\caption{}
\label{normalImage}
\end{figure}
\begin{figure}[!hptb]
\centering
\scalebar{{image}}
\caption{}
\label{imageFromCommand}
\end{figure}
\end{document}