So I'm not experienced with the algorithm packages in LaTeX. I'm assuming there must be a way to do
if condition1 and condition2 then...
but I can't find it. I've checked what I can find of the documentation. If I compile the below I get an error for undefined command at the \And. It looks like there is something in algorithm, using \AND, but that doesn't work here and I don't really understand what's going on.
\documentclass{article}
\usepackage[noend]{algpseudocode}
\usepackage[nothing]{algorithm}
\algrenewcommand{\algorithmicrequire}{\textbf{Input:}}
\algrenewcommand{\algorithmicensure}{\textbf{Output:}}
\begin{document}
\begin{figure}
\begin{algorithmic}
\If{$x> y$ \And $ x<z$}
\State{some code here}
\EndIf
\end{algorithmic}
\end{figure}
\end{document}
Is there a way to do what I'm after?

\And{}, or define it to include a trailing space:\algnewcommand\And{\textbf{and} }. – Werner Mar 23 '15 at 19:37\Andunless you have two operands (one on either side), so it seems logical to define\Andto always include a space.xspaceis a viable option, noting of course that there might be some drawbacks of usingxspace. – Werner Mar 23 '15 at 19:44andcould I use:$ $ \mathrm{and} $ $? – alper Jan 04 '22 at 18:12\Andis defined previously and requires $ $. – remo Aug 15 '23 at 09:47