在我的论文中,我试图用Latex编写一个伪代码,其中我需要放入一个有多个条件的IF条件。我正在尝试这样做,但似乎不起作用,因为\或命令无法识别:
\begin{algorithmic}
\While{$condition$}
\State $do-something$
\If {$condition-1$ \Or $condition-2$ \Or $condition-3$}
\State $break$
\EndIf
\EndWhile
\end{algorithmic}我使用的是算法伪代码包。我还需要在条件中放置一个“空格”,但latex只是丢弃了它,并将这两个单词连接在一起,有什么方法可以做到这一点吗?
干杯,
发布于 2012-03-18 22:51:53
不要紧,伙计们,我发现了。这是正确的方式
\begin{algorithmic}
\While{$condition$}
\State $do-something$
\If {$condition$ $1$ OR $condition$ $2$ OR $condition$ $3$}
\State $break$
\EndIf
\EndWhile
\end{algorithmic}https://stackoverflow.com/questions/9756304
复制相似问题