Image is not showing when using natwidth and natheight in figure

1,623

If I understand your problem correctly, you have pdf figures, but you want to get a dvi output from your compilation.

If this is the case, you can try to transform your images from pdf to eps and then compile with latex:

pdftocairo -eps figure1.pdf figure1.eps

or

pdf2ps figure1.pdf && ps2eps figure1.ps

then, in your latex file write:

\includegraphics[width=65mm]{figure1.eps}

and compile with latex myfile.tex to get the .dvi

finally run dvips myfile.dvi for the .ps

See also this answer: Cannot determine size of graphic

Share:
1,623

Related videos on Youtube

Steven
Author by

Steven

Updated on July 11, 2020

Comments

  • Steven
    Steven over 3 years

    I am using the following in my document:

    \usepackage{graphicx}
    \begin{figure}[!t]
    \centering
        \includegraphics[natwidth=436pt, natheight=385pt, width=65mm]{figure1.pdf}
    \end{figure}
    

    The issue is that my image (figure1.pdf) is not showing after running in pdfLatex mode because I specify the natural size natwidth=436pt, natheight=385pt. The reason of adding natwidth and natheight is because I want to generate dvi and ps from my tex file, based on this answer. Kindly, how can I solve this issue?

    • David Carlisle
      David Carlisle over 6 years
      if you are using latex+dvips then you can not include pdf files, you presumably get an error message saying unknown extension (this is unrelated to the size keys on \includegraphics)
    • Steven
      Steven over 6 years
      Yes, I am using pdfLatex when viewing, is that the reason you think?
    • David Carlisle
      David Carlisle over 6 years
      your question is completely unclear and doesn't contain a proper example so it is impossible to guess what you are doing or what the issue is. If you are making dvi as you say in the question you can not use pdflatex and you can not include pdf files. You need to convert the pdf file to EPS and use latex not pdftex.
    • cfr
      cfr over 6 years
      @DavidCarlisle Not quite according to the linked answer. I've never tried it that way, though. But @ OP you cannot generate ps that way, I don't think. You need to convert the DVI to PDF as explained in that answer. That particular DVI to PDF converter will apparently incorporate the PDF linked in the DVI. If you want to see the image in DVI or you want to produce PS, then you need to convert the image as David says.
    • David Carlisle
      David Carlisle over 6 years
      @cfr sure, latex+dvipdfm can include pdf files but OP said was producing ps, and also (unless you are using a non standard configuration) it requires [dvipdfm] option to ``graphicx` as the default option for latex is dvips in the graphics.def used with texlive and miktex.
    • cfr
      cfr over 6 years
      @DavidCarlisle The problem is it isn't clear because the OP also says they are trying to use the linked answer, which contradicts what they also say they are trying to do.
    • David Carlisle
      David Carlisle over 6 years
      @cfr see first sentence of my second comment!
    • Dr. Manuel Kuehner
      Dr. Manuel Kuehner over 6 years
      @DavidCarlisle Don't fight :).