Latex algorithmic 中添加 comment

Posted lewis_liu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于Latex algorithmic 中添加 comment的主要内容,如果未能解决你的问题,请参考以下文章

latex 伪代码 algorithm2e方式

latex 伪代码 algorithm2e方式

Latex中如何输入并排的两个Algorithm(如图)?

Latex algorithm

[LaTeX] box algorithm adjustbox subfigures, textwidth

latex algorithm多级编号