Including graphics in LaTeX Help

In summary, you are trying to put a graph generated in maple into a latex document, but you have no experience using either program. You have included the "\usepackage{graphics}" command after "\documentclass{article}, " but this is obviously wrong since all you get is a document with no graph and a whole lot of error messages.
  • #1
*melinda*
86
0
hi,

I'm trying to put a graph generated in maple into a latex document, but I have no experience using either program. So far I've been able to save my maple plot in postscript format, and based on various online tutorials I've included the \usepackage{graphics} comand after \documentclass{article}.

In the body of my document I put,

\begin{figure}[h]
\includegraphics{myfile.ps}
\end{figure}

but this is obviously wrong since all I get is a document with no graph and a whole lot of error messages.

Any help would be mucho appreciated!
:smile:
 
Physics news on Phys.org
  • #2
It would help if you told us what the error messages are. If I remember correctly, "graphics" is an old package and you should use "graphicx". Maybe that will help?
 
  • #3
You might not have the package installed. Do you know if you have psfig? http://ctan.org/tex-archive/nonfree/graphics/psfig/ [Broken]

(I probably can't help much if you are not using linux.)
 
Last edited by a moderator:
  • #4
Latex gave me one warning and one error.

Latex warning: file 'myfile.ps' not found on line41
! Latex error: unknown graphics extention: .ps

I did use \usepackage{graphicx} in my document, I just typed it wrong in this thread.

And as far as having a graphics package instaled, I'm not sure. I downloaded latex from http://www.tug.org/protext/ and instaled all the required and suggested software.

How would I find out if I have the right graphics package?
 
  • #5
There are other graphics packages that you must use to include .ps files...

\usepackage{graphicx}
\usepackage{ifvtex}
\ifvtex
\DeclareGraphicsExtensions{.ps}
\else
\DeclareGraphicsExtensions{.png}
\fi

might work at the beginning of the file...
 
  • #6
It might be that you have to use "encapsulated postscript" .eps files
http://amath.colorado.edu/documentation/LaTeX/reference/figures.html
http://www.postscript.org/FAQs/language/node82.html
http://www.tm.uka.de/~bless/ps2eps

Maple should be able to export .eps.
 
Last edited:
  • #7
I included all those commands, but I still got the same warning and error.

What's the difference between .ps and .eps and why would latex require me to use .eps?
 
  • #9
Ok, I went into my maple worksheet and chose to export my graph as an .eps, but the file says that it is postscript. I'm also very confused by some of the instructions on the links. For example at

http://amath.colorado.edu/documentation/LaTeX/reference/figures.html

In the 'Only PostScript image' section they say, "Then you must compile the document with latex followed by dvips -Ppdf..." I don't understand what I'm being asked to do. What is 'dvips -Ppdf'? Is it a comand, and if it is, how am I supposed to issue it?

I'm also confused about the boundind box. I think I understand what it's used for, but I don't know how to use it.
 
  • #10
What version of TeX are you using? What command do you use to run LaTeX?

Different versions of TeX have different capabilities for handling graphics formats, so if we don't know those facts everybody is guessing.
 

1. How do I include graphics in LaTeX?

To include graphics in LaTeX, you first need to load the graphicx package in your document preamble using the command \usepackage{graphicx}. Then, you can use the \includegraphics command to insert an image in your document, specifying the file name and optional parameters such as width and height.

2. What file formats are supported for graphics in LaTeX?

The graphicx package supports the inclusion of graphics in various file formats, including PNG, JPEG, EPS, PDF, and SVG. However, it is recommended to use PNG or JPEG for raster images and EPS or PDF for vector images.

3. How can I resize a graphic in LaTeX?

To resize a graphic in LaTeX, you can use the \includegraphics command and specify the desired width or height using the width or height parameter, respectively. Alternatively, you can use the \scalebox command to scale the graphic to a specific size.

4. Can I add a caption and label to a graphic in LaTeX?

Yes, you can add a caption and label to a graphic in LaTeX using the \caption and \label commands, respectively. These commands should be placed after the \includegraphics command to ensure the caption and label are associated with the correct graphic.

5. How do I align graphics in LaTeX?

To align a graphic in LaTeX, you can use the \begin{figure} and \end{figure} environment and specify the desired alignment using the \centering, \flushleft, or \flushright commands. Alternatively, you can use the \includegraphics command with the \centering command to center the graphic on the page.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
883
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top