I want to have the following output using algorithmic package:
for i = 1 : z do // number of rows
x = 1
end for
I use the following tex code:
\begin{algorithmic}
\FOR{$p=1:r$} // number of rows
\STATE $x=1$
\ENDFOR
\end{algorithmic}
It doesn't work. I couldn't find any way to put the comments
to the same line with for
. Is there any way to do that with the algorithmic package?
EDIT
1.
Code:
\FOR[// loop over all puppies]{$p=1:r$}
\STATE $x=1$
\ENDFOR
Result:
for i = 1 : z do {// number of rows}
x = 1
end for
2.
Code:
\FOR{$p=1:r$ \COMMENT{// number of rows}}
\STATE $x=1$
\ENDFOR
Result:
for i = 1 : z {// number of rows} do
x = 1
end for
Is there any way to get rid of these curly brackets?