Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Including eps in LaTeX file

  1. #1
    Join Date
    May 2006
    Location
    UEA, Norwich, UK
    Beans
    185

    Including eps in LaTeX file

    I'm trying to compile (not sure if that's the right word) my LaTeX coursework, which includes an esp graphics file. My code is here. I found somewhere on the web that said to type latex integration_notes dvips -Ppdf in the terminal. I don't know if I might have a required package missing?
    Thanks

    Luke

  2. #2
    Join Date
    Jun 2006
    Location
    Bengaluru
    Beans
    118
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Including eps in LaTeX file

    It is called latexing (la-te-ch-ing). Open a terminal and change your directory to the directory you have your integration.tex file. Then run the command

    latex integration_notes.tex

    ## it creates a dvi file called integration_notes.dvi, if there are no errors
    ## make sure that the figures are in the same directory too

    ## your file has only two errors about newline (at line nu 73 & 77
    ## as these donot affect the final output, just enter when it stops
    ## then run
    dvips -Ppdf integration_notes -o

    ## this will create a pdf file by name integration_notes

    Goodluck

    Girish
    Shiny aroma black VAIO running minty Elyssa

  3. #3
    Join Date
    May 2006
    Location
    UEA, Norwich, UK
    Beans
    185

    Re: Including eps in LaTeX file

    Thanks for replying. When I run the second line of code, it creates a PostScript file, not a pdf. Do you know why this is? How can I change to to a pdf? Thanks again.

    Luke

  4. #4
    Join Date
    Jan 2006
    Beans
    74

    Re: Including eps in LaTeX file

    dvips mean dvi->ps.
    To get a PDF you have to use the dvipdf command.
    So this should give you what you want:
    latex integration_notes
    dvipdf integration_notes.dvi

  5. #5
    Join Date
    Jul 2005
    Beans
    1,535
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Including eps in LaTeX file

    You can also produce pdf's directly using pdflatex
    Code:
    pdflatex integration_notes.tex
    Note however, that pdflatex doesn't work with eps figures yet (technically it is still beta software.) You will have to convert all eps figures to pdfs using the command epstopdf. However, pdflatex will work with png's and jpg's which is really nice.
    When I invented the Web, I didn't have to ask anyone's permission.
    ~Tim Berners-Lee on Net Neutrality
    -------------------------------------
    Visit the Ubuntu Programming IRC-channel at #ubuntu-programming (chat.freenode.net).

  6. #6
    Join Date
    May 2006
    Location
    UEA, Norwich, UK
    Beans
    185

    Re: Including eps in LaTeX file

    Thanks for that. All works well. The graphic seems to be of a lower quliaty in the pdf, but I guess that's something to do with it no longer being a PostScript file. Thanks again for all you help.

    Luke

  7. #7
    Join Date
    Jul 2005
    Beans
    1,535
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Including eps in LaTeX file

    Looking at your source code, there is a mistake. You shouldn't be putting the file extension when using the \includegraphics command. It should be:

    Code:
    %\newline  %% You should be letting latex place stuff, why are you trying to move it?
    \begin{figure}[htb]  % You can use the htb to tell latex: place here if possible, if not try top of page, if not try bottom of page. 
    \centering
    \includegraphics{fig1}  % Do not put file extension, only name
    \caption{Example Figure}
    \label{fig:fig1}
    \end{figure}
    %\newline   %% Again, let latex place stuff where it wants to
    When I invented the Web, I didn't have to ask anyone's permission.
    ~Tim Berners-Lee on Net Neutrality
    -------------------------------------
    Visit the Ubuntu Programming IRC-channel at #ubuntu-programming (chat.freenode.net).

  8. #8
    Join Date
    May 2006
    Location
    UEA, Norwich, UK
    Beans
    185

    Re: Including eps in LaTeX file

    Hi thanks for your suggestions. I didn't realise I didn't need the file extension for the graphics file, as we've only been taught to do things like \includegraphics{fig1.jpg}. The \newline lines are there from when I tried to remind myself that I needed to include the graphics file later, and I just forgot to remove them. Unfortunately, it's already been handed in so I can't implement your improvements, but thanks anyway. I'll be sure to bear this in mind in future.

  9. #9
    Join Date
    Apr 2005
    Beans
    22

    Re: Including eps in LaTeX file

    Quote Originally Posted by hod139 View Post
    You can also produce pdf's directly using pdflatex
    Code:
    pdflatex integration_notes.tex
    Note however, that pdflatex doesn't work with eps figures yet (technically it is still beta software.) You will have to convert all eps figures to pdfs using the command epstopdf. However, pdflatex will work with png's and jpg's which is really nice.
    On The Mac latex port (Texshop etc) it deafults to pdflatex, and to get around the eps problem it defaults to including the package 'epstopdf' on it's standard document template - this automatically converts any eps files to pdf when the document is compiled. I haven't tested it on ubuntu but I imagine it would work the same.

  10. #10
    Join Date
    Dec 2005
    Beans
    41

    Re: Including eps in LaTeX file

    Have you tried using LyX? http://www.lyx.org/
    It allows you to see things like eps figures and equations on the screen as you are working. Equation entry is especially nice - you just type things like you would in LaTeX and it does the formatting and displays the equation as you type. My students have learned to use it very quickly and one has written reports with over 100 pages. LyX handles it with ease and remains fast and responsive. Use the lyx-qt version. I highly recommend it.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •