Seminar environment plus psfrag plus TeXshop — I can't get all three to work together

A while ago, I discovered that TeXshop has trouble with producing slides that overflow the right margin in the seminar environment. I found a solution in this thread on latexcommunity -- use pdftex and insert

\setlength{\pdfhorigin}{1truein}
\setlength{\pdfvorigin}{1truein}
\makeatletter
\setlength{\pdfpagewidth}{\strip@pt\paperheight truept}
\setlength{\pdfpageheight}{\strip@pt\paperwidth truept}
\makeatother


I also have been happily using psfrag to decorate my figures. I have just tried to put some of those figures into a set of slides and found that psfrag wasn't inserting the required tex. From some googling, it looks like the key here is to use "TeX and DVI", not Pdftex. I see that this question may have some better answers, but I don't immediately see whether they solve the question.

Here is an example:

\documentclass{seminar}
\usepackage{amsthm, amsmath, amssymb, amsfonts, graphics}
\usepackage{epstopdf, psfrag, pstricks}
\DeclareGraphicsRule{.tif}{png}{.png}{convert #1 dirname #1/basename #1 .tif.png}

\setlength{\pdfhorigin}{1truein}
\setlength{\pdfvorigin}{1truein}
\makeatletter
\setlength{\pdfpagewidth}{\strip@pt\paperheight truept}
\setlength{\pdfpageheight}{\strip@pt\paperwidth truept}
\makeatother

\begin{document}

\begin{slide}

{
\psfrag{1}{$x$}
\includegraphics{Test.eps}
}

\end{slide}
\end{document}


Create an eps file called Test.eps with the symbol 1 in it. If you compile with "TeX and DVI", the 1 will be replaced by x, but it will overflow the righthand margin. If you compile with "Pdftex", the margins are correct but the 1 is not replaced.

Thanks!

-

Packages that use postscript wizardry such as psfrag and pstricks won't work directly with pdflatex. The packages pstool and pst-pdf help with this, but things can get complicated. My guess is that sticking with latex-dvips-ps2pdf' is the simplest option. In that case you just need to do

latex seminar
dvips -tlandscape seminar
ps2pdf seminar


to get the proper landscape slides. I don't have TeXShop on this machine, but if you dig around in the menus you will find the commands that it uses to create pdfs, and you should be able to edit these to add -tlandscape.

-

The "if you dig around" step was harder than expected, and last time I gave up and did something else, but I just tried again and figured it out.

These directions are for TeXShop 2.47 on OS X 10.6.8.

Go to TeXShop > Preferences > Engine

You care about the commands in the TeX + dvips + distiller area. If (as I am) you are using LaTeX, then you want to edit the bottom one. As you can see, by default, TeXShop uses simpdftex to produce PDF documents. Your challenge is to pass a command to dvips through simpdftex. To quote the simpdftex man file:

    --dvipsopts

Give arbitrary arguments to dvips, e.g.  --dvipsopts  "-M"  Sets
extension  for  --extendedfilename to .custom. --dvipsopts over-
rides other flags that set dvipsopts.


I therefore edited the second field in the TeX + dvips + distiller area to read

simpdftex latex --maxpfb --extratexopts "-file-line-error -synctex=1"   --dvipsopts "-tlandscape"


The new stuff is --dvipsopts "-tlandscape", everything else was just copying the TeXShop default.

By the way, if you screw up in editing something in this preference box, clicking "default" will restore the original values.

-