当图形有子浮点数时,我怎样才能将图形放在彼此之下,并且我不希望我想要放在彼此之下的图形是同一个图形?所以我有两个图形,每个图形都由两个相邻的图片组成,我希望第二个图形位于第一个图形下方,并且我不希望文本位于图片之间或上方。
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[pic 1 a]{\includegraphics[width=0.6\textwidth]{pic1a.png}}
\hfill
\subfloat[pic 1 b]{\includegraphics[width=0.4\textwidth]{pic1b.png}}
\caption{figure 1}
\end{figure}
\begin{figure}
\centering
\subfloat[pic 2 a]{\includegraphics[width=0.6\textwidth]{pic2a.png}}
\hfill
\subfloat[pic 2 b]{\includegraphics[width=0.4\textwidth]{pic2b.png}}
\caption{figure 2}
\end{figure}
text text text which should all be below the pictures and not above nor beetwenn text text text text text text
\end{document}
答案1
将两个结构放在同一个figure
环境中。这样它们就会保持在一起,中间没有任何隔阂。
\documentclass{article}
\usepackage{graphicx,subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[pic 1 a]{\includegraphics[width=0.6\textwidth]{example-image-a}}
\hfill
\subfloat[pic 1 b]{\includegraphics[width=0.4\textwidth]{example-image-a}}
\caption{figure 1}
\vspace{\intextsep}
\subfloat[pic 2 a]{\includegraphics[width=0.6\textwidth]{example-image-b}}
\hfill
\subfloat[pic 2 b]{\includegraphics[width=0.4\textwidth]{example-image-b}}
\caption{figure 2}
\end{figure}
text text text which should all be below the pictures and not above nor beetwenn text text text text text text
\end{document}