| 1 |
%% |
| 2 |
%% This is file `picpsexample.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% texpower-doc.dtx (with options: `picpsexample') |
| 8 |
%% |
| 9 |
%% -------------------------------------------------------------- |
| 10 |
%% TeXPower bundle - dynamic online presentations with LaTeX |
| 11 |
%% Copyright (C) 1999-2004 Stephan Lehmke |
| 12 |
%% Copyright (C) 2003-2005 Hans Fredrik Nordhaug |
| 13 |
%% |
| 14 |
%% This program is free software; you can redistribute it and/or |
| 15 |
%% modify it under the terms of the GNU General Public License |
| 16 |
%% as published by the Free Software Foundation; either version 2 |
| 17 |
%% of the License, or (at your option) any later version. |
| 18 |
%% |
| 19 |
%% This program is distributed in the hope that it will be useful, |
| 20 |
%% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
%% GNU General Public License for more details. |
| 23 |
%% -------------------------------------------------------------- |
| 24 |
%% |
| 25 |
%% The list of all files belonging to the TeXPower bundle is |
| 26 |
%% given in the file `00readme.txt'. |
| 27 |
%% |
| 28 |
% |
| 29 |
% Code for the PSTricks picture example for the package texpower.sty. |
| 30 |
% |
| 31 |
% This file is input by others. Don't compile it separately. |
| 32 |
% |
| 33 |
%----------------------------------------------------------------------------------------------------------------- |
| 34 |
% |
| 35 |
% This has nothing to do with \stepwise, just setting up the picture... |
| 36 |
% |
| 37 |
\newcommand{\Block}[1] |
| 38 |
{% |
| 39 |
\begin{pspicture}(-4,-2)(4,2) |
| 40 |
\pspolygon(-4,0)(-2,2)(2,2)(4,0)(2,-2)(-2,-2) |
| 41 |
\rput(0,0){#1} |
| 42 |
\end{pspicture}% |
| 43 |
}% |
| 44 |
\ifthenelse{\boolean{TPcolor}} |
| 45 |
{\psset{unit=3mm,fillstyle=solid,fillcolor=highlightcolor,linecolor=textcolor}}% |
| 46 |
{\psset{unit=3mm}}% |
| 47 |
% |
| 48 |
% In the following picture, picture items are built incrementally. |
| 49 |
% |
| 50 |
% \parstepwise generates a sequence of slides, all alike. The only difference ist that on every slide, one more of the |
| 51 |
% \step commands occurring in the argument of \stepwise are `activated'. This way the stuff inside the argument of |
| 52 |
% \parstepwise is gone through `step by step'. (\parstepwise is a special case of \stepwise.) |
| 53 |
% |
| 54 |
\parstepwise |
| 55 |
{% |
| 56 |
\begin{center} |
| 57 |
\large |
| 58 |
\begin{pspicture}(-1,-13)(33,9) |
| 59 |
\rput(0,0){\rnode{x}{\fboxrule0pt\fbox{$x[t]$}}} |
| 60 |
\rput(32,0){\rnode{y}{\fboxrule0pt\fbox{$y(t)$}}} |
| 61 |
{% |
| 62 |
% The effect of the \step command is to `hide' its argument on the first slide of the sequence generated by |
| 63 |
% \stepwise and display it on all other slides of this sequence. The second \step command starts displaying on |
| 64 |
% the third slide and so on... |
| 65 |
% |
| 66 |
% Usually `hiding' means ignoring altogehter. For the following application however, the box displayed by |
| 67 |
% \step is used as an node in the picture. This means that instead of ignoring its argument, it's better if |
| 68 |
% \step displays an appropriate amount of blank space. |
| 69 |
% This behaviour (create blank space) is exhibited by the command \bstep. |
| 70 |
\rput(4,0){\rnode{V}{\bstep{\psframebox{\Large$V$}}}} |
| 71 |
\ncline{->}{x}{V} |
| 72 |
% |
| 73 |
% The command \rebstep allows both boxes to appear simultaneously. |
| 74 |
% |
| 75 |
\rput(28,0){\rnode{plus}{\rebstep{\psframebox{\Large$+$}}}} |
| 76 |
}% |
| 77 |
\ncline{->}{plus}{y} |
| 78 |
% By using \restep again, the two boxes defining the operators appear at the same time as the first block of the |
| 79 |
% diagram, which is produced by the following commands. |
| 80 |
\restep |
| 81 |
{% |
| 82 |
% We use \afterstep{\pageTransitionDissolve} to make this first step of the diagram appear with a fancy page |
| 83 |
% transition. We have to use \afterstep because the page transition setting would be undone by the group |
| 84 |
% closing contained in \end{pspicture}. |
| 85 |
\afterstep{\pageTransitionDissolve}% |
| 86 |
\rput(16,0){\rnode{IBlk}{\Block{I-Block}}} |
| 87 |
\ncline{->}{V}{IBlk} |
| 88 |
\Aput{$x[t]$} |
| 89 |
\ncline{->}{IBlk}{plus} |
| 90 |
\Aput |
| 91 |
{% |
| 92 |
% |
| 93 |
% Here, one use of \step is nested inside the other. |
| 94 |
$% |
| 95 |
% Note how the math spacing is corrected manually by adding {} after \cdot. Otherwise, \cdot wouldn't be |
| 96 |
% aware that something is following and act as a postfix (instead of infix) operator. |
| 97 |
% \afterstep is used again to reset the page transition to Replace for the building of the formula. |
| 98 |
\bstep{\afterstep{\pageTransitionReplace}{}b\cdot{}}% |
| 99 |
\bstep{\int\limits^t_0 x(\tau)\,d\tau}% |
| 100 |
$% |
| 101 |
}% |
| 102 |
}% |
| 103 |
\step |
| 104 |
{% |
| 105 |
\afterstep{\pageTransitionDissolve}% |
| 106 |
\rput(16,6){\rnode{PBlk}{\Block{P-Block}}} |
| 107 |
\ncangle[angleA=90,angleB=180,fillstyle=none]{->}{V}{PBlk} |
| 108 |
\Aput{$x(t)$} |
| 109 |
\ncangle[angleB=90,fillstyle=none]{->}{PBlk}{plus} |
| 110 |
\aput(.5){$a\cdot x(t)$} |
| 111 |
}% |
| 112 |
\step |
| 113 |
{% |
| 114 |
\rput(16,-6){\rnode{DBlk}{\Block{D-Block}}} |
| 115 |
\ncangle[angleA=-90,angleB=180,fillstyle=none]{->}{V}{DBlk} |
| 116 |
\Aput{$x(t)$} |
| 117 |
\ncangle[angleB=-90,fillstyle=none]{->}{DBlk}{plus} |
| 118 |
\aput(.5){$\displaystyle c\cdot \left(\frac{dx}{d\tau}\right)(t)$} |
| 119 |
} |
| 120 |
\end{pspicture}% |
| 121 |
\end{center} |
| 122 |
}% |
| 123 |
|
| 124 |
% The whole execution of \stepwise is encapsuled in a group to make all changes local. This affects also the setting |
| 125 |
% of the page transition to dissolve in the last but one step. We set it again explicitly to make the last step appear |
| 126 |
% with this page transition as well. |
| 127 |
|
| 128 |
\pageTransitionDissolve |
| 129 |
|
| 130 |
\endinput |
| 131 |
%% |
| 132 |
%% End of file `picpsexample.tex'. |