Latex algorithmic 中添加 comment

Latex中算法伪代码的注释方法

需要注意的是下面的代码采用是usepackage{algorithmic}
而不是usepackage{algorithm2e}

对应的代码如下:

STATE $sum=0$;
FOR[comment for FOR]{$j=1$ TO $100$}
	IF[comment for IF]{$j\%2==1$}
		STATE $sum=sum+i$; COMMENT{normal comment}
	ENDIF
ENDFOR
原文地址:https://www.cnblogs.com/Lewis_Liu/p/latex_comment_2_styles.html