Debian Codegraph @

texmf-dist/doc/xelatex/bidipresentation/sample.tex

raw
1 \documentclass[colorhighlight]{bidipresentation}
2 \usepackage{amsmath}
3 \usepackage{graphicx}
4 \definergbcolor{textcolor}{000000}%
5 \definergbcolor{inactivecolor}{B2B2B1}%
6 \usepackage{xepersian}
7 \settextfont{XB Niloofar}
8 \setlatintextfont{Times New Roman}
9 \begin{document}
10 \begin{rawslide}
11 \tableofcontents
12 \end{rawslide}
13 \begin{rawslide}
14 \section{لیست‌ها}
15 \begin{flipitem}
16 \item
17 این متنی کمی
18 \item
19 این متن طولانی است که بیشتر از یک سطر باشد تا ببینم مشکلی با رنگ وجود دارد یا خیر و ادامه متن که ادامه پیدا می‌کند در سطر بعدی
20 \item سه
21 \end{flipitem}
22 \begin{flipenum}
23 \item
24 این متنی کمی
25 \item
26 این متن طولانی است که بیشتر از یک سطر باشد تا ببینم مشکلی با رنگ وجود دارد یا خیر و ادامه متن که ادامه پیدا می‌کند در سطر بعدی
27 \item سه
28 \end{flipenum}
29 \end{rawslide}
30 \begin{rawslide}
31 \section{جدول}
32 \newcommand{\tabend}{\\\hline}%
33
34 \liststepwise{%
35 \begin{center}
36 \step{%
37 \begin{tabular}{|r|r|r|}
38 \hline
39 1 & 2 & 3%
40 \step{\\\hline 4\renewcommand{\tabend}{\\\cline{1-1}}}%
41 \step{& 5\renewcommand{\tabend}{\\\cline{1-2}}}%
42 \step{& 6\renewcommand{\tabend}{\\\hline}}%
43 \step
44 {%
45 \\\hline
46 %
47 % Again, \step's are nested inside each other...
48 %
49 \step{7}&\step{8}&\step{9}%
50 }%
51 \step{\\\hline اما\renewcommand{\tabend}{\\\cline{1-1}}}%
52 \step{&مواظب\renewcommand{\tabend}{\\\cline{1-2}}}%
53 \step{& متن بلند باشید!\renewcommand{\tabend}{\\\hline}}%
54 \tabend
55 \end{tabular}%
56 }%
57 \end{center}%
58 }%
59 \end{rawslide}
60 \begin{rawslide}
61 \section{فرمول چندخطی}
62 \liststepwise%
63 {%
64 %
65 % This is just for compressing the equations so they can be squeezed on one slide.
66 %
67 \fontsize{7.8pt}{9pt}\selectfont
68 \renewcommand{\arraystretch}{0}%
69 \setlength{\arraycolsep}{0pt}%
70 \setlength{\abovedisplayskip}{0pt}%
71 \setlength{\belowdisplayskip}{0pt}%
72 %
73 % \highlightboxed will be used for underlaying some formulas with color. To minimize overlap, the width of the outer
74 % frame is reduced.
75 \setlength{\highlightboxsep}{1pt}%
76 %
77 \begin{align*}
78 \lefteqn
79 {%
80 \min
81 \left(
82 % The nested braces are filled `from outer to inner'. This means nesting a lot of steps inside each other...
83 % The outermost brace is displayed from the outset.
84 % The first step (which follows right here) displays the next inner brace (the first argument of \min), filled
85 % with an almost `empty' array (apart from one comma and some dots).
86 % \bstep is used to get appropriate white space when the step is not yet active.
87 \bstep
88 {\max
89 \left(
90 \begin{array}{l}
91 % The next two steps fill in the lines of the array.
92 \bstep{\min\left(F'(x),\min\left(F_1(x),G_1(y)\right)\right)},\\[-2ex]
93 \vdots\\
94 \bstep{\min\left(F'(x),\min\left(F_n(x),G_n(y)\right)\right)}
95 \end{array}
96 \right)
97 },
98 % After the first brace is filled, the next step provides the second argument of \min.
99 \bstep{\min\left(G_i(y),H_i(z)\right)}
100 \right)
101 }
102 &
103 % The next couple of steps will create the remaining lines of the aligned equations. These need to be
104 % insubstantial (as is the default for \liststepwise), because & can't go in a box.
105 % As a consequence, the horizontal alignment cannot kick in until the last step is performed. This would make the
106 % alignment `flicker' sidewise.
107 % So we have to bite the bullet and duplicate the widest entry here (invisibly), so that the horizontal alignment
108 % is constant during all steps. *sigh*
109 \phantom
110 {%
111 {}=
112 \min
113 \left(
114 F'(x),
115 \min
116 \left(
117 \max
118 \left(
119 \begin{array}{l}
120 \min\left(F_1(x),\min\left(G_1(y),G_i(y)\right)\right),\\[-1.5ex]
121 \vdots\\[-.5ex]
122 \min\left(F_n(x),\min\left(G_n(y),G_i(y)\right)\right)
123 \end{array}
124 \right),
125 H_i(z)
126 \right)
127 \right)
128 }
129 % The next step displays two lines at a time, but incompletely, i.e. some parts are missing (which are inside
130 % nested calls of \bstep).
131 % This way, it is demonstrated how the arguments of the nested \min's are reordered.
132 \step
133 {%
134 \\
135 &=
136 \max
137 \left(
138 % The macro \activatestep is used by \stepwise to `wrap' the argument of a \bstep command at the _first_ time
139 % it appears.
140 % Usually, it does nothing. Now, we redefine it to highlight its background, so it is easier to spot the
141 % places where the additional arguments were inserted.
142 \let\activatestep\highlightboxed
143 \begin{array}{l}
144 \min
145 \left(
146 % The inner \bstep's display the missing arguments, which are completely identical in both lines.
147 % It is intended that all the missing arguments appear at the same time, so \rebstep is used for the
148 % remaining arguments which have been left out.
149 \min\left(\bstep{F'(x)},\min\left(\rebstep{F_1(x),G_1(y)}\right)\right),\min\left(G_i(y),H_i(z)\right)
150 \right),\\[-2ex]
151 \vdots\\[-1ex]
152 \min
153 \left(
154 \min\left(\rebstep{F'(x)},\min\left(\rebstep{F_n(x),G_n(y)}\right)\right),\min\left(G_i(y),H_i(z)\right)
155 \right)
156 \end{array}
157 \right)
158 \\
159 &=
160 \max
161 \left(
162 \let\activatestep\highlightboxed
163 \begin{array}{l}
164 \min
165 \left(
166 \min\left(
167 % Here are the remaining arguments of \min which are all to be displayed in one step (together with
168 % those from the previous line).
169 \rebstep{F'(x)},\min\left(\rebstep{F_1(x)},\min\left(\rebstep{G_1(y)},G_i(y)\right)\right)
170 \right),
171 H_i(z)
172 \right),\\[-2.5ex]
173 \vdots\\[-1.5ex]
174 \min
175 \left(
176 \min\left(
177 \rebstep{F'(x)},\min\left(\rebstep{F_n(x)},\min\left(\rebstep{G_n(y)},G_i(y)\right)\right)
178 \right),
179 H_i(z)
180 \right)
181 \end{array}
182 \right)
183 }
184 \step
185 {%
186 \\
187 &=
188 \min
189 \left(
190 F'(x),
191 \min
192 \left(
193 \max
194 \left(
195 \begin{array}{l}
196 \min\left(F_1(x),\min\left(G_1(y),G_i(y)\right)\right),\\[-1.5ex]
197 \vdots\\[-.5ex]
198 \min\left(F_n(x),\min\left(G_n(y),G_i(y)\right)\right)
199 \end{array}
200 \right),
201 H_i(z)
202 \right)
203 \right)
204 }
205 \end{align*}
206 }%
207 \end{rawslide}
208 \begin{rawslide}
209 \section{شکل}
210 \begin{LTR}
211 \begin{center}%
212 \stepwise
213 {%
214 \setlength{\unitlength}{.95cm}%
215 \delimitershortfall-1sp% Just for the nested braces
216 \begin{picture}(14,2)
217 \put(0,1){\vector(1,0){1}}
218 \put(0.5,0.5){\makebox(0,0){\small $x(t)$}}
219 \put(13,1){\vector(1,0){1}}
220 \put(13.5,0.5){\makebox(0,0){\small $y(t)$}}
221 \step
222 {
223 \put(1,1){\line(3,2){1.5}}
224 \put(1,1){\line(3,-2){1.5}}
225 \put(2.5,0){\line(0,1){2}}
226 \put(2,1){\makebox(0,0){\large $\varphi$}}
227 }
228 \step
229 {
230 \put(2.5,1){\vector(1,0){3.5}}
231 \put(4.25,0.5){\makebox(0,0){\small $F_t = \varphi\left(x(t)\right)$}}
232 }
233 \step
234 {
235 \put(6,0){\framebox(2,2){\large $\Phi$}}
236 }
237 \step
238 {
239 \put(8,1){\vector(1,0){3.5}}
240 %
241 % Here, we find another nested use of \step inside \step.
242 % \bstep is a variant of \step which _always_ puts its argument into a box for leaving the correct amount of
243 % white space. We cannot use \parstepwise here because \put can't go into a box. Hence, just using \step for
244 % building the nested formula on the next line would give the wrong size for the nested braces.
245 %
246 \put(9.75,0.5){\makebox(0,0){\small $G_t = \Phi\left(\bstep{\varphi\left(\bstep{x(t)}\right)}\right)$}}
247 }
248 \step
249 {
250 \put(13,1){\line(-3,2){1.5}}
251 \put(13,1){\line(-3,-2){1.5}}
252 \put(11.5,0){\line(0,1){2}}
253 \put(12,1){\makebox(0,0){\large $\delta$}}
254 }
255 \end{picture}%
256 }%
257 \end{center}%
258 \end{LTR}
259 \end{rawslide}
260 \begin{rawslide}
261 \section{پر کردن جای خالی}
262 \newcommand{\placeholder}[1]{\leavevmode\phantom{#1}\llap{\rule{\widthof{\phantom{#1}}}{\fboxrule}}}%
263 %
264 % We use the custom command \parstepwise which not only wraps the whole argument of \stepwise into a minipage (because
265 % otherwise vertical spacing goes haywire, don't ask me why), but also gives substance to steps.
266 %
267 % All variants of \stepwise take an optional argument the contents of which are executed inside a group before the
268 % inner loop of starts. It can be used to set parameters locally.
269 % Here, we redefine \activatestep (which has been explained in the equation example) to highlight the first
270 % appearance of any word.
271 % \hidestepcontents is used as a `wrapper' for those arguments of \step which should not appear yet. It either
272 % displays nothing (this is the default for \stepwise and \liststepwise) or puts its argument into a \phantom
273 % (the default for \parstepwise); this behaviour is also toggled by \boxedsteps and \nonboxedsteps.
274 % Here, we redefine it to use our selfdefined \placeholder to mark `missing' words.
275 %
276 \parstepwise[\let\hidestepcontents=\placeholder\let\activatestep=\highlightboxed]%
277 {%
278 \begin{quote}
279 \Huge ما می‌تونیم \step{جای خالی} را \step{پر کنیم}
280 %
281 % \step takes an optional argument with which it can be specified _when_ its argument is to appear. This is
282 % expressed in \ifthenelse syntax (see the documentation of the ifthen package).
283 % Here, we refer to the counter step which is advanced by \stepwise and contains the number of the current step.
284 % This way, steps can be made to appear in any order.
285 \step[\value{step}=5]{متن} که در ایجا
286 \step[\value{step}=4]{پر شده} و \step[\value{step}=3]{\textbf{هر}} ترتیبی داره!
287 \end{quote}
288 }%
289 \end{rawslide}
290 \begin{rawslide}
291 \section{نوشتن متن در جهت برعکس}
292 \newcounter{reversestepno}%
293 \newcommand{\backstep}{\step(\setcounter{reversestepno}{\value{totalsteps}-\value{stepcommand}+1}\ifthenelse{\value{step}=\value{reversestepno}})}%
294 %
295 % We use the custom command \parstepwise which not only wraps the whole argument of \stepwise into a minipage (because
296 % otherwise vertical spacing goes haywire, don't ask me why), but also gives substance to steps.
297 %
298 % If the following \stepwise command would only contain the calls to \backstep, everything would be fine.
299 % But we _had_ to add something else....
300 % In the second part of this application of \stepwise, several steps are executed simultaneously with those executed
301 % backwards in the first part. This means the value of the counter totalsteps is 14, i.e. the calls to \backstep
302 % correspond to steps 8...14. To remedy this, we decree that the first step performed shall be number 7, by setting
303 % the counter firststep accordingly in the optional argument of \stepwise.
304 %
305 \parstepwise[\setcounter{firststep}{\value{totalsteps}/2+\value{firststep}}]
306 {%
307 \begin{quote}
308 \Huge
309 \backstep{آیا} \backstep{الان} \backstep{می‌توان}
310 \backstep{متن را} \backstep{در جهت} \backstep{برعکس}
311 \backstep{نوشت\,!}
312
313 \bigskip
314
315 % By determining explicitly the times at which the following steps are executed, we make them appear
316 % simultaneously with the preceding flock of \backsteps. As we have set the counter firststep to 7, we start
317 % counting with 8.
318 %
319 \step[\value{step}=8]{\includegraphics[width=2cm]{fig-1}}
320 \step[\value{step}=9]{\includegraphics[width=2cm]{fig-1}}
321 \step[\value{step}=10]{\includegraphics[width=2cm]{fig-1}}
322 \step[\value{step}=11]{\includegraphics[width=2cm]{fig-1}}
323 \step[\value{step}=12]{\includegraphics[width=2cm]{fig-1}}
324 \step[\value{step}=13]{\includegraphics[width=2cm]{fig-1}}
325 \step[\value{step}=14]{\includegraphics[width=2cm]{fig-1}}%
326 \end{quote}
327 }%
328 \end{rawslide}
329 \end{document}