I have two figures, 1 and 2. Figure 1 should be placed on top, so a \begin{figure}[t] is the way to go. In the syntax, figure 2 is loaded just after the first one with a \begin{figure}[h] command, so that both figures are placed just below/above each other. But what I get is that a text line from the previous page is forced in between the images. Also [!h] for the second figure does not help. I am sure this problem was already discussed and solved, thus no MWE here. I could not find the solution yet. Any help?
Asked
Active
Viewed 132 times
1
1 Answers
1
Here is a solution with 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}
Bernard
- 271,350

figureenvironment for both figures. – Gonzalo Medina Jul 29 '15 at 15:58\begin{figure}[ht]for the second figure. – touhami Jul 29 '15 at 16:07