summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/presentations-en/04-18-2.ltxb
blob: 1b93cd19ded68aa7503e4fd4772c2c20b6501083 (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
%% 
%%  An UIT Edition example
%% 
%%  Example 04-18-2 on page 112.
%% 
%%  Copyright (C) 2012 Vo\ss 
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 

% Show page(s) 1,2,3,4,5,6

%% ==== 
\PassOptionsToClass{}{beamer}
\documentclass{exabeamer}
\usepackage{beramono}

%\StartShownPreambleCommands

%\StopShownPreambleCommands

\begin{document}
\begin{frame}[fragile]{Matrix operations}{Use of \texttt{semiverbatim}}
\setbeamercolor{alerted text}{fg=blue}
\setbeamerfont{alerted text}{series=\bfseries,family=\ttfamily}
\footnotesize\begin{semiverbatim}
\uncover<1->{\alert<0>{\alert<6>{sub \color{red}matrix_row2vector} \{}}
\uncover<2->{\alert<2>{ my $m = shift; my($rows,$cols) = ($m->[1],$m->[2]);}}
\uncover<2->{\alert<2>{ my $r = shift; # optional, which column from matrix}}
\uncover<2->{\alert<2>{ croak "Error: matrix doesn't have 3D rows" unless ($cols==3);}}
\uncover<3->{\alert<3>{ if ( defined $r ) \{}}
\uncover<3->{\alert<3>{  croak "Error:matrix doesn't have that row"unless($r<$rows);}}
\uncover<3->{\alert<3>{ \}}}
\uncover<4->{\alert<4>{ else \{}}
\uncover<4->{\alert<4>{  croak "Error: matrix is not a 3D row matrix"}}
\uncover<4->{\alert<4>{         unless ($rows==1);}}
\uncover<5->{\alert<5>{  $r = 0;}}
\uncover<4->{\alert<4>{ \}}}
\uncover<6->{\alert<6>{ return Math::VectorReal->%
             \alert<6>{\color{red}new(@\{$m->[0][$r]\})};}}
\uncover<1->{\alert<1>{\}}}
\end{semiverbatim}

\visible<6>{Note the use of \alert{\color{red}\texttt{shift}}.}
\end{frame}
\end{document}