\documentclass{article} \usepackage{pstricks} \begin{document} \rput(1,1){Hello,world} \end{document}
There are Some explanations on this example. "\rput(1,1){Hello,world}" draw text at position (1,1). The default coordinate Psstrick used is set up like this: the current point in Tex is used as the origin. The horizontal line through this point is the x-axes, and left is the positive direction. The vertical line through this point is the y-axes, and up direction is positive. The default unit is 1cm.
Save it as a file (for example, with file name Pstircks_hello_world.tex), then Tex compile it with "latex" command. To get a postscript file, "dvips" or other dvi to postscript program should be used. And to get a pdf file, a ps to pdf program is also needed. Note that dvi2pdf may not produce a correct pdf file.
At last the output file looks like this:
Fig.1 A simple Pstricks "Hello, world!" example |
Files Download: tex ps pdf
Now we come to a a little more complex "Hello, world" example.
\documentclass{article} \usepackage{pstricks} \begin{document} Pstricks Hello world! Pstricks Hello world! Hello,world! \rput(0,0){\color{red} Hello,world!} Hello,World! Pstricks Hello world! Pstricks Hello world! \end{document}
This tex file will produce a ps or pdf file like this:
Fig.2 An advanced Pstricks "Hello, world!" example |
Files Download: tex ps pdf
No comments:
Post a Comment