3

I have a pstricks image in a document like

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{pstricks}
\usepackage{pst-eps}
\usepackage{pstricks-add}
\usepackage{pst-node}
\usepackage{pst-tree}
\begin{document}%
\begin{TeXtoEPS}%
\begin{pspicture}(-1.5,-1.50)(7.5,3)%
\normalsize%

 % tree here, sorry but confidential and big.
\end{pspicture}
\end{TeXtoEPS}
 \end{document}

And I generate the ps using latex; dvips to ps. But it is too big to fit on the page, only the leftmost part is shown. How to make it fit??? Thanks.

  • 2
    You should present an example that demonstrates your problem. At the moment there is no problem with your code sample. Please construct the most simple example that reproduces the described misbehaviour, a so called minimal example. Replace confidential content with dummy text. – Thorsten Donig Apr 22 '12 at 19:06
  • I imagine the problem is that somewhere in your document you have used \psset{<something>}, so your current picture is being drawn off the page. Have a look at the \setwindow command that I define in scaling-a-pst-3dplot-to-fit-a-beamer-frame – cmhughes Apr 22 '12 at 19:13
3

use \resizebox from the graphicx package

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{pstricks-add}
\usepackage{pst-tree}
\usepackage{graphicx}
\begin{document}%

\resizebox{\linewidth}{!}{%
\begin{pspicture}(-1.5,-1.50)(7.5,3)% not really needed for a tree
\normalsize%

 % tree here, sorry but confidential and big.
\end{pspicture}%
}
 \end{document}

By the way: a tree does not need the pspicture environment

  • I used scaledbox... which is similar... – UmNyobe Apr 23 '12 at 22:10
  • scalebox makes only sense if you really know which factor for scaling should used. – user2478 Apr 27 '12 at 7:04
2

You can use \psset{unit=0.5cm} before command \begin{pspicture} to scale entire picture by changing the value of the unit. Obviously 0.5cm above was randomly choosen. You sholuld play little bit to figure out which scale works for you.

  • I tried \psset{} but it affected only part of the figure. the issue is that I am not the only one writing it, so didn't want to change the content. I used \usepackage{graphicx} %\scalebox .... \scalebox{\myscale}{ \begin{pspicture} % picture data here \end{pspicture} } Then used a ps tool to get a eps figure with accurate bounding box. – UmNyobe Apr 22 '12 at 22:33
  • this was supposed to be my answer... I should have said it solved the problem. – UmNyobe Apr 23 '12 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.