Angus Leeming <[EMAIL PROTECTED]> writes: > On Monday 01 July 2002 6:51 pm, Andre Poenitz wrote: > > Is that solved by some snippet David sent a few days ago? > > Hmm. Probably. I can't get them to work. See below.
> > One thing I have noticed from your screenshot is that the colors are > > off. > > > > If you are just working via command line, try > > -c 0.5 0.3 0.7 setrgbcolor clippath fill 0.2 0.8 0.9 setrgbcolor -f > > I'll be damned if it works for me. No change at all. I append the shell > script I use and the ps file since it's quite small. Any ideas? > > > on the GhostScript command line after the device has been set, of > > course using the RGB values of the current background and foreground > > colors of the LyX window. If you have those as integer numbers, you > > can write > > -c '[' 45 54 54 234 234 234 ']' '{' 255 div '}' forall setrgbcolor > > clippath fill setrgbcolor -f Sorry, there are several problems involved here. One is that I blindly believed the GhostScript documentation that states: -c tokens ... Interprets arguments as PostScript code up to the next argument that begins with "-" followed by a non-digit, or with "@". For example, if the file quit.ps contains just the word "quit", then -c quit on the command line is equivalent to quit.ps there. Each argument must be exactly one token, as defined by the token operator. It turns out that this works if you make just one big argument in which tokens are delimited by spaces. Quite contrary to what the docs state. The other problem is that I have had a thinko: this page setup has to be done after setpagedevice (if any), and it has to be repeated for every page. So with TeX output, you'd have to place it into your bop-hook. But bop-hook gets overwritten by preview's dvips and tightpage option, and the tightpage option causes a setpagedevice command to be executed, anyway (in preview-latex, we don't use tightpage and do the page setup manually via stdin, so I had not thought this through, sorry). One solution: after loading the package preview, issue \AtBeginDocument{\AtBeginDvi{% \special{!userdict begin/bop-hook{//bop-hook exec <343434656565>{255 div}forall setrgbcolor clippath fill setrgbcolor}bind def end}}} Where the 343434656565 is the rrggbbrrggbb hex string for foreground and background. I don't see in a whiffy how this could be done reasonably easy from outside the LaTeX file. If this is a problem, I will try to find some other scheme. The "\AtBeginDocument" is only necessary in case preview get loaded with the "delay" option. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum Email: [EMAIL PROTECTED]