[texhax] Colored rectangle on page?

Peter Davis pfd at pfdstudio.com
Thu Apr 7 23:28:37 CEST 2011


On Thu, Apr 7, 2011 at 5:00 PM, William Adams <will.adams at frycomm.com>wrote:

> On Apr 7, 2011, at 4:07 PM, Peter Davis wrote:
>
> > Thanks, Herbert, but can you explain how that works?  Does Ghostscript
> get called behind the scenes to convert PostScript to PDF?  If so, I'd like
> to avoid that.  I would think just drawing a colored or white rectangle
> would not require PSTricks, but I haven't found another way.
> >
> > If PSTricks works with XeLaTeX *without* requiring Ghostscript, I'd
> really like to know about that.
>
> ps/pdftricks not needed:
>
> \documentclass{memoir}
> \usepackage{xcolor}
> \definecolor{testcolor}{cmyk}{1,0.5,0,0}
> \newcommand{\placearect}{\color{testcolor}\rule{288bp}{216bp}}
> \setlength{\unitlength}{1bp}
> \makepagestyle{empty}
> \makeoddhead{empty}{\begin{picture}(0,0)\put(-144,-216)%will need to adjust
> for point of origin of the runninghead
> {\placearect}\end{picture}}{}{}
> \begin{document}
> \pagestyle{empty}test
> \end{document}
>

Excellent!  Thanks!

It also works without pre-defining colors and commands:

\color[cmyk]{0.0,0.0,0.0,0.0}\rule{288bp}{216bp}

Thank you.

-pd


-- 
----
The Tech Curmudgeon
http://www.techcurmudgeon.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20110407/60e6eefe/attachment.html>


More information about the texhax mailing list