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

Including graphics in LaTeX Help!

  1. Sep 11, 2007 #1
    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:
     
  2. jcsd
  3. Sep 11, 2007 #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?
     
  4. Sep 11, 2007 #3

    Chris Hillman

    User Avatar
    Science Advisor

    You might not have the package installed. Do you know if you have psfig? http://ctan.org/tex-archive/nonfree/graphics/psfig/

    (I probably can't help much if you are not using linux.)
     
  5. Sep 11, 2007 #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?
     
  6. Sep 11, 2007 #5

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    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....
     
  7. Sep 11, 2007 #6

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Last edited: Sep 11, 2007
  8. Sep 11, 2007 #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. Sep 11, 2007 #8

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  10. Sep 11, 2007 #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.
     
  11. Sep 12, 2007 #10

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Including graphics in LaTeX Help!
Loading...