[pstricks] Use of variable parameters in PSTRICKS

Denis Girou Denis.Girou at idris.fr
Tue Feb 19 21:30:47 CET 2002

>>>>> "John.Culleton" == John Culleton <john at wexfordpress.com> writes:

    John.Culleton> I am still working on the problem of creating a sidebar
    John.Culleton> with a tinted background. I have the sidebar part
    John.Culleton> taken care of. Now I want to add a tinted background.
    John.Culleton> The sidebar will vary in length depending on conten of course.

    John.Culleton> Can I use a TeX variable (e.g. \pagetotal) instead of
    John.Culleton> an explicit quantity in a Pstricks macro? 

  Of course.

  If I have not completely misunderstood what you try to do (which can be the
case!), you can look at this quick and dirty (LaTeX) example. You can compute
the hight of your sidebar in the same way than here I compute the position of
the page number.

  You can perhaps also found some ideas in the `fancyhdr' manual in
paragraph 20.


% Warnings :
%  - this file must be compiled twice
%  - the coordinates of the \fancyput macro are set for the A4 format




% To know the number of pages (we write it in the .aux file)
\def\NumberLastPage{9999} % Initialization


\rput(0.5,-\pst at dimh){%


\pst at cnth=\NumberLastPage
\advance\pst at cnth\@ne
\pst at dimh=\paperheight
\divide\pst at dimh\pst at cnth
\pst at dimg=\pst at dimh
\divide\pst at dimg\tw@
\pst at cntg=\thepage
\advance\pst at cntg\m at ne
\multiply\pst at dimh\pst at cntg
\advance\pst at dimh\pst at dimg











More information about the PSTricks mailing list