2

It is my very very first time using LaTeX and I only need this program for preparing a homework which must include some graphics. For that I've been reading what to do for inserting an image but still not being able to add one, I seek for any kind of help. Would be very nice if you can explain this problem below and give me an advice.

! LaTeX Error: Can be used only in preamble.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \usepackage

What I typed is this:

\documentclass[10pt]{article}
\begin{document}

\usepackage{graphics}

\includegraphics[scale=1]{ad.png} 
\end{document} 

Thank you in advance.

Arash Esbati
  • 7,416
Ktp
  • 37

1 Answers1

9

Loading packages with \usepackage{...} has to be done in the preamble, in other words before issuing \begin{document}.

So your code should be

\documentclass[10pt]{article}
% Load packages here  
\usepackage{graphics}

\begin{document} % Document content begins here

\includegraphics[scale=1]{ad.png}

\end{document} 

Also, see Packages: graphics vs graphicx as to why you should use the graphicx (x for extended) package rather than the graphics package.

sodd
  • 5,771