2

I am trying to make the paragraph to be above the figure yet it is put below. Why ? I have tried different figure options with no success.

\paragraph{Poniżej jest porównanie obrazów przed i po próbkowaniu}

\begin{figure}[h]
    \centering
    \includegraphics[]{obrazki próbkowanie.png}
    \caption{Przykład strat jakości w próbkowaniu}
    \label{fig:obrazek}
\end{figure}
4
  • h usually generates a warning that it is changed to ht, the only reason to use figure is to allow it to be moved, so what you describe is the expected behaviour Apr 13 at 19:12
  • note \paragraph is a section heading, but you appear to only have a heading and no text. Apr 13 at 19:13
  • Welcome to TeX.SE!
    – Mensch
    Apr 13 at 19:18
  • In addition to the \paragraph comment, see also tex.stackexchange.com/a/8631/107497: "do not use a floating environment if you do not want it float".
    – Teepeemm
    Apr 13 at 22:38

1 Answer 1

4

As @DavidCarlisle has already observed in a comment, you should be providing some text to go along with the \paragraph-level header. As soon as you do so, LaTeX will place the contents of the figure environment where you expect it should go.

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage[demo]{graphicx} % omit 'demo' option in real document

\begin{document}

\paragraph{Poniżej jest porównanie obrazów przed i po próbkowaniu} 
bla bla bla ble ble ble bli bli bli

\begin{figure}[h]
    \centering
    \includegraphics{obrazki próbkowanie}
    \caption{Przykład strat jakości w próbkowaniu}
    \label{fig:obrazek}
\end{figure}
\end{document} 
2
  • As a minimum, one can use \hfill. Apr 14 at 3:10
  • @JohnKormylo -- I have a hunch that the OP doesn't really want \paragraph{...} but, rather, \subsubsection*{...}. Let's see if the OP weighs in and provides some welcome information.
    – Mico
    Apr 14 at 3:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .