1. 算法伪代码
\documentclass[AMA,STIX1COL]{WileyNJD-v2}
\usepackage{moreverb}
\begin{algorithm}[p]
\small
\caption{$ASMVP_{distr-LSH}$}
\label{alg:Framwork}
\begin{algorithmic}[1] %这个1 表示每一行都显示数字
\REQUIRE %算法的输入参数:Input
$ TFS = \left \{ T_1,...,T_{N} \right \}$: sensor set \\
~~~~~~$ P = \left \{ {P_1,...,P_{N}}\right \}$: the time period \\
~~~~~~$ Day = \left \{ {day_1,...,day_{N} } \right \}$: date set\\
~~~~~~$ day_{target}$: a target date \\
\ENSURE %算法的输出:Output
Fore-Set: prediction results to $day_{target}$ \\
/*Step 2: Establish Date Index By Amalgamating Sub-Indices Offline*/
\STATE {\bfseries for} s = 1 to $DN$ {\bfseries do}
\STATE ~~~$ F(day_s) = (F_1(day_s),...,F_{SN}(day_s))$
\STATE {\bfseries end for}
\STATE creat hash table FTable based on $ F(day_1)...F(day_{DN})$ \\
\RETURN Fore-Set to $day_{target}$; %算法的返回值
\end{algorithmic}
\end{algorithm}
\end{document}
注意:
(1)调整字体大小
从小到大:
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
(2)显示问题
\documentclass[AMA,STIX1COL]{WileyNJD-v2}
\usepackage{moreverb}
注意到伪代码实现中使用的模板是WileyNJD-v2,只引用了一个包。
这是因为,此模板将所有包的定义放到了WileyNJD-v2.cls文件中。