看板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