
5 つのサブピクチャを配置します。最初の行に 3 つ、2 番目の行に 2 つです。最後の 2 つは、最初の 3 つと同じ寸法で、中央に配置する必要があります (両方ともページの端ではなく、中央付近に配置することを意味します)。
\begin{figure}[H]
\begin{subfigmatrix}{3}
\subfigure[$\mathbb{P}^2$]{\includegraphics{Chapter3/Immagini/RSB/p2.png}}
\subfigure[$\mathbb{P}^4$]{\includegraphics{Chapter3/Immagini/RSB/p4.png}}
\subfigure[$\mathbb{P}^6$]{\includegraphics{Chapter3/Immagini/RSB/p6.png}}
\subfigure[$\mathbb{P}^8$]{\includegraphics{Chapter3/Immagini/RSB/p8.png}}
\subfigure[$\mathbb{P}^{10}$]{\includegraphics{Chapter3/Immagini/RSB/p10.png}}
\end{subfigmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
答え1
私のアイデアは盗まれたここは、サブ図間の間隔を設定するためにsubfigmatrix
使用されているようです。ここでは、ローカルに に変更し、サブ図間に常に 0.1cm のスペースを確保します。\hfill
\hfill
\hspace{0.1cm}
\documentclass{article}
\usepackage{graphicx,subfigmat,etoolbox,amssymb,float}
\begin{document}
\begin{figure}[H]
\patchcmd{\subfigmatrix}{\hfill}{\hspace{0.2cm}}{}{}
\begin{subfigmatrix}{3}
\subfigure[$\mathbb{P}^2$]{\includegraphics{example-image}}
\subfigure[$\mathbb{P}^4$]{\includegraphics{example-image}}
\subfigure[$\mathbb{P}^6$]{\includegraphics{example-image}}
\subfigure[$\mathbb{P}^8$]{\includegraphics{example-image}}
\subfigure[$\mathbb{P}^{10}$]{\includegraphics{example-image}}
\end{subfigmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
\end{document}
別のアイデア
もう一つのアイデアをご紹介します。subcaption
次のことを試してみてください\subcaptionbox
:
\documentclass{article}
\usepackage{graphicx,subcaption,amssymb}
\begin{document}
\begin{figure}
\centering
\subcaptionbox{$\mathbb{P}^2$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\subcaptionbox{$\mathbb{P}^4$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\subcaptionbox{$\mathbb{P}^6$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\subcaptionbox{$\mathbb{P}^8$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\subcaptionbox{$\mathbb{P}^{10}$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
\end{document}
答え2
このsubfigmat
パッケージはsubfigure
約20年前に廃止されたものを使用しています。
以下は、 を使用した同様のアプローチです。はその後のスペースを無視するsubfig
ため、何らかのトリックが必要になります。\subfloat
\documentclass{article}
\usepackage{graphicx,amssymb,subfig}
\usepackage{showframe}
\NewCommandCopy\ORIsubfloat\subfloat
\NewDocumentCommand{\NEWsubfloat}{om}{%
\begingroup\setlength{\spaceskip}{0pt}%
\IfValueTF{#1}{\ORIsubfloat[#1]{#2}}{\ORIsubfloat{#2}}%
\endgroup\space\ignorespaces
}
\newlength{\subfloatmatrixwidth}
\newenvironment{subfloatmatrix}[2][0.2cm]{%
\centering
\setlength{\subfloatmatrixwidth}{%
\dimexpr(\columnwidth-(#1)*\numexpr(#2-1)\relax)/(#2)\relax
}%
\setlength{\spaceskip}{#1 minus 1pt}%
\setkeys{Gin}{width=\subfloatmatrixwidth}%
\setlength{\lineskip}{\medskipamount}%
\RenewCommandCopy\subfloat\NEWsubfloat
}{\par}
\begin{document}
\begin{figure}[htp]
\begin{subfloatmatrix}{3}
\subfloat[$\mathbb{P}^2$]{\includegraphics{example-image}}
\subfloat[$\mathbb{P}^4$]{\includegraphics{example-image}}
\subfloat[$\mathbb{P}^6$]{\includegraphics{example-image}}
\subfloat[$\mathbb{P}^8$]{\includegraphics{example-image}}
\subfloat[$\mathbb{P}^{10}$]{\includegraphics{example-image}}
\end{subfloatmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on
a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
\end{document}
この環境には、サブフロート間の間隔を指定するためのオプションの引数もあり、デフォルトは 0.2cm です。
同じですが、
\begin{subfloatmatrix}[0.5cm]{3}