latex演算法if
發布時間: 2025-01-08 08:04:32
1. LaTeX 演算法太長,怎麼才能實現跨頁顯示
documentclass{article}
usepackage{algorithm}
usepackage{algpseudocode}
egin{document}
egin{algorithm}
caption{Part1}
egin{algorithmic}[1]
Procere{BellmanKalaba}{$G$,$u$,$l$,$p$}
ForAll{$vinV(G)$}
State$l(v)leftarrowinfty$
EndFor
State$l(u)leftarrow0$
Repeat
For{$ileftarrow1,n$}
State$minleftarrowl(v_i)$
For{$jleftarrow1,n$}
If{$min>e(v_i,v_j)+l(v_j)$}
State$minleftarrowe(v_i,v_j)+l(v_j)$
State!
algstore{bkbreak}
end{algorithmic}
end{algorithm}
dots
egin{algorithm}[h]
caption{Part2}
egin{algorithmic}[1]
algrestore{bkbreak}
State$p(i)leftarrowv_j$
EndIf
EndFor
State$l』(i)leftarrowmin$
EndFor
State$changedleftarrowl ot=l』$
State$lleftarrowl』$
Until{$ egchanged$}
EndProcere
end{algorithmic}
end{algorithm}
end{document}
今天需要這個東西查了下怎麼設置,效果如圖
熱點內容