2

I keep getting an error...

! Undefined control sequence. \State $v.bool \gets v.bool \OR

Even though \AND works. Is there something I'm missing. A little late for me to switch to a different package but seems like something that should be supported.

Sample...

\begin{algorithmic}
    \Procedure{proc}{$v$}
        \State $v.bool \gets v.bool \OR c.bool$;
    \EndProcedure
\end{algorithmic}
  • I will use \parallel for now – cpd1 Sep 27 '16 at 0:50
  • Please provide a small complete code sample we can use to reproduce that error. – cfr Sep 27 '16 at 1:29
  • K I've added it – cpd1 Sep 27 '16 at 4:26
4

You seem to be mixing the notation of algorithmicx and algorithms - both provide an algorithmic environment. Define something if it doesn't exist:

enter image description here

\documentclass{article}

\usepackage{algpseudocode}

\algnewcommand{\algorithmicand}{\textbf{ and }}
\algnewcommand{\algorithmicor}{\textbf{ or }}
\algnewcommand{\OR}{\algorithmicor}
\algnewcommand{\AND}{\algorithmicand}
\algnewcommand{\var}{\texttt}

\begin{document}

\begin{algorithmic}
  \Procedure{proc}{$v$}
    \State $\var{v.bool} \gets \var{v.bool} \OR \var{c.bool}$;
  \EndProcedure
\end{algorithmic}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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