I'm trying to display a bunch of images side by side. Originally I wanted them on the same line, but I got them to fit by putting 2 on the next line. I'd like to make the pictures bigger but the white space beside the images seems to grow proportionally and push the second image off the page.
\documentclass[]{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{p1}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{p2}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{p3}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{p4}
\end{minipage}
\end{figure}
\end{document}
X
\includegraphics
itself adds no space, you just get whatever white space you have added in the source file. Ends of lines introduce word spaces and blank lines introduce vertical paragraph skips.\usepackage[demo]{graphics}
then the example will be more useful and you can check that it shows the problem. You have 4 images stacked vertically so they will run off the page if they are too large, but we have no indication of their size.