TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
5  
\usepackage{...} has to go before \begin{document} (the part which is known as the preamble). – hooy Feb 22 at 22:11
    
It worked! thanks again – Ktp Feb 22 at 22:16
2  
@hooy seems like an answer:-) – David Carlisle Feb 22 at 22:17
    
@Sel Did my answer solve your problem? If so, would you mind accepting it? – hooy Feb 24 at 20:54

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}  
\usepackage{graphics}

\begin{document}    
\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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.