9

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} ?

  • I think you have to use something other than pdftex. See here: math.mun.ca/~edgar/includeps.html – John Wickerson Jun 20 '14 at 6:00
  • Is is your ps file multipage? If not things should be straight forward as inclusion of a graphics file. – Masroor Jun 20 '14 at 6:03
  • @JohnWickerson I tried that method, but still failing – R S John Jun 20 '14 at 6:06
  • @Masroor my file is a single page ps file – R S John Jun 20 '14 at 6:07
  • 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 Jun 20 '14 at 23:29
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.