科技文图片的生成之PSTricks
来源:互联网 发布:mysql查询前10条记录 编辑:程序博客网 时间:2024/04/28 23:05
作为一个伪学者,偶尔写写文章是少不了的,稍微有点技术含量的文章又少不了图形。
今天以PSTricks 为例,讲解图片的生成方式。
PSTricks 指令(command) 通常是放在 pspicture 环境里面的
\begin{pspicture}(x0,y0)(x1,y1)% ...\end{pspicuture}
放在圆括号里面的(x0,y0)(x1,y1) 描述了一个长方形,这个长方形左下角的坐标在(x0,y0) , 右上角的坐标在(x1,y1), 下面的生成的图形不能越过这个长方形的范围。
如果(x0,y0), 不显式的指明,那么这个参数指原点,即(0,0)。
直线
如果要画一条直线,指令是这样的
\psline(x0,y0)(x1,y1)
如果要画一个向量(vector),我们只需加一个箭头
\psline{->}(x0,y0)(x1,y1)
下面给出一个完整的例子:
\documentclass{report}\usepackage{pstricks}\begin{document}\begin{pspicture}(25,25)\psline{->}(0,0)(3,5)\end{pspicture}\end{document}
将上面这些代码放在叫***.tex的文件里面,然后运行:
# xelatex trick.tex
最后生成的结果是这样的:
很多情况下,我们还需要对图形做一些解释,比如,标出上面图形的中点
上图的代码是这样的:
\documentclass{report}\usepackage{pstricks}\begin{document}\begin{pspicture}(25,25)\psline{->}(0,0)(2.5,2.5)(5,5)\pscircle[linewidth=2pt](2.5,2.5){0.05} % 这里画出一个小圆,所要放的位置为(2.5,2.5), 半径为0.05\rput{45}(2.4,2.7){midpoint} % rput 就是打印出文本,45 表示角度, (2.4,2.7)表示文本所要放的位置,{midpoint} 即为要显示的内容\end{pspicture}\end{document}
矩形
\psframe(x0,y0)(x1,y1)
\psfreame*(x0,y0)(x1,y1)
后一种搞法,是生成一个填充后的矩形,使用下面参数可以得到一个角比较圆的矩形
\psframe[framearc=0.2](x0,y0)(x1,y1)
流程图
\documentclass{article}\usepackage{pstricks}\usepackage{pst-node}\begin{document}\begin{pspicture}\rput(3cm,-8cm){\rnode{X}{\psframebox{Study}}} % Specifies that "Study" % is to be surrounded by a box % and placed at (3cm,-8cm) along % from the pencil to the % centre of "Study".\rput(7,-6.7){\ovalnode{Y}{Pass Test}} % Specifies that "Pass Test" % is to be surrounded by a % circular node and placed % at (7,-6.7) along from % pencil to the centre of % Pass Test.\nccurve[angleB=180]{->}{X}{Y} % Specifies that there is to % be a curve between X and Y % such that the curve touches % node Y at 180 degrees. The %{->} signifies that you % which to include an arrow.\lput*{0}{Yes} % Specifies to put "Yes" % within the line\end{pspicture}\end{document}
0 0
- 科技文图片的生成之PSTricks
- 用LaTeX的pstricks绘图宏包制作一幅图片
- Google图片新高科技之WebP介绍
- 奥运场馆的科技之辉
- 科技论文中图片的处理方法
- 科技论文中图片的处理方法
- 科技论文中图片的处理方法
- PYthon黑科技之透明通道隐藏图片
- PSTricks太爽了!
- install pstricks into texlive
- 那些不为人知的科技之父
- 科技巨头之间的生态系统之战
- 科技大佬的一些用人之道
- 中美科技的霸主之争
- swing生成图片之保存图片
- swing生成图片之打印图片
- xml图片的生成
- xml图片的生成
- hdu 5442 2015长春网络赛
- progressDemo
- EclipseProblems:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- linux命令之ip
- hdu 5438 Ponds 拓扑排序+并查集 2015 ACM/ICPC Asia Regional Changchun Online
- 科技文图片的生成之PSTricks
- AJAX调用接口实现静态页面局部动态化的简单例子
- iOS之block基础及传值
- c++prime
- 自定义函数和变量的引用传值
- 类库1
- 十分钟让你看懂「共享经济」到底是什么?
- [设计模式]_[中级]_[组合模式(Composite)分析与总结]
- iOS-NSString常见方法