# Function arguments in algorithmicx

I have a question about function arguments in the algorithmicx package. The following code works:

\documentclass{article}
\usepackage{algpseudocode}
\usepackage{algorithm}

\begin{document}

\begin{algorithm}
\begin{algorithmic}[5]
\Function{f}{$\tau$ , $\delta$}
%\Function{f}{$\overrightarrow{\tau}$, $\overrightarrow{\delta}$}
\State etc
\EndFunction
\end{algorithmic}
\end{algorithm}

\end{document}


But if I change the arguments to:

   \Function{f}{$\overrightarrow{\tau}$ , $\overrightarrow{\delta}$}


I get an apparently unrelated error:

! Illegal parameter number in definition of \@gtempa.


Do you know any solutions or workarounds for this situation?

-
Please edit your question so the code is a full document using any packages. I tried \usepackage{algorithmicx} but got ! Undefined control sequence. l.11 \Function –  David Carlisle Aug 14 '12 at 20:11
@DavidCarlisle I edited the question with a complete example code; I hope that's OK. –  Gonzalo Medina Aug 14 '12 at 20:16
thanks! that's better:-) –  David Carlisle Aug 14 '12 at 20:17
I'm sorry for the incomplete example, and thank you for the edit. –  Rares T Aug 15 '12 at 10:17

If in doubt, try \protect...
  \Function{f}{$\protect\overrightarrow{\tau}$, $\protect\overrightarrow{\delta}$}

"If in doubt, try \protect...". I will add this to my list of memorable quotes. –  Boris Aug 14 '12 at 21:55