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}
今天需要这个东西查了下怎么设置,效果如图
热点内容