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

% The whole execution of \stepwise is encapsuled in a group to make all changes local. This affects also the setting
% of the page transition to dissolve in the last but one step. We set it again explicitly to make the last step appear
% with this page transition as well.

\pageTransitionDissolve

\endinput
%%
%% End of file `picpsexample.tex'.