GeneralImage insertion and its position

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Image insertion and its position

Post by pban92 »

I am trying to insert an image after 1st paragraph. After build and view current file, my pdf file is starting first with the image!!! And then comes the title and the rest of the report. So frustrating. Codes are shown. below. Pls help. many thanks.

Code: Select all

%\documentclass[]{elsart3p}
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\usepackage{times}
\begin{document}
\begin{center}
\section*{Literature Review}
\end{center}
My first paragraph ends here\\
\begin{figure}
\begin{center}
\includegraphics[scale=.35]{1993Roshko}
\caption{Here is my caption.}
\end{center}
\end{figure}
blah blah \\
blah blah\\
\bibliographystyle{plain}
\bibliography{mybibliography}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Image insertion and its position

Post by localghost »

You have to give some parameters to the figure environment as shown in the code below.

Code: Select all

\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[centering,includeheadfoot,margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage[center]{titlesec}
\usepackage{txfonts}
\usepackage{blindtext}

\begin{document}
  \section*{Literature Review}
    \blindtext
    \begin{figure}[!ht]
      \centering
%      \includegraphics[scale=.35]{1993Roshko}
      \rule{4cm}{3cm}
      \caption{Here is my caption.}\label{fig:1993roshko}
    \end{figure}
    \blindtext
%  \bibliographystyle{plain}
%  \bibliography{mybibliography}
\end{document}
Other modifications are only suggestions. Information about the used packages and especially their documentations can be found on CTAN.


Best regards and welcome to the board
Thorsten¹
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Re: Image insertion and its position

Post by pban92 »

Wow man! People like you are the reason why people like me join online forum like this!
Thank you so much!

:D
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Re: Image insertion and its position

Post by pban92 »

oh and I liked your other suggestion for the modifications! Thanks bro!
Post Reply