algorithmic.sty*1 を使うときれいに記述できる. 文は次のようにかく. \begin{algorithms} \STATE <text> \end{algorithms}たとえば,代入文はこんなかんじ.日本語も問題なく使える. \begin{algorithms} $a \Leftarrow 0$ $b \Leftarrow 初期値$ \end{algorithms}行番号を付けるには次のようにする. \begin{algorithms}[1] $a \Leftarrow 0$ $b \Leftarrow 初期値$ \end{algorithms} if then な構文は次のようにかく. \begin{algorithms} \IF{<condition>} <text> \ENDIF \IF{<condition>} <text1> \ELSE <text2> \END
![TeX でアルゴリズム記述する. - pyopyopyo - Linuxとかプログラミングの覚え書き -](https://cdn-ak-scissors.b.st-hatena.com/image/square/fc00766e47a84b67ab05599ad2b9b2c143e9164d/height=288;version=1;width=512/http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F517PAASMYVL.jpg)