2

I have been trying to create EPS files from drawings of several optical experimental setups made with pst-optexp. It all works quit well for pdf files so there is no issue on that front. There is however a problem when converting the drawings to EPS (I need to be able to use the drawings in programs like PowerPoint).

Below is a proportion of one drawing, I've removed parts that aren't important for this problem.

\documentclass[letterpaper,dvips]{article}
\usepackage{pst-all}
\usepackage{pst-eps}
\usepackage{pst-optexp}
\usepackage{pstricks}
\usepackage{units}
\begin{document}
\pagestyle{empty}
\begin{TeXtoEPS}
\begin{pspicture}(6,3.5)

\pnodes(5,2){A}(5,1){B}(4,1){C}(2,1){D}
\optbox[position=start, optboxwidth=1.2,optboxheight=1.5,labeloffset=0](A)(B){Laser}
\mirror[labelangle=45](A)(B)(C){M1}
\optplate[abspos=0.5, labelangle=0,label=.98](C)(D)

\end{pspicture}
\end{TeXtoEPS}
\end{document}

I convert the files using:

latex draw.tex
dvips draw.dvi -E -o draw.eps

The EPS file is then created but is not displayed in Powerpoint. (Empty box with "This image cannot currently be displayed." message) The problem appears to be caused by the following line - without it PowerPoint is able to display the resulting eps file:

\mirror[labelangle=45](A)(B)(C){M1}

Does anyone have an idea on how to solve this problem? I would be happy with a conversion to PNG as well. Although I'd prefer EPS, I don't care too much about the format anymore as long as it'll work with Office products.

1 Answer 1

1

Use

\documentclass{article}
\usepackage{pst-optexp}
\usepackage{units}
\pagestyle{empty}
\begin{document}
\begin{pspicture}(6,3.5)        
        \pnodes(5,2){A}(5,1){B}(4,1){C}(2,1){D}
        \optbox[position=start, 
        optboxwidth=1.2,optboxheight=1.5,labeloffset=0](A)(B){Laser}
        \mirror[labelangle=45](A)(B)(C){M1}
        \optplate[abspos=0.5, labelangle=0,label=.98](C)(D)
\end{pspicture}
\end{document}

and then

latex draw.tex
dvips draw.dvi -E -o draw.eps
epstool --bbox --copy draw.eps draw2.eps

epstool is available for *nix and Windows:

Epstool is a utility to create or extract preview images in EPS files, fix bounding boxes and convert to bitmaps

http://pages.cs.wisc.edu/~ghost/gsview/epstool.htm

3
  • I've tried that but unfortunately it didn't work. There is still the same problem as before. I'll have another look around to see if there is another way.
    – Mario
    Dec 7, 2016 at 11:38
  • the sequence latex->dvips->ps2pdf will work. Or as an alternative using package auto-pst-pdf and then pdflatex
    – user2478
    Dec 7, 2016 at 11:40
  • I must me doing something wrong as I can't get it to work. Had a look at the auto-pst-pdf method as well but didn't work.
    – Mario
    Dec 7, 2016 at 14:51

You must log in to answer this question.

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