
하위 사진 5개를 첫 번째 행에 3개, 두 번째 행에 2개 배치하고 싶습니다. 마지막 두 개는 처음 세 개와 크기가 동일해야 하지만 중앙에 위치해야 합니다(둘 다 페이지 중앙 근처에 있어야 하며 끝 부분이 아님).
\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
사용되는 것 같습니다 . 여기서는 로컬로 로 \hfill
변경하므로 하위 그림 사이에는 항상 0.1cm의 공간이 있습니다.\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
약 20년 동안 사용되지 않은 패키지 subfigmat
를 사용합니다 .subfigure
다음은 비슷한 접근 방식입니다 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}