发布时间:2011-12-23 08:54:41
文章类别:TeX绘图
原文地址:http://blog.sina.com.cn/s/blog_5e16f1770102e77g.html
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载
前文,我转载了pstricks绘制树图,实际,流程图也是类似的,通常我们的流程图要画的比较有创意,而且会希望每个节点能有些好的效果。这里给大家推介一个好用的package地址在http://texnik.dante.de/tex/generic/pstricks-add/ texlive/2011/texmf-local/tex/generic/pstricks-add/pstricks-add.tex
文件,或者就放在自己编码的文件目录下也可。
我们可以利用已有的命令绘制出精致的流程图:
实现代码如下:
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{pst-blur}
\usepackage{pstricks-add}
\definecolor{Blue}{rgb}{1.,0.75,0.8}
\pagestyle{empty}
\begin{document}
\psset{shadowcolor=black!70,shadowangle=-90,blur,shortput=nab}
\begin{psmatrix}[rowsep=0.7,colsep=0.7]
\psovalbox[fillstyle=solid, fillcolor=yellow!30,shadow=true]{Start} \\
\psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow]{Input r} \\
\psdiabox[fillstyle=solid, fillcolor=magenta!20,shadow=true]{$ r > 0 $} &
\psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow=true]{Print m, d, s} \\
\psframebox[shadow=true]{$ d=2*r $} &
\psovalbox[fillstyle=solid, fillcolor=yellow!30,shadow=true]{End}\\
\psframebox[shadow=true]{$ m=2*\pi*r $} \\
\psframebox[shadow=true]{$ s=\pi*r*r $} \\
\psparallelogrambox[fillstyle=solid,fillcolor=blue!20, shadow=true]{Print Sum}
\end{psmatrix}
\ncline{->}{1,1}{2,1}\ncline{->}{2,1}{3,1}
\ncline{->}{3,1}{4,1}_{\textcolor{red}{Yes}}
\ncline{->}{4,1}{5,1}\ncline{->}{5,1}{6,1}
\ncline{->}{6,1}{7,1}
\ncline{->}{3,1}{3,2}^{\textcolor{red}{No}}
\ncline{->}{3,2}{4,2}
\ncangles[angleA=-90,angleB=180,armA=0.5cm,armB=0.7cm]{->}{7,1}{3,1}
\end{document}
选自:http://tex.stackexchange.com/questions/38890/modifying-nodes-in-a-flowchart-with-psmatrix-enviroment
发表评论 取消回复