\documentclass[12pt]{article}

% You need graphics package
\usepackage{color}
\usepackage{graphicx}

\usepackage{pst-all}

\usepackage {advi}
\usepackage {advi-annot}

\usepackage{hyperref}

\pagestyle{empty}
\definecolor{red}{rgb}{1.0,0.0,0.0}
\definecolor{green}{rgb}{0.0,1.0,0.0}
\definecolor{blue}{rgb}{0.0,0.0,1.0}
\definecolor{c1}{rgb}{1.0,0.0,0.0}
\definecolor{c2}{rgb}{0.5,0.4,0.0}
\definecolor{c3}{rgb}{0.0,0.8,0.0}
\definecolor{c4}{rgb}{0.0,0.4,0.5}
\definecolor{c5}{rgb}{0.0,0.0,1.0}
\definecolor{c6}{rgb}{0.5,0.0,0.5}

\def\smallpause{0.3}

\def\keymenu#1{\textcolor{red}{\underline{#1}}}

\def\advifooter{\vbox to 0em{\vbox to \vsize {\vfill
Press: \keymenu{n}ext page \keymenu{p}revious page
\keymenu{\textvisiblespace} next pause%
} \vss}}

\def\adviheader{\noindent
{\bf\Large \ActiveDVI}\\
\includegraphics[width=\textwidth]{bar.eps}}

\let \Newpage \newpage
\def \newpage {\Newpage \advifooter\adviheader}

\def\adviemptyfooter{\vbox to 0em{\vbox to \vsize {\vfill
~~\vss\advikillembed{advianim}}}}

\def\adviquitfooter{\vbox to 0em{\vbox to \vsize {\vfill
\hfill Press: \keymenu{q} to quit%
} \vss}}

\def\lastpage{\Newpage\adviquitfooter\adviheader}

\begin{document}

\lastpage

\begin{small}
\begin{verbatim}
.PS
# The trigonometric circle
arrowhead=7
scale=1
d=0.3
d2=d/2
C: circle radius 3*d
"O" at C.w + (2.7*d,-0.3*d)
"The trigonometric circle" at C.s - (0, d)
I: "~1" ljust at C.e below
J: "1~" rjust at C.n left above
X: arrow from C.w - (0.5*d,0) to C.e + (1.5*d,0)
"$x$" rjust at X.e below
Y: arrow from C.s - (0,0.5*d) to C.n + (0,1.5*d)
"$y$~" rjust at Y.n
Orig : C.center
Theta: arc -> from Orig + (1.6*d,0) to Orig + (1.3*d,0.75*d)
"~$\theta$" ljust at Theta.e above
M :  Orig + (3*d*cos(0.5236),3*d*sin(0.5236))
line from Orig to M
"$M$" at M +(2*d2/3,2*d2/3)
line -> from M to (Orig.x,Orig.y+M.y)
"$\sin\left(\theta\right)\left\{%
  \begin{array}{c} \\ \\ \end{array}%
\right.$" at Orig + (-0.8*d,0.75*d)
line -> from M to (M.x,Orig.y)
"$\underbrace{\hspace*{1.95cm}}_%
 {\displaystyle\cos~\left(\theta\right)~}$" rjust
.PE
\showgraph
\end{verbatim}
\end{small}

\end{document}
