【Latex学习】在IEEEtran模板中使⽤algorithm环境
【Latex学习】在IEEEtran模板中使⽤algorithm环境
参考链接:
根据IEEEtran模板的要求,IEEEtran只能使⽤figure和table环境,⽽不能使⽤algorithm环境。免费经期卫生用品
IEEE publications u 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
laboratory
designed to be more customizable than the former) may be of
help in producing algorithm-like structures (although authors
are of cour free to u whatever L A TEX commands they are
most comfortable with in this regard). However, do not u徘徊的意思
the floating algorithm environment of algorithm.sty (also by
Williams and Brito) or algorithm2e.sty (by Christophe Fiorio)
as the only floating structures IEEE us 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环境。
\upackage{algorithmic}
broth\upackage{algorithm}
\makeatletter
\newcommand{\removelatexerror}{\let\@latex@error\@gobble}
\makeatother
\begin{figure}[!t]
ago\label{alg:LSB}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\removelatexerror
\begin{algorithm}[H]
\caption{Local Search Bad Algorithm}
\begin{algorithmic}[1]
\REQUIRE Candidate t $\mathbb{S}$, Initial t $\mathbb{X} = \varnothing$
\ENSURE Optimum t $\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)\wide tilde 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阿凡达 avatar
\STATE Return the maximum of $\widetilde u(S)$ and $\widetilde u(R\backslash S)$, where the local optimal t is $S$ or $R\backslash S$.
\end{algorithmic}carton
苦瓜的英文
\end{algorithm}
\end{figure}