I am a real beginner in latex, and now I am struggling with using the algorithm package and algpseudocode to write some code. What I did until now is:
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{algorithm}
\caption{My algorithm doing something....}
\begin{algorithmic}
\Function{findSomething}{$x, y$} \\
\(current\_value \gets 0\) \\
\(value\_found \gets false\)
\While{\(value\_found \neq true\)}
\If{......}
% DO something, doesn't matter \And % WHERE I TRIED THE And command
.......
\EndIf
\EndWhile \\
\Return \(x\)
\EndFunction
\end{algorithmic}
\end{algorithm}
Now I wanted to use commands like "and, or, to" but here they are not working, is this maybe another package than the once I loaded? But still my second problem is, I found that i can define a command like:
\algnewcommand{\Or}{\textbf{or}}
But when I then use the \Or, nothing appears on the final pdf :S. Or when I try to define:
\algnewcommand{\And}{\textbf{and}}
Latex is telling me that the command already exists, but when I try to use it in my code (marked in the example) I get an error that the command is not available, :S
\Andor\Or, instead of leaving it in a comment. – T. Verron Sep 16 '14 at 13:08\Andor\Or? – T. Verron Sep 16 '14 at 13:08