1

Using algorithmic package I would like to have an inline for loop. Currently I have the following code:

\documentclass{article}
\usepackage{algorithmic}

\begin{document}
        \begin{algorithmic}
        \FOR{k=1}
        \STATE{$k=k+1$}
        \ENDFOR
        \end{algorithmic}
\end{document}

Which produce the for loop in three line, while I would like to have all on one line. I saw this question, but could not adapt to the For loop. Any help appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.