
1과 2라는 두 개의 그림이 있습니다. 그림 1이 맨 위에 배치되어야 하므로 a가 \begin{figure}[t]
가는 방법입니다. 구문에서 그림 2는 명령을 사용하여 첫 번째 그림 바로 다음에 로드되므로 \begin{figure}[h]
두 그림이 서로 바로 아래/위에 배치됩니다. 하지만 내가 얻은 것은 이전 페이지의 텍스트 줄이 이미지 사이에 강제로 삽입된다는 것입니다. 또한 [!h]
두 번째 수치는 도움이 되지 않습니다. 이 문제는 이미 논의되고 해결되었으므로 여기에는 MWE가 없습니다. 아직 해결책을 찾지 못했습니다. 도움이 필요하세요?
답변1
다음은 다음과 같은 솔루션입니다 floatrow
.
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{caption, floatrow}
\DeclareFloatVCode{interrowsep}{\vskip 5ex}
\DeclareFloatVCode{bottomrowsep}{}
\captionsetup{labelfont = sc}
\begin{document}
\lipsum[2]
\begin{figure}[!htbp]
\floatsetup{justification =centering, postcode=interrowsep}
%
\begin{floatrow}[1]
\ffigbox[\FBwidth]
{\includegraphics[scale = 0.8]{sendak}}
{\caption{Where Wild Things are}
\label{fig:Maurice}}
\end{floatrow}
%
\begin{floatrow}[1]
\ffigbox[\FBwidth]
{\includegraphics[scale = 0.5]{AliceSteadman}}
{\caption{Ralph}
\label{fig:Wabbit}}
\end{floatrow}\vskip -6ex
\end{figure}%
\lipsum[4]
\end{document}