0

I am trying to insert images but they appear in unexpected places. They keep appearing at the bottom of the paragraph while I need them to appear where I inserted them.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{etoc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[document]{ragged2e}
\usepackage[export]{adjustbox}
\begin{document}

\section{standing wave}

\subsection{Standing Wave Concept} \textbf{What is exactly a Standing Wave?}\

lets say we initiated a pulse through a fixed end rope . (\textbf{Figure 1})\

\begin{figure}[h] \centering \includegraphics[scale=.25]{Screenshot (199).png} \caption{Wave in a fixed end rope}

\end{figure} \end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • 3
    The main point of a float environment like figure is to let them float away. And the main point of a \label is to allow to reference them, even if they are on the next page. So remove the [h], let them float and use As seen in figure~\ref{fig:my_label} .... And don't end paragraphs with \\, this will only give warnings. If you absolutly don't want them to float you can use the float package and [H], but see here first https://tex.stackexchange.com/a/370654/2388 – Ulrike Fischer Feb 10 '21 at 07:41
  • I have updated my code but it gives me a number( number 1) in the correct place it doesn't display the picture, so how to display it.@UlrikeFischer – Charbel Eid Feb 10 '21 at 07:53
  • 2
    Don't use spaces in images file names. – Zarko Feb 10 '21 at 08:01
  • will rename it but the main problem now is that I am getting a number not the picture so how to get to display the picture.@Zarko – Charbel Eid Feb 10 '21 at 08:08
  • We haven9t any information about document, so we can only guessing what you doing wrong. You my have draft option at \documentclass, who knows. Please provide complete small document beginning with \documentclas[...]{...} and ending by \end{document}, which reproduce your problem. – Zarko Feb 10 '21 at 08:47
  • done! please review the code@Zarko – Charbel Eid Feb 10 '21 at 08:55
  • I re-edited the code, I want the picture in place not a reference to this picture so I used [h] and removed the \label but still, it doesn't appear in place @Zarko – Charbel Eid Feb 10 '21 at 08:58
  • 1
    "h" doesn't mean "here", it only means "here if possible". If you want "really here", then you need to use "H" (with \usepackage{float}). – Ulrike Fischer Feb 10 '21 at 09:01
  • With given document example, I cant reproduce your problem. Do you receive any errors or warning at compilation of your document? Show us result of your compilation of shoved document example, please. – Zarko Feb 10 '21 at 09:03
  • 3
    Instead of H, you can forget the figure environment and use something like {\par\centering\includegraphics{...}\captionof{figure}{.....}\par} (you have to load package caption). – Ignasi Feb 10 '21 at 09:04
  • 3
    I suggest to read an introduction to LaTeX. – Johannes_B Feb 10 '21 at 09:11

0 Answers0