[latex]IEEEtranでalgorithmパッケージの使い方
はじめに
IEEEにlatexで論文投稿する場合、IEEEtran.clsというクラスファイルを使います。
このクラスファイルのHOWTOには、アルゴリズムのfloating environmentとしてalgorithm.sty, algorithm2e.styを使うな、と書かれています。
では、どうすればいいのか、というとfigure environmentを使え、ということらしいです。
algorithm.styの使い方はググればいっぱい出てきますが、algorithm.styのfloating environmentを使わずにfigure environmentを使ってアルゴリズムを載せるコードがあまり見当たらないので、例を載せておきます。
方法としてはfigureの中にalgorithm環境を埋め込めばOKです。
参考
https://tex.stackexchange.com/questions/147598/
https://tex.stackexchange.com/questions/82271/
例
algorithmic.styとalgorithmicx.styはどちらを使っても良い。
以下の例はalgorithmicx.sty用
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
% 中略
\begin{figure}[!t]
\begin{algorithm}[H]
\caption{Caption}
\label{alg1}
\begin{algorithmic}
\Require args $x_i$
\Ensure total $s$
\State $s \leftarrow 0$
\For{$i=1,\cdots,n$}
\State $s \leftarrow s + x_i$
\EndFor
\State \Return $s$
\end{algorithmic}
\end{algorithm}
\end{figure}
Author And Source
この問題について([latex]IEEEtranでalgorithmパッケージの使い方), 我々は、より多くの情報をここで見つけました https://qiita.com/exy81/items/1ca3d57e44ccec28def1著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .