Hallo Leute,
ich schreibe derzeit an einer Seminararbeit und bekomme etwas Platzprobleme.
Jetzt möchte ich gerne zwei Codebox-Umgebungen nebeneinander setzen. Bekomme das aber absolut nicht hin.
Im Moment sieht das ganze so aus:
Hier ein der Codeauszug:
Ich hoffe Ihr könnt mir helfen.Code:% \documentclass{llncs} % \usepackage{clrscode3e} %pseudocode \usepackage{subcaption} \captionsetup{compatibility=false} % \begin{document} \begin{figure}[ht] \begin{subfigure}[b]{0.3\textwidth} \begin{codebox} \Procname{$\proc{BubbleSort(A)}$} \li \For $i \gets 1$ \To $\attrib{A}{length}$ \Do \li \For $j \gets \attrib{A}{length}$ \Downto $i+1$ \Do \li \If $A[i] < A[j-1]$ \Then \li swap $A[j] \leftrightarrow A[j-1]$ \End \End \End \end{codebox} \caption{BubbleSort in Pseudocode} \label{fig:bubblesort} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \begin{codebox} \Procname{$\proc{BubbleSort(A)}$} \li $n \gets \attrib{A}{length}$ \li \Repeat \li $\id{swapped} \gets \const{false}$ \li \For $i \gets 1$ \To $\attrib{A}{length}-1$ \Do \li \If $A[i] > A[i+1]$ \Then \li swap $A[i] \leftrightarrow A[i+1]$ \li $\id{swapped} \gets \const{true}$ \End \li \Until $\id{swapped} \isequal \const{true}$ \end{codebox} \caption{Opitimierter BubbleSort in Pseudocode} \label{fig:bubblesortopt} \end{subfigure} \end{figure} \end{document}
Gruß, André
Lesezeichen