LaTex:算法排版
排版可能需要的包:
usepackage{algorithm} //format of the algorithm
usepackage{algorithmic} //format of the algorithm
usepackage{multirow} //multirow for format of table
usepackage{amsmath}
usepackage{xcolor}
DeclareMathOperator*{argmin}{argmin} //argmin或argmax公式的排版
enewcommand{algorithmicrequire}{ extbf{Input:}} //Use Input in the format of Algorithm
enewcommand{algorithmicensure}{ extbf{Output:}} //UseOutput in the format of Algorithm
排版图片可能需要的包:
usepackage{graphics}
usepackage{graphicx}
usepackage{epsfig}
算法的排版举例:
\begin{algorithm}[htb] %算法的开始
caption{ Framework of ensemble learning for our system.} %算法的标题
label{alg:Framwork} %给算法一个标签,这样方便在文中对算法的引用
\begin{algorithmic}[1] %这个1 表示每一行都显示数字
REQUIRE ~~\ %算法的输入参数:Input
The set of positive samples for current batch, $P_n$;\
The set of unlabelled samples for current batch, $U_n$;\
Ensemble of classifiers on former batches, $E_{n-1}$;
ENSURE ~~\ %算法的输出:Output
Ensemble of classifiers on the current batch, $E_n$;
STATE Extracting the set of reliable negative and/or positive samples $T_n$ from $U_n$ with help of $P_n$; label{code:fram:extract} %算法的一个陈述,对应算法的一个步骤或公式之类的; label{ code:fram:extract }对此行的标记,方便在文中引用算法的某个步骤
STATE Training ensemble of classifiers $E$ on $T_n cup P_n$, with help of data in former batches; label{code:fram:trainbase}
STATE $E_n=E_{n-1}cup E$; label{code:fram:add}
STATE Classifying samples in $U_n-T_n$ by $E_n$; label{code:fram:classify}
STATE Deleting some weak classifiers in $E_n$ so as to keep the capacity of $E_n$; label{code:fram:select}
RETURN $E_n$; %算法的返回值
end{algorithmic}
end{algorithm}
排版效果图:
在文中对算法和算法的某个步骤的引用:Therefore, in step
ef{code:fram:extract} of algorithm
ef{alg:Framwork}, we extract $T_n$, a set of reliable negative samples
1、 For和While循环语句的排版举例
(1) 排版效果图
(2)排版代码
\begin{algorithm}[h]
caption{An example for format For & While Loop in Algorithm}
\begin{algorithmic}[1]
FOR{each $iin [1,9]$}
STATE initialize a tree $T_{i}$ with only a leaf (the root);\
STATE $T=Tigcup T_{i};$\
ENDFOR
FORALL {$c$ such that $cin RecentMBatch(E_{n-1})$} label{code:TrainBase:getc}
STATE $T=T cup PosSample(c)$; label{code:TrainBase:pos}
ENDFOR;
FOR{$i=1$; $i<n$; $i++$ }
STATE $//$ Your source here;
ENDFOR
FOR{$i=1$ to $n$}
STATE $//$ Your source here;
ENDFOR
STATE $//$ Reusing recent base classifiers. label{code:recentStart}
WHILE {$(|E_n| leq L_1 )and( D
eq phi)$}
STATE Selecting the most recent classifier $c_i$ from $D$;
STATE $D=D-c_i$;
STATE $E_n=E_n+c_i$;
ENDWHILE label{code:recentEnd}
end{algorithmic}
end{algorithm}
from: http://www.binghe.org/2010/03/latex-equation-and-numbering/
LaTex:算法排版相关推荐
- LaTeX算法排版例子
1)首先在导言区加入语句: \usepackage{algorithm} \usepackage{algorithmic} 2)例1 \begin{algorithm} \caption{A} \la ...
- latex排版原理 常用算法排版伪代码模块 添加注释以及注意事项
首先说一下latex关于排版的内部原理 latex的文档由两样元素组成: 字符文本,就是我们写进去的文字内容 浮动体,默认 figure 和 table,但是我们可以定义额外的浮动体类型,比如algo ...
- LaTeX 算法代码排版 --latex2e范例总结
LaTeX 写作: 算法代码排版 --latex2e范例总结 latex2e 宏包的使用范例: \usepackage[ruled]{algorithm2e} ...
- LaTex算法代码排版-algorithm2e
LaTex算法代码排版-algorithm2e 1.使用如下宏包 2.示例代码 3.生成效果 4.参考链接 1.使用如下宏包 \usepackage[ruled]{algorithm2e} %带竖线 ...
- latex 算法,算法包 algorithm, algorithm2e
发现 latex 还有专门排版 算法伪代码的工具包,实在太强大了.查了查一些资料,总结出以下用法: 发现 algorithm2e 工具包比较好用,调用时: \usepackage[ruled,line ...
- LaTeX 科技排版 课程
LaTeX 科技排版 基本信息: 教材:LaTeX入门与提高(第二版),陈志杰等,高等教育出版社,2006 上课时间:周一 5.6 节: 地点:四教 414 上机时间:周一 7.8 ...
- Latex 算法过长 分页显示方法
参考: Algorithm tag and page break Latex 算法过长 分页显示方法 1.引用algorithm包: 2.在\begin{document}前加上以下Latex代码: ...
- LaTeX 文章排版 列表环境 表格环境
这一篇主要介绍 LaTeX 排版的几个基础的功能的实现,包括文章的排版.列表环境以及表格环境. 一.LaTeX文章排版 以"ctexbook"为例来学习LaTeX的书籍排版,注意: ...
- LaTeX 中文排版
LaTeX 中文排版宏包.文档类介绍及排版实例 LaTeX 中文排版介绍 LaTeX 中文排版宏包介绍 LaTeX 中文排版文档类介绍 LaTeX 中文排版介绍 目前使用LaTeX实现中文排版的方法主 ...
- Latex论文排版——图片
LaTex 论文排版: 1.一般图片插入 导言区 \usepackage{graphicx} % insert graphic 1 正文 \begin{figure*} \includegraphic ...
最新文章
- 用pcl读ply文件_PCL之轨迹绘制(二)
- Redis 的持久化方案
- 【Python刷题】_10
- 【机器学习入门笔记8:TensorFlow运算实质】20190216
- Python中用dict统计列表中元素出现的次数
- 英语怎么说_日常英语怎么说
- 图解Java多线程设计模式
- 第九届“图灵杯”NEUQ-ACM程序设计竞赛个人赛题解
- 一百多道.NET面试题!
- win7录屏_录屏软件Bandicam安装教程
- Fpdi实现pdf页面合并(php)
- 【juns项目】信用卡数据项目2-2:数据设计
- 变量之间的相关性度量
- 网上报名考试管理系统-功能齐全安全稳定-简单易用-系统试用免费
- ISME:长江流域Comammox Nitrospira的群落、生物地理学和生态驱动者
- 违法占耕辅助处理软件
- matlab中portcons,马柯维茨均值-方差模型
- JoVE肿瘤转移专刊征稿,写方法拍视频教程发SCI
- python默认参数举例_Python中的默认参数详解
- php蜘蛛强制劫持,d58.net最新php蜘蛛劫持程序_d58最新劫持程序