[pstricks] Scaling pstricks output

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Mon Jul 12 21:22:31 CEST 2004


Peter Hutnick wrote:
> Jean-Come Charpentier wrote:
> 
>> Peter Hutnick wrote:
> 
> 
>>> Any chance of using a LaTeX unit, like 2in or 144pt?
>>>
>>
>> Sure!
>> \psset{unit=2in}
>> or
>> \psset{unit=144pt}
> 
> 
> Sorry, I was thinking one thing, and wrote another.  What I mean is: is 
> there a way to give an overall dimension.  My concern is that I want 
> these things to be robust enough that if I change my margins it will all 
> still come out correctly, or if I change the scale (in the x/y sense) of 
> a figure I don't have to recalculate the unit size to get the right 
> overall width.  That's why I lead in with the \scale macro.
> 
> What would be ideal would be to set each one so that it would 
> grow/shrink to fit \marginparwidth automagically.  I'm looking for what 
> I would expect \scale{\marginparwidth} to do.

the easiest way is the new \psgraph from pstricks-add. It does autoscale
the pspicture environment.

Herbert


\documentclass[a4paper,12pt]{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\textwidth=10cm

\def\image{%
   \psgraph[arrows=->](0,0)(4,4){\marginparwidth}{1.5\marginparwidth}
     \psplot{0}{4}{x 1.2 div}
   \endpsgraph%
}
\begin{document}

\marginpar{\image}

blah
\clearpage
\marginparwidth=1.5in
\marginpar{\image}

blah

\end{document}



-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes




More information about the PSTricks mailing list