2011-02-24 71 views
1

如何在LaTeX中使用lstlisting或其他格式化程序包輸入此內容?在LaTeX中顯示半僞代碼

E_{T}= \phi ; 
sort the edges by their weight, $w(e_1) \le w(e_2) \le \dots \le w(e_m))$; 
for (i = 1; i \le m; i = i+1) { 
    if ($T+e_i$ contains no cycles) { 
    E_T =E_T+ e_i; 
    } 
} 
+1

http://tex.stackexchange.com是給你的。 – 2011-02-24 16:28:30

回答

1

由於它看起來像僞代碼,我推薦使用algorithmicx包。

+0

這個答案後,我在問題標題中添加了「僞代碼」。 – Svante 2011-02-24 18:39:09