LaTex using TexnicCenter

1. Jan 29, 2006

NEWO

hi there, I am writing a report on texnicCenter that uses Latex.

I have a picture drawn on the computer and i need to be able to insert the picture into my document using latex as a figure. If anyone knows the commands for such a thing i would be gratefull if you coul tell me thank you very much

newo

2. Jan 29, 2006

ComputerGeek

google for "put figure in latex document"

3. Jan 29, 2006

NEWO

ive done so and tried the following commands however it doesn't seem to work

\begin{figure}
\includegraphics[height=60mm]{C:\Documents and Settings\Owen Booler\My Documents\My Pictures\potstep.jpg}
\caption{Diagram showing the tunneling in the step potential problem}
\end{figure}

My file that i want to insert is located in C:\Documents and Settings\Owen Booler\My Documents\My Pictures\potstep.jpg

Whats going wrong?

Thanks for any help

4. Jan 30, 2006

ComputerGeek

Did you remember to use the graphix package in your preamble before you begin the document?

5. Jan 30, 2006

Triss

1. you did not type the filelocation correctly.
2. LaTeX does not (i belive) like spaces in the path. atleast i cannot include a pictures located in 'E:/Documents/My Pictures/' but i can include one that is placed in 'E:/Documents/'

The following works fine with MikTeX and pdflatex

Code (Text):

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{E:/Documents/stone} % stone.jpg <--!!
\end{document}
If you have all your pictures located in the same folder the following could perhaps come in handy:
Code (Text):

\documentclass{article}
\usepackage{graphicx}
\graphicspath{{E:/Documents/}}
\begin{document}
\includegraphics{stone} % stone.jpg <--!!
\end{document}

Last edited: Jan 30, 2006
6. Jan 30, 2006

franznietzsche

Its best to keep all files related to a given document in the same folder, this prevents problems with a given LaTeX distribution. You might try using "My Pictures" (include the double quotes in the path name).

7. Jan 30, 2006

NEWO

thanks for you help so far, however I have tried to do what you said and it still won't work. What is the graphicx is it a programme that I should have?

this is what I have done;

\begin{figure}[h]
\usepackage{graphicx}
\includegraphics{C:/potstep.jpg}
\caption{Diagram showing the wavefunction $\psi\left(x\right)_{1}$ in the left region and $\psi\left(x\right)_{2}$ in the right}
\end{figure}

thanks for any help

newo

8. Jan 30, 2006

Triss

I do not know how you do it in TexnicCenter (why not use emacs/aucTeX? :D) somewhere you should be able to tell TexnicCenter what packages you wish to use. graphicx is one such package and is nessesary for includeing graphics. I am sure you have that package installed but you need to add it to your document. The way I showeded it \usepackage{graphicx} was called *before* the actually document started. You need to do something similar in TexnicCenter, it does *not* work to include it inside a figure enviroment.

9. Jan 30, 2006

imabug

that would work fine as long as potstep.jpg is at the root folder of your C: drive. The easiest and probably best thing is to do what franz and triss said and keep your graphics files in the same folder (or a subfolder) as your LaTeX/TeX file. That way all the includegraphics line need to say is
Code (Text):
\includegraphics{potstep.jpg}
or
Code (Text):
\includegraphics{somefolder/potstep.jpg}
if you put it in a subfolder.

10. Jan 30, 2006

Triss

It will only work if \usepackage{graphicx} is called in the preamble, latex is not *that* smart

11. Jan 30, 2006

imabug

right, yeah, good catch. i totally missed that