[OS X TeX] TeXniscope problem

Ross Moore ross at ics.mq.edu.au
Sun May 14 03:09:13 CEST 2006


Hi Herb,

On 12/05/2006, at 11:57 PM, Herbert Schulz wrote:

>
> On May 12, 2006, at 2:34 AM, Ross Moore wrote:
>
>>
>> The best way that I've found to deal with this is to use either
>> (or both) of the packages  ps4pdf  and  pdftricks .

... or the  pst-pdf  package, which is similar in the way it works
to  ps4pdf  ---  thanks to Michael Hoppe for mentioning this update.

(However, because of the way this affects  {pspicture}  environments
there may be some esoteric usages for which it would be desirable
to stick with the older ps4pdf .)

>
> Howdy,
>
> My first impression was that pdftricks placed each figure into a 
> separate file (although there was a common file containing 
> \usepackage's for the requested packages) while ps4pdf placed the 
> figures on separate pages in a single file and extracted the images 
> page by page into the original document. I can see situations where 
> one method might be more convenient than another when having to send 
> the documents to someone else for review but not otherwise.
>
> Are there other differences that are worth mentioning?

Absolutely.
The ways these packages work has a significant effect on how they
can be used, when you want to do more than just include some
stand-alone images/figures which require PostScript.

Put simply,  ps4pdf  and  pst-pdf   act as output-filters,
whereas  pdftricks  acts as an input-filter.

By an output filter, I mean that with  ps4pdf  loaded, when you
run your job in  TeX+dvips+Ghostscript  mode, all the document
processing is done as per normal, but the only output that is
produced is that which is contained within the \PSforPDF{...}
commands --- or  {postscript}  (and some other) environments
using  pst-pdf .

This means that you can include arbitrary (La)TeX material,
including counter-values and cross-references, citations, etc.
The correct values will be displayed in the resulting PDF image.


With pdf-tricks , each portion requiring use of PostScript is bundled
into a separate job, to be run separately --- with its own
\documentclass, packages and other preamble material.
In a sense, your LaTeX input source has been filtered so as to
find the pieces required to build this separate job.

Because this job is run external to the main processing, it cannot
automatically use numbering and cross-references from the main job.
By careful setup of the preamble material it may be possible to do
this --- but it doesn't come for free. You have to work hard to make
this happen.


So it seems that  ps4pdf  and pst-pdf are better ?
Well, actually no.
It still depends on exactly what you want to do.


Think about what happens when the PostScript coding places
material outside of the area that TeX regards as the typeset area
for the material provided.
There are many situations where this can happen;
e.g. labels on/over/around  an included figure (in particular,
when using the  psfrag  technique); or rotated labels.

With ps4pdf  and  pst-pdf  the output is sized for what TeX knows
about. This can result in parts of the PostScript-constructed
image being cropped away.
(There is a mechanism  --- notightcrop  option, or somesuch
--- that allows a whole page to be used. This then needs to
be trimmed down to the correct size, by specifying a viewport.
A fair bit of work is needed to get this correct and adjust your
LaTeX source; it doesn't happen for free.)


With  pdftricks  there is no such problem.
Because each environment has been made as a separate
image, it can be processed by other utilities; e.g.  pdfcrop .
Indeed this is what happens, automatically, as  pdftricks
uses the  \write18  (shell-escape)  mechanism to run the
external job and call-up other utilities as needed.

Of course this requires that the initial  pdflatex  job is called
using the   --shell-escape  switch. (But this is normal with
TeXshop, I think. With a script or Makefile, it's just a single
short edit.)


With  pdftricks,  a TeX programmer could add the ability
to create a  .aux  file for each single-image sub-process.
This could be done similarly to what is done with LaTeX's
  \include  macro.
This solves the problem mentioned above.
It is still necessary to ensure that any home-grown macro
definitions are made available in the preambles of the
sub-processes.


For  pst-pdf , there is no way to get the true bounding-box,
except after-the-fact, requiring some hand-work.




>
> Good Luck,
>
> Herb Schulz
> (herbs at wideopenwest.com)
>

Cheers,

	Ross

------------------------- 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 macostex-archives mailing list