[OS X TeX] A suggestion for NewPdftricks (or for pdftricks in general)

Herbert Schulz herbs at wideopenwest.com
Thu May 26 21:16:10 EDT 2005


On May 26, 2005, at 7:15 PM, Ross Moore wrote:

> ... There is a much easier way to solve this.
>
>  pdftricks.sty  has a macro  \BeforeStream  that determines what goes
> at the beginning of each job that creates an image; viz.
>
> \def\BeforeStream
>    {\message{Opening PDFStream=\PDFTfigname.tex}%
>     \immediate\write\verbatim at out{\string\documentclass{article}}
>     \immediate\write\verbatim at out{\string\input\space tmp.inputs}
>     \immediate\write\verbatim at out{\string\pagestyle{empty}}
>     \immediate\write\verbatim at out{\string\begin{document}}
>     }
> ...

Howdy,

I was planning on doing something like

\ifnum\@ptsize=0\relax
     \immediate\write\verbatim at out{\string\documentclass{article}}
\else\ifnum\@ptsize=1\relax
     \immediate\write\verbatim at out{\string\documentclass[11pt]{article}}
\else
     \immediate\write\verbatim at out{\string\documentclass[12pt]{article}}
\fi\fi

since any other choice would be caught earlier by the class.  
Simpleminded but it should work. This could be extended for the  
memoir class, etc. I don't think it makes too much difference what  
the class is since the figure(s) would be passed through pdfcrop  
(latex->dvips->ps2pdf13(with the auto-rotate off)->pdfcrop) anyway.

By the way, in pdftricks each figure is in its own files; quite  
different than the case with ps4pdf. I've set up a TeXShop engine for  
ps4pdf that uses the same processing for the figure file as I use for  
pdftricks; that seems to solve a cropping problem I've seen in both  
cases. I can't say why I prefer pdftricks better than ps4pdf; maybe I  
understand how pdftricks works a bit better.

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)


--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list