# How do I correctly insert images in LaTeX files?

My relevant lines of code are:

\documentclass[draft]{article}
\usepackage{amsmath,amsfonts,amssymb,graphicx,epstopdf}
...
\begin{document}
\DeclareGraphicsExtensions{.pdf,.png,.gif,.jpg}
...
\begin{figure}[h!]
\centering
\includegraphics[width=0.75\textwidth]{EncodingMethod}
\caption{Encoding Method}
\end{figure}


and all I get out of this block of code is:

-

## migrated from stackoverflow.comJun 4 '13 at 21:47

This question came from our site for professional and enthusiast programmers.

Show the options you give to \documentclass. Having draft in there will do this. – Benjamin Bannier Jun 4 '13 at 20:28
ah, I do have draft in my options for \documentclass, I will try removing this. (edit) Thank you, This fixed my problem. – Curtis Eugene Maddex Jun 4 '13 at 20:30

This is the expected behavior if you pass the draft option to \documentclass. Simply removing it should fix it.
Note that draft not only displays boxes for pictures (so the document compiles faster), but it also adds little black boxes on the margin to indicate overfullness. This can be useful information when improving hyphenation with extra hints or to tweak picture sizes.
oh, I was wondering about those black boxes at the end of some lines to. I always got around it by adding \newline before the word that caused it. – Curtis Eugene Maddex Jun 4 '13 at 20:58
You shouldn't mess with the line breaking just to get overfull boxes to disappear! This will mess up automatic reflowing. Instead give LaTeX hyphenation hints on where words can be broken, e.g. Donau\-schiff\-fahrts\-ge\-sell\-schaft. Also make sure you set the correct language for your document so the correct hyphenation rules are picked (the default is some English). – Benjamin Bannier Jun 4 '13 at 21:04
If you wish to have draft on the documentclass, then you can override this option for graphicx, and so include the images, either by \usepackage[final]{graphicx} or by \setkeys{Gin}{draft=false} after the \usepackage{graphicx}. – Andrew Swann Jun 5 '13 at 7:53