| 1 |
\documentclass{ltxguide} |
| 2 |
\usepackage{txfonts,url} |
| 3 |
\usepackage[shell,debug]% |
| 4 |
{pdftricks} |
| 5 |
|
| 6 |
\begin{psinputs} |
| 7 |
\usepackage{txfonts} |
| 8 |
\usepackage{pstricks} |
| 9 |
\usepackage{color} |
| 10 |
\usepackage{pstcol} |
| 11 |
\usepackage{pst-plot} |
| 12 |
\usepackage{pst-tree} |
| 13 |
\usepackage{pst-eps} |
| 14 |
\usepackage{multido} |
| 15 |
\usepackage{pst-node} |
| 16 |
\usepackage{pst-eps} |
| 17 |
\end{psinputs} |
| 18 |
|
| 19 |
% 1. run pdfLaTeX |
| 20 |
% 2. run script `pst2pdf' by invoking ./pst2pdf |
| 21 |
% 3. second run of pdfLaTeX |
| 22 |
|
| 23 |
\begin{document} |
| 24 |
|
| 25 |
%\NoProcess[1-6] |
| 26 |
|
| 27 |
|
| 28 |
\title{Trivial Experiments with psTricks manipulation} |
| 29 |
|
| 30 |
\author{\bfseries Radhakrishnan CV and Rajagopal |
| 31 |
CV\\[-3pt] |
| 32 |
\small River Valley Technologies, |
| 33 |
Trivandrum, India\\[-3pt] |
| 34 |
\small\url{http://www.river-valley.com}\\[6pt] |
| 35 |
\bfseries Antoine Chambert-Loir\\[-3pt] |
| 36 |
\small Ecole polytechnique, Palaiseau Cedex, |
| 37 |
France\\[-3pt] |
| 38 |
\small \url{http://www.math.polytechnique.fr/~chambert} |
| 39 |
} |
| 40 |
|
| 41 |
\maketitle |
| 42 |
|
| 43 |
\section{Objectives} |
| 44 |
|
| 45 |
|psTricks| macros cannot be used with pdf\TeX, since the high level |
| 46 |
PostScript language commands generated by the |psTricks| are unknown |
| 47 |
to pdf\TeX. As such, a package \emph{viz.}, |pdfTricks.sty| has been |
| 48 |
written to circumvent this limitation, so that the extensive |
| 49 |
facilities offered by the powerful |psTricks| package can be made use |
| 50 |
of in a pdf\TeX{} document. This is brought by making use of the shell |
| 51 |
escape function available in the |web2c| \TeX{} compiler, while this |
| 52 |
package is of no use to other commercial implementations. |
| 53 |
|
| 54 |
Shell escape provides us the facility of stopping a \TeX{} run midway, |
| 55 |
perform the functions that we do with a shell command, complete those |
| 56 |
functions, return to the \TeX{} run and finish the job. Within a |
| 57 |
package, this facility can be invoked by using |
| 58 |
|\write18{shell command}|. So if you use a line: |
| 59 |
\begin{decl} |
| 60 |
|write18 ls -l| |
| 61 |
\end{decl} |
| 62 |
\TeX{} will stop at the moment when it encounter the |\write18| |
| 63 |
command, escapes to shell, executes |ls -l| command and return to the |
| 64 |
compilation process. |
| 65 |
|
| 66 |
\section{Shell escape} |
| 67 |
|
| 68 |
In all the web2c \TeX{} implementations, shell escape is turned off by |
| 69 |
default. You can either turn it on by changing the line in your |
| 70 |
|texmf.cnf| (configuration file of your \TeX{} system) to: |
| 71 |
\begin{decl} |
| 72 |
|shell_escape = t| |
| 73 |
\end{decl} |
| 74 |
which will be `|f|' by default. You have to recreate all the formats |
| 75 |
like |pdflatex.fmt| or whatever you might need. This is not a wise |
| 76 |
step though, since it makes you open to the assault of Trojan macros |
| 77 |
without your knowledge. |
| 78 |
|
| 79 |
The more elegant way will be to invoke shell escape with a switch, |
| 80 |
each time you run the compiler like: |
| 81 |
\begin{decl} |
| 82 |
|pdflatex -shell-escape <file name>| |
| 83 |
\end{decl} |
| 84 |
This eliminates the vulnerability to macros/packages written by |
| 85 |
intelligent criminal minds. |
| 86 |
|
| 87 |
\section{Usage} |
| 88 |
|
| 89 |
The usage is very simple, as usual you have to load the package with a |
| 90 |
package loading line in the preamble of your document: |
| 91 |
|
| 92 |
\begin{decl} |
| 93 |
|\usepackage{pdftricks}| |
| 94 |
\end{decl} |
| 95 |
|
| 96 |
All the packages that are needed for the compilation of the |pstricks| |
| 97 |
code shall be enclosed within an environment |\begin{psinputs}| \dots |
| 98 |
|\end{psinputs}| in order to make it available to all the figure |
| 99 |
documents during compilation. An example of this will look like |
| 100 |
\begin{decl} |
| 101 |
|\begin{psinputs}|\\ |
| 102 |
| \usepackage{pstricks}|\\ |
| 103 |
| \usepackage{color} |\\ |
| 104 |
| \usepackage{pstcol} |\\ |
| 105 |
| \usepackage{pst-plot}|\\ |
| 106 |
| \usepackage{pst-tree}|\\ |
| 107 |
| \usepackage{pst-eps} |\\ |
| 108 |
| \usepackage{multido} |\\ |
| 109 |
| \usepackage{pst-node}|\\ |
| 110 |
| \usepackage{pst-eps} |\\ |
| 111 |
| ... |\\ |
| 112 |
|\end{psinputs}| |
| 113 |
\end{decl} |
| 114 |
|
| 115 |
Each |pspicture| environment along with any macro code shall be |
| 116 |
enclosed within an environment \emph{viz.}, |pdfpic|. This will enable |
| 117 |
pdf\LaTeX{} to write external files like |fig1.tex|, |fig2.tex|, |
| 118 |
\dots, depending on the number of |psTricks| figures you have included |
| 119 |
in your document. |pdftricks| will intelligently find out whether your |
| 120 |
pdf\TeX{} implementation has shell escape facility enabled or not. |
| 121 |
Depending on this, there are two ways of approaching the problem which |
| 122 |
are given in the succeeding sections. |
| 123 |
|
| 124 |
\subsection{With shell escape} |
| 125 |
|
| 126 |
With shell escape option invoked, one need not bother anything. The |
| 127 |
usual compilation with pdf\LaTeX{} will result in a |pdf| document |
| 128 |
with all the figures appearing in the correct positions. pdf\TeX{} |
| 129 |
will do the necessary job of writing all the |pstricks| code to self |
| 130 |
standing external |*.tex| documents, escapes to shell, compiles the |
| 131 |
|*.tex| document, converts to |*.eps|, translates to |*.pdf| and |
| 132 |
includes in the location where the |pstricks| code appeared. |
| 133 |
|
| 134 |
\subsection{Without shell escape} |
| 135 |
|
| 136 |
A special shell script viz., |pst2pdf| is also provided. Now as the |
| 137 |
second step, you have to execute this shell script, |pst2pdf| which |
| 138 |
will compile all the newly written |fig1.tex|,\dots, and respective |
| 139 |
|*.dvi| will be generated, which will be translated into respective |
| 140 |
|*.eps| files and finally translated to |*.pdf| by calling |epstopdf|. |
| 141 |
As a final step, you shall run pdf\LaTeX{} again, so that the |*.pdf| |
| 142 |
figures will be included with the usual |\includegraphics| command |
| 143 |
automatically in the locations wherever the |pstricks| code appeared. |
| 144 |
|
| 145 |
|
| 146 |
See an example below: |
| 147 |
\begin{verbatim} |
| 148 |
\begin{pdfdisplay} |
| 149 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 150 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 151 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 152 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 153 |
\SpecialCoor |
| 154 |
\begin{pspicture}(-6,-6)(6,6) |
| 155 |
\psaxes{<<->>}(0,0)(-6,-6)(6,6) |
| 156 |
\psset{arrows=->>} |
| 157 |
\multido{\ia=-5+1}{11}{% |
| 158 |
\multido{\ib=-5+1}{11}{% |
| 159 |
\pstVerb{/x \ia\space def |
| 160 |
/y \ib\space def |
| 161 |
y 0 eq |
| 162 |
{/ValueTempA 0 def |
| 163 |
/ValueTempB 0.5 def} |
| 164 |
{/ValueTempZ 2 1 x x mul y y mul div add sqrt mul def |
| 165 |
/ValueTempA 1 ValueTempZ div def |
| 166 |
/ValueTempB x y ValueTempZ mul div def} |
| 167 |
ifelse} |
| 168 |
\psline(! x ValueTempA sub y ValueTempB sub) |
| 169 |
(! x ValueTempA add y ValueTempB add)}} |
| 170 |
\end{pspicture} |
| 171 |
\end{pdfdisplay} |
| 172 |
\end{verbatim} |
| 173 |
|
| 174 |
This |psTricks| code will result in the following graphic: |
| 175 |
\configure[pdfgraphic][color=red,rulesep=12pt, |
| 176 |
linecolor=gray30, |
| 177 |
linewidth=2pt] |
| 178 |
\begin{pdfdisplay} |
| 179 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 180 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 181 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 182 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 183 |
\def\transl#1#2{#1\space 72 2.54 div mul #2\space 72 2.54 div |
| 184 |
mul translate 0 0 moveto } |
| 185 |
\newif\ifnotbothz |
| 186 |
\pspicture(-6,-6)(6,6) |
| 187 |
\psaxes{<->}(0,0)(-6,-6)(6,6) |
| 188 |
\multido{\n=-5+1}{11}{% |
| 189 |
\multido{\N=-5+1}{11}{% |
| 190 |
\notbothztrue% |
| 191 |
\ifnum\N=0 % |
| 192 |
\ifnum\n=0 \notbothzfalse\fi% |
| 193 |
\fi% |
| 194 |
\ifnotbothz% |
| 195 |
\psdot(0,0)% |
| 196 |
\pstverb{\transl{\n}{\N}\space |
| 197 |
\n\space neg \N\space |
| 198 |
atan rotate -9 0 moveto 18 0 rlineto stroke } |
| 199 |
\fi}} |
| 200 |
\endpspicture |
| 201 |
\end{pdfdisplay} |
| 202 |
|
| 203 |
The following are the steps in the sequential order: |
| 204 |
\begin{decl} |
| 205 |
1.~|latex <your document>|\\ |
| 206 |
2.~|pst2pdf|\\ |
| 207 |
3.~|latex <your document>| |
| 208 |
\end{decl} |
| 209 |
|
| 210 |
\section{Options and Hooks} |
| 211 |
|
| 212 |
\begin{description} |
| 213 |
|
| 214 |
\item[|shell|] This option will invoke the shell escape functions. |
| 215 |
|
| 216 |
\item[|noshell|] This option will suppress the shell escape functions |
| 217 |
and will assume that there is no shell escape facility. |
| 218 |
|
| 219 |
\item[|NoProcess|] A new command |\NoProcess| has been introduced in |
| 220 |
this version to facilitate the suppressing of pdf generation of |
| 221 |
those figures whose pdf's are already available. This might prove |
| 222 |
helpful when you have more figures to process and many of them are |
| 223 |
perfected and don't need recompilation and translation everytime you |
| 224 |
run pdf\LaTeX. The usage is: |
| 225 |
\begin{decl} |
| 226 |
|\NoProcess{<comma separated and/or hyphen separated ranges>}| |
| 227 |
\end{decl} |
| 228 |
If you have ten figures and if you want to suppress the processing of |
| 229 |
the figure numbers 1, 2, 4 to 8 you can issue the command at the top |
| 230 |
of the document as: |
| 231 |
\begin{decl} |
| 232 |
|\NoProcess{1,2,4-8}| |
| 233 |
\end{decl} |
| 234 |
\end{description} |
| 235 |
|
| 236 |
\noindent There are few hooks to resize the graphic thus translated and |
| 237 |
included. |
| 238 |
\begin{decl} |
| 239 |
|\configure[pdfgraphic][width=2in]|\\ |
| 240 |
|\configure[pdfgraphic][height=3in]|\\ |
| 241 |
|\configure[pdfgraphic][width=2in,height=3in]| |
| 242 |
\end{decl} |
| 243 |
the functionality is same as the |width| and |height| options as in |
| 244 |
the |\includegraphics| command. But the graphic will be restricted to |
| 245 |
aspect ratio. |
| 246 |
|
| 247 |
\section{Limitations/Dependencies} |
| 248 |
|
| 249 |
\begin{itemize} |
| 250 |
\item Usage is limited to |web2c| \TeX{} implementations. |
| 251 |
\item The shell escape commands used in this package are typical |
| 252 |
\textsc{Unix} commands and as such it best works in |
| 253 |
\textsc{Linux/Unix} flavours. |
| 254 |
\item The package needs, |graphicx| and |keyval| packages; |epstopdf|, |
| 255 |
the Perl script that translates |eps| files into |pdf|. |
| 256 |
\end{itemize} |
| 257 |
|
| 258 |
\section{Licence} |
| 259 |
The package is distributed under \textsc{gnu} General Public Licence. |
| 260 |
|
| 261 |
\section{Examples} |
| 262 |
|
| 263 |
Here are some examples of pstricks code and the figures generated by |
| 264 |
pdf\LaTeX. |
| 265 |
\subsection{Example 1} |
| 266 |
\begin{verbatim} |
| 267 |
\configure[pdfgraphic][width=2in,linecolor=red,background=gray10] |
| 268 |
\begin{pdfdisplay} |
| 269 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 270 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 271 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 272 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 273 |
\SpecialCoor |
| 274 |
\begin{pspicture}(-6,-6)(6,6) |
| 275 |
\psaxes{<<->>}(0,0)(-6,-6)(6,6) |
| 276 |
\psset{arrows=->>} |
| 277 |
\multido{\ia=-5+1}{11}{% |
| 278 |
\multido{\ib=-5+1}{11}{% |
| 279 |
\pstVerb{/x \ia\space def |
| 280 |
/y \ib\space def |
| 281 |
y 0 eq |
| 282 |
{/ValueTempA 0 def |
| 283 |
/ValueTempB 0.5 def} |
| 284 |
{/ValueTempZ 2 1 x x mul y y mul div add sqrt mul def |
| 285 |
/ValueTempA 1 ValueTempZ div def |
| 286 |
/ValueTempB x y ValueTempZ mul div def} |
| 287 |
ifelse} |
| 288 |
\psline(! x ValueTempA sub y ValueTempB sub) |
| 289 |
(! x ValueTempA add y ValueTempB add)}} |
| 290 |
\end{pspicture} |
| 291 |
\end{pdfdisplay} |
| 292 |
\end{verbatim} |
| 293 |
\configure[pdfgraphic][width=.9\linewidth,linecolor=red, |
| 294 |
rulesep=12pt,background=gray10, |
| 295 |
linewidth=2pt] |
| 296 |
\begin{pdfdisplay} |
| 297 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 298 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 299 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 300 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 301 |
\SpecialCoor |
| 302 |
\begin{pspicture}(-6,-6)(6,6) |
| 303 |
\psaxes{<->}(0,0)(-6,-6)(6,6) |
| 304 |
\psset{arrows=->} |
| 305 |
\multido{\ia=-5+1}{11}{% |
| 306 |
\multido{\ib=-5+1}{11}{% |
| 307 |
\pstVerb{/x \ia\space def |
| 308 |
/y \ib\space def |
| 309 |
y 0 eq |
| 310 |
{/ValueTempA 0 def |
| 311 |
/ValueTempB 0.5 def} |
| 312 |
{/ValueTempZ 2 1 x x mul y y mul div add sqrt mul def |
| 313 |
/ValueTempA 1 ValueTempZ div def |
| 314 |
/ValueTempB x y ValueTempZ mul div def} |
| 315 |
ifelse} |
| 316 |
\psline(! x ValueTempA sub y ValueTempB sub) |
| 317 |
(! x ValueTempA add y ValueTempB add)}} |
| 318 |
\end{pspicture} |
| 319 |
\end{pdfdisplay} |
| 320 |
|
| 321 |
\subsection{Example 2} |
| 322 |
\begin{verbatim} |
| 323 |
\configure[pdfgraphic][linecolor=blue,background=gray10,width=4in] |
| 324 |
\begin{pdfdisplay} |
| 325 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 326 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 327 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 328 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 329 |
\newcommand{\MyNode}[2]{% |
| 330 |
\Tr{\psshadowbox[fillstyle=solid,fillcolor=#1]{\tiny #2}}} |
| 331 |
\newcommand{\NoeudXt}[1]{\MyNode{ForestGreen}{#1}} |
| 332 |
\newcommand{\NoeudMotif}[1]{\MyNode{Navy}{\textcolor{white}{#1}}} |
| 333 |
\psset{armB=5mm,angleA=90,angleB=-90,levelsep=2cm,treesep=5mm} |
| 334 |
\renewcommand{\psedge}[2]{\ncangle{#2}{#1}} |
| 335 |
\TeXtoEPS |
| 336 |
\begin{pspicture}(-8cm,-9.5cm)(8cm,1cm) |
| 337 |
\rput(0,0){\LARGE\textcolor{red}{Set of Motif widgets classes}} |
| 338 |
\rput(0,-4.8){% |
| 339 |
\psframebox[fillstyle=solid,fillcolor=LemonChiffon,linearc=5mm, |
| 340 |
cornersize=absolute] |
| 341 |
{\pstree{\NoeudXt{Core}} |
| 342 |
{\pstree{\NoeudMotif{Primitive}} |
| 343 |
{\pstree{\NoeudMotif{Label}} |
| 344 |
{\TC*} |
| 345 |
\NoeudMotif{Scrollbar} |
| 346 |
\NoeudMotif{List} |
| 347 |
\NoeudMotif{Text} |
| 348 |
\NoeudMotif{ArrowButton}} |
| 349 |
\pstree{\NoeudXt{Composite}} |
| 350 |
{\pstree{\NoeudXt{Constraint}} |
| 351 |
{\pstree{\NoeudMotif{Manager}} |
| 352 |
{\TC*}}} |
| 353 |
\pstree{\NoeudXt{Shell}} |
| 354 |
{\pstree{\NoeudXt{OverrideShell}} |
| 355 |
{\NoeudMotif{MenuShell}} |
| 356 |
\pstree{\NoeudXt{WMShell}} |
| 357 |
{\pstree{\NoeudXt{VendorShell}} |
| 358 |
{\TC*}}}}}} |
| 359 |
\rput(-2,-10){% |
| 360 |
\psshadowbox[fillstyle=solid,fillcolor=ForestGreen]{Core} Xt Class} |
| 361 |
\rput(2,-10){% |
| 362 |
\psshadowbox[fillstyle=solid,fillcolor=Navy]{% |
| 363 |
\textcolor{white}{List}} Motif Class} |
| 364 |
\end{pspicture} |
| 365 |
\endTeXtoEPS |
| 366 |
\end{pdfdisplay} |
| 367 |
\end{verbatim} |
| 368 |
\configure[pdfgraphic][linecolor=blue, |
| 369 |
linewidth=2pt, rulesep=6pt, |
| 370 |
background=gray10,scale=.8] |
| 371 |
\begin{pdfdisplay} |
| 372 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 373 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 374 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 375 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 376 |
\newcommand{\MyNode}[2]{% |
| 377 |
\Tr{\psshadowbox[fillstyle=solid,fillcolor=#1]{\tiny #2}}} |
| 378 |
\newcommand{\NoeudXt}[1]{\MyNode{ForestGreen}{#1}} |
| 379 |
\newcommand{\NoeudMotif}[1]{\MyNode{Navy}{\textcolor{white}{#1}}} |
| 380 |
\psset{armB=5mm,angleA=90,angleB=-90,levelsep=2cm,treesep=5mm} |
| 381 |
\renewcommand{\psedge}[2]{\ncangle{#2}{#1}} |
| 382 |
\TeXtoEPS |
| 383 |
\begin{pspicture}(-8cm,-9.5cm)(8cm,1cm) |
| 384 |
\rput(0,0){\LARGE\textcolor{red}{Set of Motif widgets classes}} |
| 385 |
\rput(0,-4.8){% |
| 386 |
\psframebox[fillstyle=solid,fillcolor=LemonChiffon,linearc=5mm, |
| 387 |
cornersize=absolute] |
| 388 |
{\pstree{\NoeudXt{Core}} |
| 389 |
{\pstree{\NoeudMotif{Primitive}} |
| 390 |
{\pstree{\NoeudMotif{Label}} |
| 391 |
{\TC*} |
| 392 |
\NoeudMotif{Scrollbar} |
| 393 |
\NoeudMotif{List} |
| 394 |
\NoeudMotif{Text} |
| 395 |
\NoeudMotif{ArrowButton}} |
| 396 |
\pstree{\NoeudXt{Composite}} |
| 397 |
{\pstree{\NoeudXt{Constraint}} |
| 398 |
{\pstree{\NoeudMotif{Manager}} |
| 399 |
{\TC*}}} |
| 400 |
\pstree{\NoeudXt{Shell}} |
| 401 |
{\pstree{\NoeudXt{OverrideShell}} |
| 402 |
{\NoeudMotif{MenuShell}} |
| 403 |
\pstree{\NoeudXt{WMShell}} |
| 404 |
{\pstree{\NoeudXt{VendorShell}} |
| 405 |
{\TC*}}}}}} |
| 406 |
\rput(-2,-10){% |
| 407 |
\psshadowbox[fillstyle=solid,fillcolor=ForestGreen]{Core} Xt Class} |
| 408 |
\rput(2,-10){% |
| 409 |
\psshadowbox[fillstyle=solid,fillcolor=Navy]{% |
| 410 |
\textcolor{white}{List}} Motif Class} |
| 411 |
\end{pspicture} |
| 412 |
\endTeXtoEPS |
| 413 |
\end{pdfdisplay} |
| 414 |
|
| 415 |
\subsection{Example 3} |
| 416 |
\begin{verbatim} |
| 417 |
\configure[pdfgraphic][linecolor=black,background=gray30] |
| 418 |
\begin{pdfdisplay} |
| 419 |
\TeXtoEPS |
| 420 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 421 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 422 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 423 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 424 |
\psset{unit=.825cm} |
| 425 |
\begin{pspicture}(10,8) |
| 426 |
\psset{fillstyle=solid,linestyle=none,linewidth=0} |
| 427 |
\psframe[fillcolor=lightblue](10,8) |
| 428 |
\pscircle[fillcolor=yellow](2,6){.8} % Sun |
| 429 |
{% Rays |
| 430 |
\psset{linecolor=yellow,linestyle=solid,linewidth=.3} |
| 431 |
\degrees[8] |
| 432 |
\multido{\i=1+1}{8}{\rput{\i}(2,6){\psline(1,0)(1.5,0)}} |
| 433 |
}% |
| 434 |
\pspolygon[fillcolor=green](6,0)(10,2)(10,0)% Grass |
| 435 |
\psdiamond[fillcolor=red,gangle=-45](8,6)(1.5,2.5)% Kite |
| 436 |
\rput{45}(8,6){\pnode(-2.5,0){Kitetail}} |
| 437 |
\rput{-10}(.8,1.5){\psdiamond[fillcolor=yellow](.6,.1)(.6,.3)} |
| 438 |
\rput{-80}(.8,1.5){\psdiamond[fillcolor=yellow](.6,.1)(.6,.3)} |
| 439 |
\pnode(.8,1.5){Tailend} |
| 440 |
\nccurve[fillstyle=none,angleA=270,angleB=125,ncurvB=.9,ncurvA=1.4, |
| 441 |
linestyle=dotted,dotstyle=square,linewidth=.25]{Kitetail}{Tailend} |
| 442 |
\newcommand{\bunting}{\pstriangle(.35,.35)} |
| 443 |
\psset{fillcolor=red,labelsep=.01} |
| 444 |
\naput[nrot=115,npos=.15]{\bunting} |
| 445 |
\nbput[nrot=25,npos=.15]{\bunting} |
| 446 |
\naput[nrot=75,npos=.4]{\bunting} |
| 447 |
\nbput[nrot=115,npos=.4]{\bunting} |
| 448 |
\naput[nrot=115,npos=.7]{\bunting} |
| 449 |
\nbput[nrot=25,npos=.7]{\bunting} |
| 450 |
\end{pspicture} |
| 451 |
\endTeXtoEPS |
| 452 |
\end{pdfdisplay} |
| 453 |
\end{verbatim} |
| 454 |
|
| 455 |
\configure[pdfgraphic][width=\linewidth, |
| 456 |
linewidth=2pt, |
| 457 |
linecolor=gray30, |
| 458 |
background=gray10, |
| 459 |
rulesep=6pt] |
| 460 |
\begin{pdfdisplay} |
| 461 |
\TeXtoEPS |
| 462 |
\definecolor{lightblue}{rgb}{0,0,.5} |
| 463 |
\definecolor{Navy}{rgb}{0,0,0.5} |
| 464 |
\definecolor{LemonChiffon}{rgb}{1,0.98,0.8} |
| 465 |
\definecolor{ForestGreen}{rgb}{0.13,0.55,0.13} |
| 466 |
\psset{unit=.825cm} |
| 467 |
\begin{pspicture}(10,8) |
| 468 |
\psset{fillstyle=solid,linestyle=none,linewidth=0} |
| 469 |
\psframe[fillcolor=lightblue](10,8) |
| 470 |
\pscircle[fillcolor=yellow](2,6){.8} % Sun |
| 471 |
{% Rays |
| 472 |
\psset{linecolor=yellow,linestyle=solid,linewidth=.3} |
| 473 |
\degrees[8] |
| 474 |
\multido{\i=1+1}{8}{\rput{\i}(2,6){\psline(1,0)(1.5,0)}} |
| 475 |
}% |
| 476 |
\pspolygon[fillcolor=green](6,0)(10,2)(10,0)% Grass |
| 477 |
\psdiamond[fillcolor=red,gangle=-45](8,6)(1.5,2.5)% Kite |
| 478 |
\rput{45}(8,6){\pnode(-2.5,0){Kitetail}} |
| 479 |
\rput{-10}(.8,1.5){\psdiamond[fillcolor=yellow](.6,.1)(.6,.3)} |
| 480 |
\rput{-80}(.8,1.5){\psdiamond[fillcolor=yellow](.6,.1)(.6,.3)} |
| 481 |
\pnode(.8,1.5){Tailend} |
| 482 |
\nccurve[fillstyle=none,angleA=270,angleB=125,ncurvB=.9,ncurvA=1.4, |
| 483 |
linestyle=dotted,dotstyle=square,linewidth=.25]{Kitetail}{Tailend} |
| 484 |
\newcommand{\bunting}{\pstriangle(.35,.35)} |
| 485 |
\psset{fillcolor=red,labelsep=.01} |
| 486 |
\naput[nrot=115,npos=.15]{\bunting} |
| 487 |
\nbput[nrot=25,npos=.15]{\bunting} |
| 488 |
\naput[nrot=75,npos=.4]{\bunting} |
| 489 |
\nbput[nrot=115,npos=.4]{\bunting} |
| 490 |
\naput[nrot=115,npos=.7]{\bunting} |
| 491 |
\nbput[nrot=25,npos=.7]{\bunting} |
| 492 |
\end{pspicture} |
| 493 |
\endTeXtoEPS |
| 494 |
\end{pdfdisplay} |
| 495 |
|
| 496 |
\configure[pdfgraphic][width=\linewidth, |
| 497 |
linewidth=2pt, |
| 498 |
linecolor=gray30, |
| 499 |
background=gray10, |
| 500 |
rulesep=12pt] |
| 501 |
|
| 502 |
\begin{pdfdisplay} |
| 503 |
|
| 504 |
\definecolor{Pink}{rgb}{1.,0.75,0.8} |
| 505 |
% Flow diagram with the psmatrix environment\\[5mm] |
| 506 |
|
| 507 |
\psframebox[linearc=5mm,cornersize=absolute]{% |
| 508 |
\begin{psmatrix}[rowsep=0.5cm,colsep=0.8cm] |
| 509 |
\psovalbox[fillstyle=solid,fillcolor=yellow]{Begin} \\ |
| 510 |
\psframebox{Initialisations} \\ |
| 511 |
\psdiabox[fillstyle=solid,fillcolor=Pink]{Special} & |
| 512 |
\psframebox{Call to SP1} & \psframebox{Call to SP2} \\ |
| 513 |
\psframebox{Action 1} \\ |
| 514 |
\psframebox{Action 2} \\ |
| 515 |
\psovalbox[fillstyle=solid,fillcolor=yellow]{End} |
| 516 |
% Links |
| 517 |
\ncline{1,1}{2,1} |
| 518 |
\ncline{2,1}{3,1} |
| 519 |
\ncline{3,1}{4,1}<{\textcolor{red}{No}} |
| 520 |
\ncline{4,1}{5,1} |
| 521 |
\ncline{5,1}{6,1} |
| 522 |
\ncline{->}{3,1}{3,2}^{\textcolor{red}{Yes}} |
| 523 |
\ncline{->}{3,2}{3,3} |
| 524 |
\ncbar[angleA=-90,armB=0,nodesepB=2.5mm]{->}{3,3}{4,1} |
| 525 |
\end{psmatrix}} |
| 526 |
\end{pdfdisplay} |
| 527 |
|
| 528 |
\begin{verbatim} |
| 529 |
\begin{pdfdisplay} |
| 530 |
|
| 531 |
\definecolor{Pink}{rgb}{1.,0.75,0.8} |
| 532 |
% Flow diagram with the psmatrix environment\\[5mm] |
| 533 |
|
| 534 |
\psframebox[linearc=5mm,cornersize=absolute]{% |
| 535 |
\begin{psmatrix}[rowsep=0.5cm,colsep=0.8cm] |
| 536 |
\psovalbox[fillstyle=solid,fillcolor=yellow]{Begin} \\ |
| 537 |
\psframebox{Initialisations} \\ |
| 538 |
\psdiabox[fillstyle=solid,fillcolor=Pink]{Special} & |
| 539 |
\psframebox{Call to SP1} & \psframebox{Call to SP2} \\ |
| 540 |
\psframebox{Action 1} \\ |
| 541 |
\psframebox{Action 2} \\ |
| 542 |
\psovalbox[fillstyle=solid,fillcolor=yellow]{End} |
| 543 |
% Links |
| 544 |
\ncline{1,1}{2,1} |
| 545 |
\ncline{2,1}{3,1} |
| 546 |
\ncline{3,1}{4,1}<{\textcolor{red}{No}} |
| 547 |
\ncline{4,1}{5,1} |
| 548 |
\ncline{5,1}{6,1} |
| 549 |
\ncline{->}{3,1}{3,2}^{\textcolor{red}{Yes}} |
| 550 |
\ncline{->}{3,2}{3,3} |
| 551 |
\ncbar[angleA=-90,armB=0,nodesepB=2.5mm]{->}{3,3}{4,1} |
| 552 |
\end{psmatrix}} |
| 553 |
\end{pdfdisplay} |
| 554 |
\end{verbatim} |
| 555 |
|
| 556 |
\end{document} |