0

I've been trying to insert a comment right after an If clause in an algorithm using:

\begin{algorithm}                       
      \begin{algorithmic}
                \Statex                 
                \If {If-clause}
                \Comment {{\footnotesize Comment-1}}
                    Consequence 1 ;
                    \Else 
                        Consequence 2;
                \EndIf
                \Statex         
      \end{algorithmic} 
end{algorithm}

This gives me the comment after then and "Consequence 1" sticks after the comment. Is there a way to keep the comment and obtain a normal If-then in the right order?

1 Answer 1

1

Add \State before "Consequence 1".

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.