gibt es die Möglichkeit folgendes Beispiel so anzupassen, dass der Algorithmus über 2 Seiten gebrochen werden kann und dennoch die Struktur der vertikalen Linien (also die Orientierung für Schleifen und Verzweigungen am linken Rand, wie im Beispiel zu sehen) erhalten bleiben?
Ein Umbruch ohne diese Orientierungslinien würde es schwer machen bei vielen Verzweigungen, nur anhand der Einrückung des Codes, überhaupt nachzuvollziehen in welcher Verzweigung man sich grad befindet.
Es wäre super, wenn einer eine Idee hätte;)
Hier mein Beispiel:
\documentclass{article} \usepackage[ansinew]{inputenc} \usepackage[TS1,T1]{fontenc} \usepackage{lmodern,textcomp} \usepackage[english,ngerman]{babel} \usepackage[linesnumbered,ruled,vlined]{algorithm2e} \begin{document} \begin{algorithm} \DontPrintSemicolon % Some LaTeX compilers: \dontprintsemicolon \KwIn{A finite set $A=\{a_1, a_2, \ldots, a_n\}$ of integers} \KwOut{The largest element in the set} $max \gets a_1$\; \For{$i \gets 2$ \textbf{to} $n$} { \If{$a_i > max$} { $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; $max \gets a_i$\; } } \Return{$max$}\; \caption{{\sc Max} finds the maximum number} \label{algo:max} \end{algorithm} \end{document}