
답변1
subcaption
패키지와 해당 환경을 사용하는 솔루션은 다음과 같습니다 subfigure
.
환경 내부에는 figure
두 개의 나란히 있는 minipage
환경이 있으며 각각은 width 0.45\textwidth
이고 가로로 로 구분됩니다 \hfill
. 왼쪽 환경 에는 "(a)"와 "(c)"로 번호가 매겨진 minipage
2개의 환경이 포함되어 있습니다 . subfigure
오른쪽 환경에는 "(b)"라는 번호가 붙은 minipage
1개의 환경만 포함됩니다 . subfigure
3개 환경의 너비는 subfigure
로 설정됩니다 \linewidth
.
이 설정을 사용하면 일반적인 \label
- \ref
메커니즘을 통해 전체 그림과 하위 그림 모두에 대한 상호 참조를 생성할 수 있습니다.
\documentclass[demo]{article} % remove `demo' option in real document
\usepackage{subcaption,graphicx}
\begin{document}
\begin{figure}[ht]
\begin{minipage}{0.45\textwidth} % start of first minipage
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth]{picA}
\caption{\dots}
\end{subfigure}
\bigskip % leave empty line before '\bigskip'
\addtocounter{subfigure}{1} % increment 'subfigure' counter by 1
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth]{picC}
\caption{\dots}
\end{subfigure}
\end{minipage} % end of first minipage
\hfill
\begin{minipage}{0.45\textwidth} % start of second minipage
\addtocounter{subfigure}{-2} % decrement 'subfigure' counter by 2
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth, height=\linewidth]{picB}
\caption{\dots}
\end{subfigure}
\end{minipage} % end of second minipage
\caption{Overall figure caption}
\end{figure}
\end{document}
답변2
가장 간단한 접근 방식은 하위 플로트를 먼저 조판하고 나중에 원하는 대로 이동할 수 있는 상자에 저장하는 것입니다.
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\newsavebox{\subcapboxA}
\newsavebox{\subcapboxB}
\newsavebox{\subcapboxC}
\begin{document}
\begin{figure}[htp]
\sbox{\subcapboxA}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{}
\end{subfigure}%
}
\sbox{\subcapboxB}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth,height=1.3\textwidth]{example-image-b}
\caption{}
\end{subfigure}%
}
\sbox{\subcapboxC}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-c}
\caption{}
\end{subfigure}%
}
% Now we stack the boxes in the desired way
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxA} \\[2ex]
\usebox{\subcapboxC}
\end{tabular}\hfill
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxB}
\end{tabular}
\caption{The global caption text}
\end{figure}
\end{document}
일부 문서 클래스는 caption
패키지 사용을 지원하지 revtex4-2
않으므로 subfig
. 해당 코드는 다음과 같습니다.
\documentclass{article}
\usepackage[caption=false]{subfig}
\usepackage{graphicx}
\newsavebox{\subcapboxA}
\newsavebox{\subcapboxB}
\newsavebox{\subcapboxC}
\begin{document}
\begin{figure}[htp]
\sbox{\subcapboxA}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth]{example-image-a}%
}%
}
\sbox{\subcapboxB}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth,height=0.6\textwidth]{example-image-b}%
}%
}
\sbox{\subcapboxC}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth]{example-image-c}%
}%
}
% Now we stack the boxes in the desired way
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxA} \\[2ex]
\usebox{\subcapboxC}
\end{tabular}\hfill
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxB}
\end{tabular}
\caption{The global caption text}
\end{figure}
\end{document}
답변3
이 같은:
\documentclass{book}
\usepackage{graphicx}
\usepackage{lipsum,mwe}
\begin{document}
\lipsum[1]\\
\begin{table}[h!]
\begin{center}
\caption{Table with 3 graphs}
\begin{tabular}{l l}
\parbox{2in}{\includegraphics[width=2in,height=1in]{seno.pdf}\\ (a) sinus graph\\ \includegraphics[width=2in,height=1in]{coseno.pdf}\\(b) cosinus graph} &\parbox{2in}{\includegraphics[width=2in,height=2.2in]{tangente.pdf}\\ (c) tangent graph}\\
\end{tabular}
\end{center}
\end{table}
\end{document}
산출: