码迷,mamicode.com
首页 > 其他好文 > 详细

Latex algorithmic 中添加 comment

时间:2020-01-31 10:59:29      阅读:617      评论:0      收藏:0      [点我收藏+]

标签:sep   com   代码   ==   图片   for   stat   algo   注意   

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

标签:sep   com   代码   ==   图片   for   stat   algo   注意   

原文地址:https://www.cnblogs.com/Lewis_Liu/p/latex_comment_2_styles.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!