LaTeX forum ⇒ Graphics, Figures & TablesFigure between 2 paragraphs

Information and discussion about graphics, figures & tables in LaTeX documents.
maxime54
Posts: 3
Joined: Sat Jun 07, 2014 5:34 pm

Figure between 2 paragraphs

Postby maxime54 » Sat Jun 07, 2014 5:46 pm

Hi everyone,

I have just started to use LaTeX and I do not manage to do one thing : I would like to add a diagram (.png)between 2 paragraphs. However, when I try to do so, the diagram and the text place on top each other (superposition).
I looked for the solution on the Internet but no one works.
I hope you can help me.


(I apologize for my English mistakes, I'm not a native)

By the way, here is what I did :
  1. \documentclass[10pt]{report}
  2. \usepackage[francais]{babel}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
  5. \usepackage{soul}
  6. \usepackage{color}
  7. \usepackage{graphicx}
  8. \usepackage{wrapfig}
  9. \usepackage{float}
  10. \usepackage{here}
  11. \usepackage{picins}
  12. \usepackage[section]{placeins}
  13. \makeatletter
  14. \renewcommand{\thesection}{\@arabic\c@section}
  15. \makeatother
  16. \begin{document}
  17.  
  18. Condition de réplication.
  19.  
  20. \begin{figure}[!h]
  21. \begin{center}
  22. \includegraphics[scale=0.25]{replication.png}
  23. \caption{Schéma de la réplication chez les Procaryotes}
  24. \end{center}
  25. \end{figure}
  26.  
  27. Avant Meselson et Stahl


Thanks in advance
Last edited by Stefan Kottwitz on Sat Jun 07, 2014 10:06 pm, edited 1 time in total.
Reason: inline code changed to code block

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jun 07, 2014 7:56 pm

Please read some introductory material. Using the floating environment figure means, latex can put it where it fits best. This can be on top of a page, at the bottom, or sometomes on it's own page.

If you really don't want the pic to float, use \captionof{figure}{<your caption>} provided by package caption.

BTW: Environment center adds some extra vertical space, unnecessary using a floating environment.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

maxime54
Posts: 3
Joined: Sat Jun 07, 2014 5:34 pm

Postby maxime54 » Sat Jun 07, 2014 8:26 pm

Thanks for your answer but whatever i do, i obtain the text and the diagram superposed
and there is an error I do not understand : "Cannot determine the size of graphique in danreplicationfork.bmp" How can i do to let Latex determine the size ?

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jun 07, 2014 8:54 pm

Oh, the pic is on the text, not above it on the paper?

LaTeX doesn't support bmp-graphics. Please convert it to a jpg-file (png would be possible as well) and try again.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

maxime54
Posts: 3
Joined: Sat Jun 07, 2014 5:34 pm

Postby maxime54 » Sun Jun 08, 2014 9:52 am

yes, pic is on the text. Even with a png pic it does not work. I do not understand at all why Latex does not want to have " text then pic then text"

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jun 08, 2014 3:41 pm

You should try to prepare a minimal working example. This is the best and safest way to find the cause of errors.
All i can do now is guess, and there is nothing coming to mind right now.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests