2

I have wrote this piece of LaTeX code

\chapter{Datenmodellierung}
\paragraph{Fremdschlüssel}
\includegraphics[width=0.4\textwidth]{Resources/Included Graphics/foreign_keys_example.png}

\paragraph{Integritätsprüfung via Checks}
\includegraphics[width=0.4\textwidth]{Resources/Included Graphics/integrity_checking.png}

and expected it to look be a heading, then a picture in the next line, then a heading again (in a new line), and finally the second graphic in yet another line.

Unfortunately, it looks like this:

So maybe using figures hel ... no, it doesn't:

\chapter{Datenmodellierung}
\paragraph{Fremdschlüssel}
\begin{figure}
    \includegraphics[width=0.4\textwidth]{Resources/Included Graphics/foreign_keys_example.png}
\end{figure}

\paragraph{Integritätsprüfung via Checks}
\begin{figure}
    \includegraphics[width=0.4\textwidth]{Resources/Included Graphics/integrity_checking.png}
\end{figure}

I of course googled the problem and found a solution: Inserting float barriers and using the package placeins.

I inserted them like this

\chapter{Datenmodellierung}
\paragraph{Fremdschlüssel}
\FloatBarrier
\begin{figure}
    \includegraphics[width=0.4\textwidth]{Resources/Included Graphics/foreign_keys_example.png}
\end{figure}

\FloatBarrier
\paragraph{Integritätsprüfung via Checks}
\FloatBarrier
\begin{figure}
    \includegraphics[width=0.4\textwidth]{Resources/Included Graphics/integrity_checking.png}
\end{figure}

and somehow it got even worse:

I'd like to stop stuff from floating around altogether. Is this possible?

I already use the package float and Hs behind table declarations (\begin{table}[H]) to stop them from floating all over the place. However, that doesn't help with the graphics floating around.

The article type is report.

  • 2
    Don't use the figure environment, if you want to place a graphic object just there with no caption. There's no rule that mandates \includegraphics to be in a figure environment. – egreg Jun 18 '16 at 22:36
  • If I don't use figures, the float barriers don't have any effect at all. – UTF-8 Jun 18 '16 at 22:50
  • And what would be the purpose of \FloatBarrier if there's nothing to float around? – egreg Jun 18 '16 at 23:00
1

The standard behavior of \paragraph is to print the heading in-line.

If you want a line break after the heading, type

\paragraph{Fremdschlüssel}\mbox{}\\*
\includegraphics[width=0.4\textwidth]{Resources/Included Graphics/foreign_keys_example.png}
  • Thank you very much! But do you know how to stop figures from floating before and after lines generally? – UTF-8 Jun 19 '16 at 0:48
  • @UTF-8 If you don't want them to float, just don't use the figure environment (and don't give them captions). – egreg Jun 19 '16 at 9:11
  • Ah, when writing a report, I can center graphics without putting them into figures. I didn't know this is possible. It doesn't seem to be possible when using document type beamer, though. – UTF-8 Jun 19 '16 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.