[Tex/LaTex] Two pictures and text on one page

floatspositioning

I got the following problem:
I want to have two pictures at the end of a subsection just before the next subsections starts. I tried it with:

    \begin{figure}[ht]
    \centering
    \includegraphics[width=\linewidth]{geschw.png}
    \caption{Geschwindigkeitsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
    \includegraphics[width=\linewidth]{beschl.png}
    \caption{Beschläunigungsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
    \label{fig:geschw}
    \end{figure}

But then the pictues are at the end of the whole text.

The first subsection ends at the end of a page so i tried to use

    \begin{figure}[p]

which placed them on the next page between the end of the first and the beginning of the second subsection, but in the middle of the page with white space above and below. The next subsection then starts at the next page.

Is it somehow possible to move the pictures to the top of the page and let the next subsection start right below.

Best Answer

Try it as:

{
\centering
\includegraphics[width=\linewidth]{geschw.png}
\captionof{figure}{Geschwindigkeitsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\includegraphics[width=\linewidth]{beschl.png}
\captionof{figure}{Beschläunigungsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\label{fig:geschw}
}

The first thing you need to ask yourself when dealing with pictures is, if you want them to float or not. In your case you do not. This will give you more control but requires a greater amount of intervention in your part to set the correct spacing around them. Overflowing into the bottom margins might also force you to include manual page breaks.

Please also note the use of \captionof from the caption package to include a caption, textdoc caption for more details and a plethora of useful settings. Also note that the images might look better with a combined caption rather than two, please experiment to see what works best in your case.

enter image description here

Best to always include a full MWE with a question as shown below for the solution:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,lipsum}
\begin{document}
\section{First}
\lipsum[1-2]
{
\centering
\includegraphics[width=\linewidth]{geschw.png}
\captionof{figure}{Geschwindigkeitsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\includegraphics[width=\linewidth]{beschl.png}
\captionof{figure}{Beschläunigungsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\label{fig:geschw}
}
\end{document}
Related Question