看板LaTeX
标 题side-by-side的algorithm
发信站清华资讯(枫桥驿站) (Mon Dec 18 14:54:57 2006)
转信站ptt!ctu-reader!ctu-peer!news.nctu!netnews.csie.nctu!news.cs.nthu!netne
请问有人成功并排两个algorithm吗?大概是下面这样
_________________________________________________
Algorithm 1 foo: aaa Algorithm 2 bar: bbb
-------------------------------------------------
1. for all S[i] do 1. while (RB > 0) do
2. dsfasfsa 2. asfasfsdafsad
3. end for 3. dsafasfasfsafsd
4. end while
_________________________________________________
我试过用minipage及tabular,大概像是下面这样
\begin{algorithm}
\begin{tabular}{cc} % or miniage
\begin{minpage}
\begin{algorithmic}
algorithm 1
\end{algorithmic}
\end{minipage}
&
\begin{minipage}
\begin{algorithmic}
algorithm 2
\end{algorithmic}
\end{minipage}
\\
\end{tabular}
\end{algorithm}
但是结果确是这样
_________________________________________________
Algorithm 2 bar: bbb
-------------------------------------------------
1. for all S[i] do 1. while (RB > 0) do
2. dsfasfsa 2. asfasfsdafsad
3. end for 3. dsafasfasfsafsd
4. end while
_________________________________________________
似乎algorithm 1的caption被盖掉了。
我试着把algorithm环境移进去tabular里面,发现float似乎不能放在tabular里
错误讯息: ! LaTeX Error: Not in outer par mode.
请问要怎麽才能并排两个algorithm环境阿? 谢谢
--
※ Origin: 枫桥驿站<bbs.cs.nthu.edu.tw> ◆ From: samuel.cs.nthu.edu.tw