13

I am trying to include sample.ps file to my document with the following code

\documentclass{article}
\usepackage[margin=3cm,a4paper]{geometry}
\usepackage{amsmath,amsthm}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{psbox}

\begin{document}

\PSbox{sample.ps}{4in}{6in}

\end{document}

But it is failing. Is it possible to include .ps file to our latex document? Is there any method like \includepdf[pages=-]{my_file.pdf} ?

12
  • I think you have to use something other than pdftex. See here: math.mun.ca/~edgar/includeps.html Commented Jun 20, 2014 at 6:00
  • Is is your ps file multipage? If not things should be straight forward as inclusion of a graphics file.
    – Masroor
    Commented Jun 20, 2014 at 6:03
  • @JohnWickerson I tried that method, but still failing
    – R S John
    Commented Jun 20, 2014 at 6:06
  • 1
    @RSJohn Looking at the file, it's an EPS (there is a bounding box). Changing the extension to .eps, using \documentclass{article} \usepackage{graphics} \begin{document} \includegraphics{sample} \end{document} works for me with both DVI and PDF output modes.
    – Joseph Wright
    Commented Jun 20, 2014 at 7:16
  • 1
    You can use \usepackage{auto-pst-pdf} and then it will work. I don't have psbox installed so can't check with your code. But: \documentclass{article} \usepackage[margin=3cm,a4paper]{geometry} \usepackage{amsmath,amsthm} \usepackage{amsfonts} \usepackage{graphicx} \usepackage{auto-pst-pdf} \begin{document} \includegraphics[width=4in]{sample.ps} \end{document} works.
    – user11232
    Commented Jun 20, 2014 at 23:29

1 Answer 1

7

Trying the solution suggested by @user11232, it does work. Since that user is no longer available, and with the desire to respond this unanswered question, it is important to have it solved for future references in the site.

The PDF output was generated with LaTeX-->PS-->PDF in TeXnicCenter, by taking the sample.ps image provided by OP in comments

\documentclass{article}
\usepackage[margin=3cm,a4paper]{geometry} 
\usepackage{amsmath,amsthm} 
\usepackage{amsfonts} 
\usepackage{graphicx} 
\usepackage{auto-pst-pdf} 

\begin{document} 

\includegraphics[width=4in]{sample.ps} 

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .