0

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?

Steven
  • 333
  • 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) – David Carlisle Mar 14 '17 at 19:33
  • Yes, I am using pdfLatex when viewing, is that the reason you think? – Steven Mar 14 '17 at 19:35
  • 3
    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. – David Carlisle Mar 14 '17 at 19:39
  • @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. – cfr Mar 15 '17 at 00:03
  • @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 ``graphicxas the default option for latex isdvipsin thegraphics.def` used with texlive and miktex. – David Carlisle Mar 15 '17 at 07:42
  • @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. – cfr Mar 15 '17 at 16:58
  • @cfr see first sentence of my second comment! – David Carlisle Mar 15 '17 at 17:01
  • @DavidCarlisle Don't fight :). – Dr. Manuel Kuehner Mar 16 '17 at 01:21

1 Answers1

1

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

Matteo Gamboz
  • 432
  • 3
  • 8