2

I am trying to build a flow chart using pstricks, the code is below. But when I compile it the resulting PDF does not display the flowchart, in place, it looks like if all the information is superposed in a very small box. I don't know where my error is.

    \documentclass{article}
 \usepackage[pdf]{pstricks}
 \usepackage{epsfig}
 \usepackage{pst-grad} % For gradients
 \usepackage{pst-plot} % For axes
 \usepackage{auto-pst-pdf}
\begin{document}
\begin{postscript}
%\psscalebox{1.0 1.0} % Change this value to rescale the drawing.

\begin{pspicture}(0,-7.8)(19.2,7.8)
\psframe[linecolor=black, linewidth=0.04, dimen=outer](14.8,7.8)(9.2,5.8)
\rput[bl](10.0,7.0){Input:}
\psdots[linecolor=black, dotsize=0.08](10.0,6.6)
\rput[bl](10.4,6.6){Load geo.xyz}
\psdots[linecolor=black, dotsize=0.08](10.0,6.2)
\rput[bl](10.4,6.2){Load basis-set, charge,  SM}
\psframe[linecolor=black, linewidth=0.04, dimen=outer](6.4,4.6)(0.0,2.6)
\rput[bl](0.8,3.8){Initial guess for orbitals}
\psdots[linecolor=black, dotsize=0.08](1.2,3.4)
\psdots[linecolor=black, dotsize=0.08](1.2,3.0)
\rput[bl](1.6,3.4){Core Hamiltonian (OK)}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(9.2,6.6)(3.2,6.6)(3.2,4.6)
\rput[bl](1.6,3.0){Huckel Hamiltonian (No)}
\psframe[linecolor=black, linewidth=0.04, dimen=outer](14.8,4.6)(9.2,2.6)
\rput[bl](10.0,3.8){Compute the Fock}
\rput[bl](10.0,3.4){Matrix}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(12.0,5.8)(12.0,4.6)
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(6.4,3.8)(9.2,3.8)
\psframe[linecolor=black, linewidth=0.04, dimen=outer](14.8,1.4)(9.2,-3.4)
\rput[bl](9.6,0.6){Solve Eigen-system:}
\rput[bl](10.0,-0.2){RHF}
\rput[bl](10.0,-1.8){UHF}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(12.0,2.6)(12.0,1.4)
\psdiamond[linecolor=black, linewidth=0.04, dimen=outer](12.0,-6.2)(2.8,0.8)
\rput[bl](10.8,-6.2){SCF converged?}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(12.0,-3.4)(12.0,-5.4)
\psframe[linecolor=black, linewidth=0.04, dimen=outer](19.2,0.6)(15.6,-2.6)
\rput[bl](16.0,-0.2){Updates}
\psdots[linecolor=black, dotsize=0.08](16.4,-1.0)
\rput[bl](16.8,-1.0){Orbitals}
\psdots[linecolor=black, dotsize=0.08](16.4,-2.2)
\rput[bl](16.8,-2.2){Charge density}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(14.8,-6.2)(17.6,-6.2)(17.6,-2.6)
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(17.6,0.6)(17.6,3.8)(14.8,3.8)
\rput[bl](16.0,-6.2){No}
\psframe[linecolor=black, linewidth=0.04, dimen=outer](6.4,-4.2)(0.0,-7.8)
\rput[bl](0.4,-5.0){Get Post-Hartree-Fock start-up:}
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(9.2,-6.2)(6.4,-6.2)
\rput[bl](7.6,-6.2){Yes}
\end{pspicture}
%}
\end{postscript}
\end{document} 
2
  • Are you compiling with LaTeX > dvips > ps2pdf or with XeLaTeX? Or are you compiling with pdfLaTeX? You should one of the former two, not pdfLaTeX, or include the --shell-escape option to enable direct compilation to PDF.
    – Werner
    Oct 7, 2014 at 0:48
  • Compiling with pdflatex --enable-write18 (I use MiKTeX) works fine, except the resulting flowchart is too large. Also, it would be better to load pst-node and use its psmatrix environment.
    – Bernard
    Oct 7, 2014 at 1:10

1 Answer 1

2

Rescale it to the linewidth of the document:

\begin{document}
\noindent
\resizebox{\linewidth}{!}{%
\psframebox*[fillstyle=solid,fillcolor=black!10,framesep=10pt]{%
\begin{pspicture}(0,-7.8)(19.2,7.8)
\psframe[linewidth=0.04, dimen=outer](14.8,7.8)(9.2,5.8)
\rput[l](10.0,7.0){\tabular{@{}ll@{}} 
  \rlap{Input:}\\
  \textbullet & Load geo.xyz\\
  \textbullet & Load basis-set, charge,  SM\endtabular}
\psframe[linewidth=0.04, dimen=outer](6.4,4.6)(0.0,2.6)
\rput[l](0.8,3.8){\tabular{@{}ll@{}} 
  \rlap{Initial guess for orbitals}\\
  \textbullet & Core Hamiltonian (OK)\\
  \textbullet & Huckel Hamiltonian (No)\endtabular}
\psline[style=aline]{->}(9.2,6.6)(3.2,6.6)(3.2,4.6)
\psframe[linewidth=0.04, dimen=outer](14.8,4.6)(9.2,2.6)
\rput[bl](10.0,3.8){Compute the Fock}
\rput[bl](10.0,3.4){Matrix}
\psline[style=aline](12.0,5.8)(12.0,4.6)
\psline[style=aline](6.4,3.8)(9.2,3.8)
\psframe[linewidth=0.04, dimen=outer](14.8,1.4)(9.2,-3.4)
\rput[bl](9.6,0.6){Solve Eigen-system:}
\rput[bl](10.0,-0.2){RHF}
\rput[bl](10.0,-1.8){UHF}
\psline[style=aline](12.0,2.6)(12.0,1.4)
\psdiamond[linewidth=0.04, dimen=outer](12.0,-6.2)(2.8,0.8)
\rput[bl](10.8,-6.2){SCF converged?}
\psline[style=aline](12.0,-3.4)(12.0,-5.4)
\psframe[linewidth=0.04, dimen=outer](19.2,0.6)(15.6,-2.6)
\rput[bl](16.0,-0.2){Updates}
\psdots[dotsize=0.08](16.4,-1.0)
\rput[bl](16.8,-1.0){Orbitals}
\psdots[dotsize=0.08](16.4,-2.2)
\rput[bl](16.8,-2.2){Charge density}
\psline[style=aline](14.8,-6.2)(17.6,-6.2)(17.6,-2.6)
\psline[style=aline](17.6,0.6)(17.6,3.8)(14.8,3.8)
\rput[bl](16.0,-6.2){No}
\psframe[linewidth=0.04, dimen=outer](6.4,-4.2)(0.0,-7.8)
\rput[bl](0.4,-5.0){Get Post-Hartree-Fock start-up:}
\psline[style=aline](9.2,-6.2)(6.4,-6.2)
\rput[bl](7.6,-6.2){Yes}
\end{pspicture}%
}}
\end{document}  

enter image description here

However, PSTricks also knows \psTextFrame which makes live easier ...

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.