2

While writing a paper I tried to include relatively large figures into my document. Since they are so big I don't want them to be placed inside sentences.

The first part of the Text.
\begin{figure}[ht]
    \includegraphics[width=\textwidth]{graphics/pipeline}
    \caption{Jenkins Build-Pipeline}
    \label{fig:pipeline}
\end{figure}
The rest of the text.

Is there another way to achieve this than using \begin{figure}[H]?

Bernard
  • 271,350
  • 2
    Hi, welcome! This is not clear to me. Why don't you just put figure between paragraphs and let them float? See also https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Rmano Apr 20 '21 at 08:13
  • Maybe it's just this answer what you are looking for? https://tex.stackexchange.com/a/415683/38080 – Rmano Apr 20 '21 at 08:16
  • 4
    In general you should never use the [H] specifier instead always place the figures between paragraphs, use [htp] or [htbp] as the specifier, always add a caption and always refer to the figure by reference to a label. Then the figures are better placed near by and you don't waste space by the big holes that [H] can leave behind. – daleif Apr 20 '21 at 08:24
  • @Rmano This is what I am using at the moment, but as you can see in the screenshot the formatting results in "Lorem impsum dolor [her comes the figure] sit amet, consecetuer adipiscing elit. [...]", but what i want is "Lorem impsum dolor sit amet, consecetuer adipiscing elit. [her comes the figure] [...]". – Marco Wagner Apr 20 '21 at 08:29
  • @Manox if the figure appears in the mid of the line, there is no way to put that exactly there without a) breaking the line or b) stretch the lines before so much that the paragraph will get awful... (but still I am not sure to have understood correctly, cn you post a minimal working example (MWE) ? – Rmano Apr 20 '21 at 08:36
  • Looking at your example, just add a blank line before and after your figure environment, forcing a paragraph there. – Rmano Apr 20 '21 at 08:37
  • 1
    @Rmano Thank you! That's the solution. – Marco Wagner Apr 20 '21 at 08:40

1 Answers1

1

If you want to end your paragraph before the figure and continue after, just surround your figure with white lines: that will end the paragraph and start a new one after the figure. (Really you need just one, but well, that way it's nicer).

\documentclass{article}
\usepackage{graphicx}
\begin{document}
The first part of the Text.

\begin{figure}[ht] \includegraphics[width=\textwidth, height=1cm]{example-image-a} \caption{Jenkins Build-Pipeline} \label{fig:pipeline} \end{figure}

The rest of the text. \end{document}

enter image description here

BTW please notice that this is a correct MWE --- compilable without any external asset.

Rmano
  • 40,848
  • 3
  • 64
  • 125