Using LaTeX with TexnicCenter: Inserting Pictures

  • LaTeX
  • Thread starter NEWO
  • Start date
  • Tags
    Latex
In summary, the conversation is about a person trying to insert a picture into their Latex document using TexnicCenter. They are having trouble with the commands and the file location, but they have been advised to make sure they have the graphicx package installed and added to their document before using it in a figure environment. They are also advised to keep all files related to the document in the same folder to prevent any issues with the Latex distribution.
  • #1
NEWO
95
0
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
 
Physics news on Phys.org
  • #2
NEWO said:
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

google for "put figure in latex document"
 
  • #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
 
  • #4
NEWO said:
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

Did you remember to use the graphix package in your preamble before you begin the document?
 
  • #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:
\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:
\documentclass{article}
\usepackage{graphicx}
\graphicspath{{E:/Documents/}} 
\begin{document}
\includegraphics{stone} % stone.jpg <--!
\end{document}
 
Last edited:
  • #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).
 
  • #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
 
  • #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.
 
  • #9
NEWO said:
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

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:
\includegraphics{potstep.jpg}
or
Code:
\includegraphics{somefolder/potstep.jpg}
if you put it in a subfolder.
 
  • #10
imabug said:
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.

It will only work if \usepackage{graphicx} is called in the preamble, latex is not *that* smart :wink:
 
  • #11
Triss said:
It will only work if \usepackage{graphicx} is called in the preamble, latex is not *that* smart :wink:
right, yeah, good catch. i totally missed that :blushing:
 

Related to Using LaTeX with TexnicCenter: Inserting Pictures

What is LaTeX and how is it used with TexnicCenter?

LaTeX is a typesetting system used for creating professional-looking documents, particularly in the fields of mathematics, science, and engineering. TexnicCenter is a popular integrated development environment (IDE) for working with LaTeX. It provides a user-friendly interface for creating and editing LaTeX documents.

How do I insert pictures into my LaTeX document using TexnicCenter?

To insert a picture in LaTeX using TexnicCenter, you will need to use the graphicx package. This package allows you to import images into your document. You can use the \includegraphics command to specify the location and size of the image you want to insert. For example, \includegraphics[width=0.5\textwidth]{image.jpg} will insert an image called "image.jpg" that is half the width of the text.

What image formats are supported in LaTeX documents?

The graphicx package in LaTeX supports several common image formats, including JPEG, PNG, and PDF. However, it is recommended to use vector graphics such as EPS or PDF for better quality when printing. If you have an image in a different format, you can convert it to one of these supported formats using an online converter or a graphics software.

Can I resize and reposition images in my LaTeX document?

Yes, you can use the optional arguments of the \includegraphics command to adjust the size and position of your images. For example, you can use the width and height arguments to specify the dimensions of the image, and the angle argument to rotate it. You can also use the \caption and \label commands to add a caption and label to your image, which can be referenced in the text.

Are there any specific guidelines for including images in a LaTeX document?

Yes, it is important to follow some best practices when including images in a LaTeX document. These include using high-quality images, using vector graphics when possible, and using descriptive and concise captions for your images. It is also recommended to keep your images and the corresponding LaTeX code in the same folder for easier organization.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
670
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
750
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
2
Replies
45
Views
9K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top