[OS X TeX] How to find coloured pages automatically?

Guido Mocken mocken at physik.uni-freiburg.de
Thu Jan 20 14:52:08 CET 2005


Am 19.01.2005 um 18:05 schrieb Chris Goedde:
> The simplest thing would be just to double-click on the PS file, let 
> Preview open it, and figure out which pages have color. If you want to 
> automate this step, you could do the following: Look through the PS 
> file in a text editor for the color commands. These will be things 
> like "setrgbcolor". (You could search for just "color", I think.) Page 
> numbers will be identified by lines like: %%Page: 10 10. You could 
> then write a perl or shell or awk script to figure out which pages 
> contain the color figures. This is left as an exercise for the reader 
> :-).

Good idea, but too much programming involved - and meanwhile, I have 
figured out the relevant pages by hand.

I was hoping there was a way to use AppleScript for the job, but 
neither Preview nor AdobeReader seem to be scriptable at all. What a 
shame.

> Once you know which pages have the color figures, there is a UNIX 
> utility called "psselect" that allows you to print certain pages of a 
> PS file. It should be installed on your system if you installed TeX 
> via i-Installer. You can open up a terminal window and type "which 
> psselect" to see if you have it and "man psselect" to see how to use 
> it.

I know psselect, but I prefer pdftex, so I will now use pdfpages to 
split it.

Thanks,

	Guido

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