It was smoothly running 6 months ago. But now, it gives a large number of errors. I tried all the solution given on Stack Overflow but in vain. Here is the min. code.
P.S. I tried various combination of "algorithmicx", "algorithmic", "algorithm2e", but none of them worked.
\documentclass[lettersize,journal]{IEEEtran} \usepackage{algpseudocode} \usepackage{algorithm}
\begin{document}
\begin{algorithm}[t]
\small
\caption{Optimal Resource Allocation for (14)}
\begin{algorithmic}
\State Initialize $\Lambda^*_{i,j}$ and $(P_i^{h^*}, P_j^{l^*})$ from Algorithm 1.
$\textbf{G}$.
\While{$(b-1)> 1$};
\For{$i = 1 : I$};
\If{$\Lambda^*_{i,j} < \textbf{G}_l$};
\State $\textbf{L}_{i,j} = 1$;
\Else
\State $\textbf{L}_{i,j} = 0$;
\EndIf
\EndFor
\EndWhile
\end{algorithmic}
\end{algorithm}
\end{document}
It was smoothly running 6 months ago. But now, it gives a large number of errors. I tried all the solution given on Stack Overflow but in vain. Here is the min. code.
P.S. I tried various combination of "algorithmicx", "algorithmic", "algorithm2e", but none of them worked.
\documentclass[lettersize,journal]{IEEEtran} \usepackage{algpseudocode} \usepackage{algorithm}
\begin{document}
\begin{algorithm}[t]
\small
\caption{Optimal Resource Allocation for (14)}
\begin{algorithmic}
\State Initialize $\Lambda^*_{i,j}$ and $(P_i^{h^*}, P_j^{l^*})$ from Algorithm 1.
$\textbf{G}$.
\While{$(b-1)> 1$};
\For{$i = 1 : I$};
\If{$\Lambda^*_{i,j} < \textbf{G}_l$};
\State $\textbf{L}_{i,j} = 1$;
\Else
\State $\textbf{L}_{i,j} = 0$;
\EndIf
\EndFor
\EndWhile
\end{algorithmic}
\end{algorithm}
\end{document}
Share
Improve this question
edited 22 hours ago
samcarter_is_at_topanswers.xyz
38.9k5 gold badges57 silver badges76 bronze badges
asked yesterday
Abdullah1Abdullah1
555 bronze badges
1
- 1 I don't get any error with an up-to-date texlive installation. Can you show your .log file? – samcarter_is_at_topanswers.xyz Commented 22 hours ago
1 Answer
Reset to default 0Solved. The problem is with: (1) The use of lower case with the control statements like Statement, If, Else (Use capital letters for these reserved words), (2) The use of semicolon (don't use semicolon).