\minipage
我有数百个图形,使用如下环境将它们排列成 2x2 矩阵:
\begin{figure}[ht] \label{ fig7}
\begin{minipage}[b]{0.5\linewidth}
\includegraphics[width=.5\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_profile_0}
\caption{Initial condition}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\includegraphics[width=.5\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_profile_Rup}
\caption{Rupture}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\includegraphics[width=.5\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_dft_0_corner}
\caption{DFT, Initial condition}
\end{minipage}
\hfill
\begin{minipage}[b]{0.5\linewidth}
\includegraphics[width=.5\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_dft_corner_Rup}
\caption{DFT, rupture}
\end{minipage}
\end{figure}
我发现,这种排列方式会导致图表后面出现大量空白。我该如何确保充分利用所有“页面空间”来放置图表,而不会出现过多空白?
我真的很抱歉,我似乎无法更好地解释我的问题。
如何避免图像溢出到下一页?
根据评论,当我使用\includegraphics[width=x\linewidth]
withx>0.5
时,我的图像会溢出到下一页。我希望我的表格和图像位于同一页中,并且图像留下很少的空白:
图片移至以下页面:
我希望这个有较少的空白:
最小工作示例:
\documentclass[draft,10pt]{article}
% \usepackage[ascii]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{caption}
% \usepackage{babel}
\usepackage{fontenc}
\usepackage{graphicx}
% \usepackage{tabular}
\begin{document}
MWE:
\centering
\scriptsize
\begin{table}[h]
\begin{tabular}{|p{5cm}|p{5cm}|}
\hline
a & 1 \\
a & 1 \\
b & 1 \\
c & 1 \\
d & 1 \\
e & 1 \\
f & 1 \\
g & 1 \\
h & 1 \\
i & 1 \\
\hline
\end{tabular}
\end{table}
\begin{figure}[h] \label{ fig7} \begin{minipage}[b]{0.50\linewidth}\centering\includegraphics[width=0.70\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_profile_0} \caption{Initial condition} \end{minipage} \begin{minipage}[b]{0.50\linewidth}\centering\includegraphics[width=0.70\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_profile_Rup} \caption{Rupture} \end{minipage} \begin{minipage}[b]{0.50\linewidth}\centering\includegraphics[width=0.70\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_dft_0_corner} \caption{DFT, Initial condition} \end{minipage}\hfill \begin{minipage}[b]{0.50\linewidth}\centering\includegraphics[width=0.70\linewidth]{/home/dnaneet/Research/Dissertation/wigner/Effect_of_domainSize_wavelength/G=0.333/dftdata/L_lambda_max_1wl_dft_corner_Rup} \caption{DFT, rupture} \end{minipage} \end{figure}
\end{document}
答案1
您可以尝试输入\centering
。在标题后minipage
添加一些可能也会有帮助。\vspace
\documentclass{article}
\usepackage{graphicx}
\pagestyle{empty}
\begin{document}
\begin{figure}[ht]
\label{ fig7}
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=.5\linewidth]{example-image-a}
\caption{Initial condition}
\vspace{4ex}
\end{minipage}%%
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=.5\linewidth]{example-image-b}
\caption{Rupture}
\vspace{4ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=.5\linewidth]{example-image-c}
\caption{DFT, Initial condition}
\vspace{4ex}
\end{minipage}%%
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=.5\linewidth]{example-image}
\caption{DFT, rupture}
\vspace{4ex}
\end{minipage}
\end{figure}
\end{document}
subcaptions
下面是使用包在更大的图形环境中获取子图形的示例:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\pagestyle{empty}
\begin{document}
\begin{figure}[ht]
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{example-image-a}
\caption{Initial condition}
\label{fig7:a}
\vspace{4ex}
\end{subfigure}%%
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{example-image-b}
\caption{Rupture}
\label{fig7:b}
\vspace{4ex}
\end{subfigure}
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{example-image-c}
\caption{DFT, Initial condition}
\label{fig7:c}
\end{subfigure}%%
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{example-image}
\caption{DFT, rupture}
\label{fig7:d}
\end{subfigure}
\caption{Illustration of various images}
\label{fig7}
\end{figure}
The illustrations in figure~\ref{fig7}\ldots but in figure~\ref{fig7:d} you see\ldots
\end{document}
答案2
\frame{\frametitle{Methodology [Contd.]}
\begin{figure}[ht!]
\begin{center}
%
\subfigure{%
\label{fig:first}
\includegraphics[width=0.4\textwidth]{img3-fig1.png}
}%
\subfigure{%
\label{fig:second}
\includegraphics[width=0.4\textwidth]{img3-fig2.png}
}\\ % ------- End of the first row ----------------------%
\subfigure{%
\label{fig:third}
\includegraphics[width=0.4\textwidth]{img3-fig3.png}
}%
\subfigure{%
\label{fig:fourth}
\includegraphics[width=0.4\textwidth]{img3-fig4.png}
}%
%
\end{center}
\caption{%
The distribution of IQ Score obtained for various students in context of different test given by an individual student.
}%
\label{fig:subfigures}
\end{figure}
}