Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTex using TexnicCenter

  1. Jan 29, 2006 #1
    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. jcsd
  3. Jan 29, 2006 #2
    google for "put figure in latex document"
     
  4. Jan 29, 2006 #3
    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
     
  5. Jan 30, 2006 #4
    Did you remember to use the graphix package in your preamble before you begin the document?
     
  6. Jan 30, 2006 #5
    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
  7. Jan 30, 2006 #6
    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).
     
  8. Jan 30, 2006 #7
    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
     
  9. Jan 30, 2006 #8
    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.
     
  10. Jan 30, 2006 #9
    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.
     
  11. Jan 30, 2006 #10
    It will only work if \usepackage{graphicx} is called in the preamble, latex is not *that* smart :wink:
     
  12. Jan 30, 2006 #11
    right, yeah, good catch. i totally missed that :blushing:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: LaTex using TexnicCenter
  1. Use latex (Replies: 10)

  2. How to use Latex (Replies: 8)

Loading...