The following code gives me an error and I am not sure why:
\documentclass{beamer}
\usepackage{default}
% typesetting of algorithms
\usepackage[vlined,linesnumbered]{algorithm2e}
\SetArgSty{textnormal}
\SetCommentSty{textnormal}
\begin{document}
\begin{frame}%{ % Implementation of pin() (((
\frametitle{Implementation of \texttt{pin\,()}}
\begin{function}[H]
\Titleofalgo{ \texttt{pin($\mathit{pageno}$)}}
\eIf
{buffer pool already contains $\mathit{pageno}$}
{$\texttt{pinCount\,(\(\mathit{pageno}\))} \leftarrow
\texttt{pinCount\,(\(\mathit{pageno}\))} + 1$ \;
\Return{address of frame holding $\mathit{pageno}$ \;}}
{select a victim frame $v$ using the replacement policy \;
\If{$\texttt{dirty\,(\(v\))}$}
{write $v$ to disk \;}
read page $\mathit{pageno}$ from disk into frame $v$ \;
$\texttt{pinCount\,(\(\mathit{pageno}\))} \leftarrow 1$ \;
$\texttt{dirty\,(\(\mathit{pageno}\))} \leftarrow \text{false}$ \;
\Return{address of frame $v$} \;
}
\end{function}
\end{frame}
\end{document}
The error message I get is
./test.tex:31: Undefined control sequence.
\beamer@doifinframe ...{function}[H] \Titleofalgo
{ \texttt {pin($\mathit {p...
l.31 \end{frame}
and I cannot figure out why. What am I missing please?