【Latex学习】在IEEEtran模板中使用algorithm环境

参考链接:How to use the algorithm2e package with IEEEtran class?

根据IEEEtran模板的要求,IEEEtran只能使用figuretable环境,而不能使用algorithm环境。

IEEE publications use the figure environment to contain
algorithms that are not to be a part of the main text flow.
Peter Williams’ and Rogerio Brito’s algorithmic.sty package
[26] or Szász János’ algorithmicx.sty package [27] (the latter is
designed to be more customizable than the former) may be of
help in producing algorithm-like structures (although authors
are of course free to use whatever L A TEX commands they are
most comfortable with in this regard). However, do not use
the floating algorithm environment of algorithm.sty (also by
Williams and Brito) or algorithm2e.sty (by Christophe Fiorio)
as the only floating structures IEEE uses are figures and tables.
Furthermore, IEEEtran will not be in control of the (non-IEEE)
caption style produced by the algorithm.sty or algorithm2e.sty
float environments.

可以在\figure环境中调用\algorithm环境并使用[H]取消\algorithm的float属性,然后再使用\algorithmic\algorithm2e环境。

\usepackage{algorithmic}
\usepackage{algorithm}
\makeatletter
\newcommand{\removelatexerror}{\let\@latex@error\@gobble}
\makeatother\begin{figure}[!t]\label{alg:LSB}\renewcommand{\algorithmicrequire}{\textbf{Input:}}\renewcommand{\algorithmicensure}{\textbf{Output:}}\removelatexerror\begin{algorithm}[H]\caption{Local Search Based Algorithm}\begin{algorithmic}[1]\REQUIRE Candidate set $\mathbb{S}$, Initial set $\mathbb{X} = \varnothing$\ENSURE Optimum set $\mathbb{X}$\STATE Let $\mathbb{X} \leftarrow r$, if $\widetilde u({v})$ is the maximum over all singletons $r \in \mathbb{S}$.\WHILE {there exists an element $a \in R\backslash S$ such that $\widetilde u(S \cup \left\{ a \right\}) > \left( {1 + \frac{\varepsilon }{{{n^2}}}} \right)\widetilde u(S)$}\STATE let $S \leftarrow S \cup \left\{ a \right\}$.\ENDWHILE\WHILE{there exists an element $a \in S$ such that $\widetilde u(S\backslash \left\{ a \right\}) > \left( {1 + \frac{\varepsilon }{{{n^2}}}} \right)\widetilde u(S)$}\STATE let $S \leftarrow S\backslash \left\{ a \right\}$.\ENDWHILE\STATE Return the maximum of $\widetilde u(S)$ and $\widetilde u(R\backslash S)$, where the local optimal set is $S$ or $R\backslash S$.\end{algorithmic}\end{algorithm}
\end{figure}

