我正在尝试并排显示一组图像。最初我想将它们放在同一行,但我将 2 张图像放在下一行,这样它们就适合了。我想让图片更大,但图像旁边的空白似乎会按比例增大,并将第二张图片推离页面。
\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}
答案1
目前还不清楚你想要什么,但也许:
\documentclass[]{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[htp]% never use h on its own
\centering
\includegraphics[width=0.2\linewidth]{p1}
\includegraphics[width=0.2\linewidth]{p2}
\includegraphics[width=0.2\linewidth]{p3}
\includegraphics[width=0.2\linewidth]{p4}
\end{figure}
\end{document}