Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

If in doubt, try \protect...

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

enter image description here

share|improve this answer
    
"If in doubt, try \protect...". I will add this to my list of memorable quotes. –  Boris Aug 14 '12 at 21:55
    
Thank you very much, works like a charm! –  Rares T Aug 15 '12 at 10:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.