AlphaX, teTeXcomm, pstricks and microtype revisited, was:[OS X TeX] Re: pdflatex with dvi-output

Michael Hoppe mh at michael-hoppe.de
Fri Nov 11 06:36:29 EST 2005


Dear Robert,

>Let me explain

Thank you very much, but I know about those facts already.  A year ago I wrote:

%----------------------------------------------------
Dear TeXers,

here's my solution to get pstricks integrated in pdflatex.  First get 
ps4pf and tetexComm.tcl from Joachim Kock and install both.

     We (ab)use the switch usedvipdfm for our purpose.  For that, open 
tetexComm.tcl in Alpha and locate the lines

if { $TeXCmodeVars(usedvipdfm) } {
	set cmd "echo \r ; dvipdfm $texRun(jobName) 2>&1"
}

Change them as follows:

if { $TeXCmodeVars(usedvipdfm) } {
	#set cmd "echo \r ; dvipdfm $texRun(jobName) 2>&1"
	set cmd "echo \r ; dvips -Ppdf -o $texRun(jobName)-pics.ps 
$texRun(jobName).dvi 2>&1 ; \
	  echo \r ; ps2pdf $texRun(jobName)-pics.ps 
$texRun(jobName)-pics.pdf ; \
	echo \r ; pdflatex $texRun(jobName).tex"

Save tetexComm.tcl and restart Alpha and set the switch usedvipdfm in 
the prefs for TeXC.

     Next thing to do is to wrap all the pstricks-stuff in PSforPDF{} 
as described in the ps4pdf manual.  Write

     %&latex

in the first line of your document and then run the script via 
Command-Shift-R.  In this step all the pictures get converted.  This 
production step is only needed once to convert the pictures, so after 
this production change

     %&latex

in

     %&pdflatex

and tex your document as usual.  Repeat the production of the 
pictures (i.e., change %&pdflatex in %&latex again,) only if you've 
created new pspictures or the like.  Happy texing,

Michael

NB: Be sure to load microtype before the ps-stuff.

%----------------------------------------------------

But this solution didn't work in the latest release of gwtex -- for 
whatever reason, I don't know yet.  So I was looking for a 
command-line-like solution, but I've found a very better one, which 
is working in all environments.

     The usual way to have pst-pdf working is:

     latex file.tex
     ps2pdf file-pics.ps file-pics.pdf
     (pdf)latex file.tex

In the first latex-run a file (named file-pics.ps) is automagically 
produced which contains all the pstricks-images.  This first step 
*must* be done by latex, not pdflatex.  But to achieve all the 
benefits of microtyping, pdflatex is neccessary.  Lokks like a catch 
22, but here's the solution with the packacke ifpdf.

%---------------------------------
\documentclass{whatever you like}
\usepackage{ifpdf}

%Now load your other stuff, esp. pstricks and the insert:

\ifpdf
\usepackage[whatever options]{microtype}
\fi
%------------------------------------------

All will run smoothly.

Michael
-- 
-= Michael Hoppe <www.michael-hoppe.de>, <mh at michael-hoppe.de> =-----
-= Key fingerprint = 74 FD 0A E3 8B 2A 79 82 25 D0 AD 2B 75 6A AE 63
-= PGP public key ID 0xE0A5731D  =-----------------------------------
------------------------- 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 Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list