pstree too gets too large

Etienne Riga etienne.riga at skynet.be
Mon Nov 15 15:50:07 CET 1999


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

>Is there any possibility to choose the right command automatically
> either \scaleboxto(\textwidth, 0) {...}  
> or \scaleboxto(0, \textheight) {...}
>to implement a best-fit.


Hereafter a plain \TeX macro that does the job.
Unfortunately, it will be necessary to translate it into Latex.


\hsize=11.8cm   \pagewidth=\hsize
\vsize=18cm     \pageheight=\vsize
\psset{unit=1cm}


\newbox\BXTBS       %BoXToBeScaled
\newdimen\wdBXTBS\newdimen\htBXTBS

\def\scaleboxtopage#1{\setbox\BXTBS\hbox{#1}%
  \htBXTBS=\ht\BXTBS\wdBXTBS=\wd\BXTBS 
  \ifdim\htBXTBS>\pageheight
   \ifdim\wdBXTBS>\pagewidth
  \divide\htBXTBS by190           % my \pageheight in mm
  \divide\wdBXTBS by118         % my \pagewidth in mm
                % This two dimensions to be customized
    \ifdim\wdBXTBS>\htBXTBS
     \scaleboxto(\pagewidth,0){\box\BXTBS}%
    \else
     \scaleboxto(0,\pageheight){\box\BXTBS}%
    \fi
   \else
    \scaleboxto(0,\pageheight){\box\BXTBS}%
   \fi
  \else
   \ifdim\wdBXTBS>\pagewidth
    \scaleboxto(\pagewidth,0){\box\BXTBS}%
   \else
    \box\BXTBS
   \fi
  \fi}


\centerline{\scaleboxtopage{\pspicture(15,17)\psframe(15,17)\endpspicture}}

\vfil\eject

\centerline{\scaleboxtopage{\pspicture(11,20)\psframe(11,20)\endpspicture}}

\vfil\eject

\centerline{\scaleboxtopage{\pspicture(15,20)\psframe(15,20)\endpspicture}}

\vfil\eject

\centerline{\scaleboxtopage{\pspicture(13,25)\psframe(13,25)\endpspicture}}

\vfil\eject

\centerline{\scaleboxtopage{\pspicture(1,2)\psframe(1,2)\endpspicture}}

\bye





-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list