“and” in algorithm

I could not find a And command but we can make one:

algnewcommandAnd{textbf{and}}

and add some space…

documentclass{article}
usepackage[noend]{algpseudocode}
usepackage[nothing]{algorithm}
algrenewcommand{algorithmicrequire}{textbf{Input:}}
algrenewcommand{algorithmicensure}{textbf{Output:}}
algnewcommandAnd{textbf{and} }

begin{document}

begin{figure}
begin{algorithmic}
If{$x> y$ And  $ x<z$}
State{some code here}
EndIf
end{algorithmic}
end{figure}
end{document}

Thanks: @Werner

Leave a Comment