【Latex学习】在IEEEtran模板中使用algorithm环境相关推荐

  1. 【LaTeX】IEEE会议模板中插入双栏图片(解决报错:Undefined control sequence. \subfloat

    目录 一.问题描述 二.解决方案 三.引用参考 一.问题描述 使用IEEE会议论文LaTeX模板时遇到的一个错误,问题描述为:使用Texstudio编译LaTeX模板报错,报错信息提示为Undefin ...

  2. C Templates学习笔记⑧:模板中的名称

    1.受限名称和依赖型名称:如果一个名称使用: :或  .  ->来显示作用域,则为受限名称.如果一个名称依赖于模板参数,我们称它为依赖型名称. 一:名称查找 受限名称和非受限名称的查找: int ...

  3. QEE学习 在视图模板中使用自定义的辅助类

    这几天看阿旭使用QEE,我也心痒不已,正好手头有个项目,正好学习下....又学习了又挣钱了... QEE不说,还真难,官房提供的快速指南只能说 太简易..... 色色比较熟悉flea,好不容易说服自己 ...

  4. LaTeX 学习笔记

    LaTeX 学习笔记 在word中轻松将mathtype公式转换成latex 数学式行文规范 数学排式规范 LaTex中多行注释方法 使用不同中文字体 导言区 参考文献 latex的Table参数 图 ...

  5. linux常见命令---深度学习炼丹炉必备---更新中

    目录 linux常见命令---深度学习炼丹炉必备---更新中 1.修改环境变量 2.查看当前conda环境 3.如果执行conda activate ***出现问题时需要初始化shell 4.查看当前 ...

  6. 【LaTeX】IEEE模板中作者及单位命令使用

    目录 一.前言 二.原文 三.如何使用 1. Names in Journal/Technote Mode 2. Names in Conference Mode 四.总结 五.参考 一.前言 正如题 ...

  7. 【LaTex】第二行作者居中(IEEEtran模板)

    [LaTex]第二行作者居中(IEEEtran模板) 存在的问题:有四个或五个作者的时候,第二行的作者无法居中 解决方案: 在环境中添加如下代码 % 作者居中 \makeatletter \newco ...

  8. 【Latex学习】在生成pdf中加入书签/目录/提纲

    [Latex学习]在生成pdf中加入书签/目录/提纲 [Latex学习]在生成pdf中加入书签/目录/提纲 生成目录 生成pdf书签/目录/提纲 - 方法1 生成pdf书签/目录/提纲 - 方法2 去 ...

  9. latex在algorithm环境或表格中插入圆圈脚注

    用的模板默认是带圆圈的脚注,但是在algorithm环境下直接用\footnote{}则脚注内容无效,解决办法: 宏包文件中加入以下内容: \usepackage{pifont} % \usepack ...

  10. latex学习篇【一】论文中的图片技巧QA

    第一篇论文总算收尾了,整理一波latex写论文的Q&A. LATEX专栏第一篇:在Latex模板中引入各种图片的问题. 工具:overleaf 网站:https://www.overleaf. ...

最新文章

  1. hadoop思维导图
  2. Openstack服务查看镜像报错 nova image-list
  3. Openfiler的配置
  4. python平均工资-杭州Python开发平均工资高不高?
  5. kafka删除队列_没想到 Kafka 还会这样问,学会这些带你轻松搞定大厂面试!
  6. 分享网页加载速度优化的一些技巧?
  7. [HDU 4666]Hyperspace[最远曼哈顿距离][STL]
  8. 2021年B站创作者生态报告
  9. centos7下引导win7
  10. api postmain 鉴权_API鉴权
  11. 原根求解算法 NTT算法
  12. Redis 不安全临时文件漏洞
  13. python第五章课后答案5.8_Python语言程序设计(美-梁勇)第5章习题解答
  14. stata学习笔记|自相关处理问题
  15. 解决win10系统飞秋不在线问题
  16. 大胆决定+细致用功, 才可能改变命运
  17. 微信小程序面试题总结
  18. CTypedPtrArray的引用
  19. Taste and Aesthetics - A Conversation with Ken Arnold, Part II 阅读笔记
  20. vue3使用setup代替created

热门文章

  1. gorm的Related和Association的区别
  2. Winsock API编程之UDP小结
  3. 新版TCGA的突变数据SNP下载和整理
  4. vc语言c1083错误,VC编程之VS error C1083: 无法打开包括文件:“gl\glew.h”: No such file or directory\...
  5. SQLServer@@FETCH_STATUS含义
  6. 如何绘制抽奖转盘html,利用canvas实现抽奖转盘
  7. 车牌限行:受雾霾天气影响,某市决定当雾霾指数超过设定值时对车辆进行限行,假设车牌号全为数字,且长度不超过6位,限行规则如下:
  8. 拳王虚拟项目公社:2020已过半,请不要再混日子了!
  9. 添加打印机其它计算机打不开,windows无法打开添加打印机的解决方法
  10. quartz mysql表文件_quartz 持久化 数据库表