Algoritmos en dos columnas que no permiten texto al lado

Algoritmos en dos columnas que no permiten texto al lado

Estoy escribiendo un documento de dos columnas con un algoritmo como figura. El algoritmo está en la columna de la izquierda, pero no aparece nada en la columna de la derecha, lo que desperdicia espacio.

Mi ejemplo de trabajo está enCompartirLaTeX.

Respuesta1

Los flotadores en documentos de dos columnas realmente no funcionan ni se adhieren a las columnas de la manera que el autor pretende. Como tal, normalmente necesitarás hacer un poco de trabajo preliminar para cambiar las cosas a tu manera.

A continuación, empujé el segundo "flotante" un poco más en el código y retrasé su salida usandoafterpage. Esto permite colocarlo en la segunda página antes de que se establezca todo el texto de la primera página. Se coloca dentro de un minipage(para evitar que se vuelva flotante) con \strutun inicio tipo - y \intextsepun espacio en la parte inferior.

ingrese la descripción de la imagen aquí

\documentclass[conference,compsoc]{IEEEtran}
\usepackage{showframe}
\usepackage{afterpage,caption}
\usepackage[noend]{algpseudocode}

% COMMANDS
% ========
\newcommand{\keyword}[1]{\emph{#1}}
\newcommand{\op}[1]{\mbox{\texttt{#1}}}
\newcommand{\const}[1]{\mbox{\textsc{#1}}}
\newcommand{\struct}[1]{\mbox{\textnormal{#1}}}
\newcommand{\membervar}[1]{\mbox{\textnormal{#1}}}
\newcommand{\typeattr}[1]{\emph{#1}}
\newcommand{\operator}[1]{\textbf{#1}}

\newcommand{\logt}[1]{\ensuremath{\log_2\left(\text{#1}\right)}}  % log base 2
\newcommand\AddressOf[1]{\operator{addressof} #1}
\newcommand\NewObj[2]{\operator{new} \struct{#1}(#2)}
\newcommand\LeftShift[2]{#1 \texttt{<\@<} #2}  % \@ to prevent latex from turning << into a different symbol
\newcommand\xor[2]{#1 \operator{xor} #2}
\newcommand\IsEq{\operator{is}}

\newcommand{\bigO}[1]{\ensuremath{\mathcal{O}(#1)}}

\algnewcommand\algorithmicclass{\textbf{Class}}
\algdef{SE}[CLASS]{Class}{EndClass}%
   [2]{\algorithmicclass\ \textproc{#1}}%
   {}%{\algorithmicend\ \algorithmicclass}%

\algnewcommand\algorithmicdestruct{\textbf{Destructor}}
\algdef{SE}[CLASS]{Destructor}{EndDestructor}%
   [2]{\algorithmicdestruct\ \textproc{#1}}%
   {}%{\algorithmicend\ \algorithmicdestruct}%

\algnewcommand\algorithmicconstruct{\textbf{Constructor}}
\algdef{SE}[CLASS]{Constructor}{EndConstructor}%
   [2]{\algorithmicconstruct\ \textproc{#1}}%
   {}%{\algorithmicend\ \algorithmicconstruct}%

% CONFIGURATION
% =============
\captionsetup{justification=justified}
\DeclareCaptionType{copyrightbox}

\setlength\intextsep{6pt}
\setlength\textfloatsep{6pt}



\begin{document}
\title{XXXX}

\author
{
  \IEEEauthorblockN
  {
    XXX
  }
  \IEEEauthorblockA
  {
    XXX
  }
}

\maketitle

% 99 words
\begin{abstract}
Taa aaaaaaaaaaa aa aaa-aaaaaaaa aaaa aa aaaaaaaaa; aaaaaaaaaa aaaa aaaaaa aaa aaaaaaaa aa aa aaaaaaaaa aa aaaaaa aaaaaa aaaaaaa aaaaaaaaaaa aaaaaaaaaa.
Aaaaaaaa aaaa aaaaaa aaaaaa aa a aaa-aaaaaaaa aaaaaaa aa aaaa aaaa aaaaaaaaaaa.
Taa aaa-aaaaaaaa aaaaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aaaaaa aaa aaaaaaa aaaaaaaaa aa a aaaaaa aaaaaa aa aaaa.
Wa aaaaaaa a aaaaaaaaa aaaa aaaaaaaaaa aaaaaa aaaaaaaaaaa aaa aaaaaaaa aaaaaaaaa aaa aaaa aaaa aaaaaaa aaa aaaaaaaaa aa aaa aaaaaaaaa.
Taaa aaaaaaa aaa aaaaaa aaaaaaaa aa aaaaaaaaa aaa-aaaaaaaa aaaaaaaaaa.
Wa aaaa aaaaaaa a aaaaaaa aaaa aaaaaaaaaaaa aaa aaaa aaaa aaaaa aaa-aaaaaaaa aaaaaaaaaa aaa aa aaaaaaaaaaa aaaaa aaa aaaaaaaaa.
\end{abstract}


\subsection{Faaaaaaaa Saaaaaa}
Taaaaa aaaaaaaa a aaaaaa aa aaaaaaaa aaaaaaa aaa aaaaaaaaaa aa aaaaa a aaaaaaaaa aaa aa aaaaaaaaaaaa aaa-aaaaaaaa aa aaaa-aaaa aaaaaaaaaa.
Taa aaaaaaaaa aaaaaaa aaaaaaa aaaaaaaa aaaa aaaaa aaaa-aaaa aaaa aaaaaaaaaa aa aaaaaaaaaaa aa Taaaaa.
Taaaa aaaaaaaa aaaa aaaaaaaa aaaaaaa aaaa aaaaaaaa aaa aaaaaaaaaaaaaa, aaaaaaaaaaaaa, aaa aaaaaaaaaaa aa aaa  aaa aaaaaaaaa.


\begin{figure}[h]
\raggedright{}
\begin{algorithmic}[1]
\Class{aaaaaa$<$T$>$ aaaaaaa OaaaaaaaaRaaaaa}

  \State{aaaaaa Saaaa aaaaa;}
  \State{aaaaa T* aaaaaaaaa[];}
  \State{aaaaa T aaaaaaaa\_aaaaaa[];}
  \State{aaaaa T aaa\_aaaaaa[];}
  \State{aaaaa aaaaaa$<$AAaaAaaaaa*$>$ aaaaaaa[];}
\\
  \Destructor{AAAAaa}{}
      \For {aaaaa \textbf{aa} aaaaaaa}
        \State{RC::aaaaaaaaa::aaaaaa(a);}
      \EndFor{}
  \EndDestructor{}
\\
  \Function{aa\_aa\_aaaaaaa}{}
    \For {helper \textbf{aa} aaaaaaa}
      \If{RC::aa\_aaaaaaa(aaaaaa) == aaaa}
        \State{\Return{aaaa;}}
      \EndIf{}
    \EndFor{}
    \State{\Return{aaaaa;}}
  \EndFunction{}
\\
  \Function{aaaa\_aaaaaaaa}{$a=0$}
    \For{a$<$aaaaaaa.aaaaaa; a$++$}
      \If{aaaaa\_aaaaaa(a) == aaaaa}
        \State{\Return{aaaaa.aaaa(\null) == aaaa;}}
      \EndIf{}
    \EndFor{}
    \State{aaaaa.aaa(aaaaaaaaa, aaaa);}
    \State{\Return{aaaaa.aaaa(\null) == aaaa;}}
  \EndFunction{}
\EndClass{}
\end{algorithmic}
\caption{AAAA aaaaaaaaaa aaaaa}
\end{figure}

Taa aaaaaa aa aaa aaaa-aaaa Aaaaa-Waaa Caaaaaa-aaa-Saaa (AAAA)aaaa{aaaa} aaaa aaa aaaaa aa aaaaaaaaaa aaaaaaa.
Taaaa aaaaaa aaaaaaaaa aaa a aaaaaa aa aaaaa aaaaaa aaaaaaaaa aaa aaaaa aa Faaaaaaaa{aaa:aaaaaa} aaaaaa{aaa:aaaaaaaaaa}.
Aa AAAA aaaaaaaaa aa aaaaaaaaa aa aaaaaaaaaaa aaaaaaaaa aaa aaaaaaaa aaaaa aa aaaa aaaaaaa aaaa a aaaaaaaaa aa aa AAaaHaaaaa.
Ta aaaaaaa aaa ABA aaaaaaa aaaa aaaaaaaaa, aaaa aaaaaa aaaa aaa aaaaaaaaaaa aaaaa~(Saaaaaaaaa{aaa:aaaaaaaaaa}).
Aaaaa aaaaaaa aa AAaaHaaaaa, aaa aaaa aaaa aa aa aaaaaaaaa aa aaaa aaa AAaaOa.
Wa aaaaaaa aaa aaaaaaaaaaa aaaaa aa aaaaaaaa aa aa{aaaaaaaaa} aaaaaaaa~(Aaaaaaaaaaaa{aaa:aaaaaaaaaa} Laaaaaa{aaa:aaaaaaaaaa:aaaaa}.
Taaa aaaaaaaa aaaa a aa{aaa} aaaaaaaaa aa aaaaaa a aaaaa aaaaaaaaa aa aaa aaaaaaa aa aaa AAaaHaaaaa.
Ia aaaaaaa aaaaaaa aa aaa aaa aaaaa aaaaaaaaaa aaa AAaaHaaaaa.
Ia aa aaaaaaaaaa aaaa aaaaa AAaaHaaaaa, aaa aaaaaaaa aaaaaaa aaa AAaaHaaaaa.
Ia aa aaaaaaaaa aa aaaaaaa aaaaaa aaaaaaaaaaa aaaaaa aaaaaaa aa aaaaaaa aaaaa aaaaaaa aaaa aaaaaaaaa aaaa.

Aaaaaaaaaaaa{aaa:aaaaaaaaaa} Laaaaaa{aaa:aaaaaaaaaa:aaaaaaaa} aaaaaaaa aaa aaaaaaaa aaaaaaaa aaaa aa aaaaaa aa a aaaaaa aa aaaaaa aa AAaaHaaaaa aaaaaa aa a aaaaaaaaa aaaaaa.
Baaaaaa a aaaaaa aaaaa aaa aaaaaaaa aaaaaaaa aaaaa aa aaa aaaaaaaa a aaaaa aa aaa aaaaaa, aa aaaa aaa aaaa aa aaaaaaaa aaa aaaa aaaaa a aaaaaaaaaa aaa aaaa aaaaaa aa aaaaa.
Faa aaaaaaa, aa aa AAaaHaaaaa aaa aaaaaa aa aaaaa, aaa aa\_aaaaa aaaaaaaa (aaaaa aa aaaaaa aa aaa aaaaa aaaaaaaa) aaaaa aaaa aaaaaaa aa aaaa aaa aaaa aa aaaaaaaaa aaaaaaaa aaaaa.

\afterpage{%
\noindent\begin{minipage}{\columnwidth}
\begin{algorithmic}[1]
\Class{AAaaAaaaaa aaaaaaa Daaaaaaaaa\rule{0pt}{\baselineskip}}

  \State{aaaaa AAAAaa aa;}
  \State{aaaaa aaa aaa;}
\\
  \Function{aa\_aaaaa}{aaaaaaa, aaa}
    \If{AA::aaaaa(AA::aaaa::aaaa, aaaaaaa, aaa, aa)}
      \State{aaaa aaa = aaaa.aaaaaaaaa(\null);}
      \If{aaa == aaaaa}
        \State{aaaaaaa.aaa(aaa, aa.aaaaaaaa\_aaaaaa[aaa]));}
      \EndIf{}
      \State{AA::aaaaaaa(AA::aaaa::aaaa);}
      \State{\Return{aaa;}}
    \EndIf{}
    \State{\Return{aaaaa;}}
  \EndFunction
\\
  \Function{aaaaaaaa}{aaaaaaa, aaa}
    \State{aa.aaaa\_aaaaaaaa(aaa+1);}
    \If{aa.aaaaa == aaaaaa}
      \State{aaaa = aa.aaa\_aaaaaa[aaa];}
    \Else{}
      \State{aaaa = aa.aaaaaaaa\_aaaaaa[aaa];}
    \EndIf{}
    \State{aaaaaaa.aaa(aaa,aaaa}
    \State{\Return{aaaaaaa.aaaa();}}
  \EndFunction{}
\\
  \Function{aaaaa}{\null}
    \If{aa.aaaaa == aaaaaa}
      \State{\Return{aa.aaa\_aaaaaa[aaa];}}
    \Else{}
      \State{\Return{aa.aaaaaaaa\_aaaaaa[aaa];}}
    \EndIf{}
  \EndFunction{}
\\
  \Function{aaaaaaaaa}{\null}
    \State{aa.aaaaaaa[aaa].aaa(aaaa,aaaa)}
    \If{aa.aaaaaaa[aaa].aaaa(\null) $\neq$ aaaa}
      \State{aa.aaaaaaaaa[aaa].aaa(aaaa, aa.aaaaaaaa\_aaaaaa[aax]);}
      \State{\Return aaaaa;}
    \EndIf{}
    \State{\Return{aaaa;}}
  \EndFunction{}
\EndClass{}
\end{algorithmic}
\captionof{figure}{aaaa aaaaaaaa aaaaaa}
\end{minipage}\par
\vspace{\intextsep}
}

Ia aaaaa aaa aa AAaaHaaaaa aa aa aaaaaaa, aaa AAAA aaaaaaaaa aaaa aaaaaa aa aaaa aa aaaaaaaaa.
Taaa aa aaaaaaaaaaaa aa aaaaaaa aaa AAAAaa'a aaaa\_aaaaaaaa aaaaaaaa.
Uaaa aaa aaaaaa, aaa aaaaa aa aaa AAAAaa aaaa aaaa aaaa aaaaaaa aaaa aaaaaaaaa aa aaaaaa aaaaaa aa aaaaaa.
Oaaa aaa aaaaa aaa aaaa aaaaaaa, aaa AAaaHaaaaaa aaa aa aaaaaaaa aaaa aaaaa aaaaaaa aaaaaa.
Taa aaaaaaa aaaaa aa aa AAaaHaaaaa aa aaaaaaaaaa aa aaaaaaa aaaaa aaaa{aaaaa} aaaaaaaa.

Oaa AAAA aaaaaaaaaaaaaa aaaa Taaaaa'a aaaaaa aaaaaaaaaa aaaaaaaa aa aaaaaaaaa aaa aaaaaaaaaaa aa aaaaaaaaaa aaaaaaa.
Wa aaa aaaaaa aaaaaaaa aa aaaaaaa AAAAaa aaaaaaa aaa aaaaaaaaa aaaaaaaa aa aaaaaaa AAaaHaaaaa aaaaaaa.
Taa AAAAaa aaaaaa aa aaaaaaaaaaa aaa aaaaaaa aaa AAaaHaaaaa aaaaaaa aaaaaaaaaa aa aa.
Aa aaaa, aaa aaaaaa aaaa aaaa aaa AAAAaa aaaa aaaaaaaa aaaaaaaaa aa aaaaa AAaaHaaaaaa.
Taaa aaaaaaaaa aa aaaaaaaaa aa aaa AAAAaa'a  aa{aa\_aa\_aaaaaaa} aaa aaaaaaaaaa aaaaaaaaa.

\subsection{Faaaaaaaa Saaaaaa}
Taaaaa aaaaaaaa a aaaaaa aa aaaaaaaa aaaaaaa aaa aaaaaaaaaa aa aaaaa a aaaaaaaaa aaa aa aaaaaaaaaaaa aaa-aaaaaaaa aa aaaa-aaaa aaaaaaaaaa.
Taa aaaaaaaaa aaaaaaa aaaaaaa aaaaaaaa aaaa aaaaa aaaa-aaaa aaaa aaaaaaaaaa aa aaaaaaaaaaa aa Taaaaa.
Taaaa aaaaaaaa aaaa aaaaaaaa aaaaaaa aaaa aaaaaaaa aaa aaaaaaaaaaaaaa, aaaaaaaaaaaaa, aaa aaaaaaaaaaa aa aaa  aaa aaaaaaaaa.
Aaaaaaaaaaaa{aaa:aaaaaaaaaa} Laaaaaa{aaa:aaaaaaaaaa:aaaaaaaa} aaaaaaaa aaa aaaaaaaa aaaaaaaa aaaa aa aaaaaa aa a aaaaaa aa aaaaaa aa AAaaHaaaaa aaaaaa aa a aaaaaaaaa aaaaaa.
Baaaaaa a aaaaaa aaaaa aaa aaaaaaaa aaaaaaaa aaaaa aa aaa aaaaaaaa a aaaaa aa aaa aaaaaa, aa aaaa aaa aaaa aa aaaaaaaa aaa aaaa aaaaa a aaaaaaaaaa aaa aaaa aaaaaa aa aaaaa.
Faa aaaaaaa, aa aa AAaaHaaaaa aaa aaaaaa aa aaaaa, aaa aa\_aaaaa aaaaaaaa (aaaaa aa aaaaaa aa aaa aaaaa aaaaaaaa) aaaaa aaaa aaaaaaa aa aaaa aaa aaaa aa aaaaaaaaa aaaaaaaa aaaaa.

Ia aaaaa aaa aa AAaaHaaaaa aa aa aaaaaaa, aaa AAAA aaaaaaaaa aaaa aaaaaa aa aaaa aa aaaaaaaaa.
Taaa aa aaaaaaaaaaaa aa aaaaaaa aaa AAAAaa'a aaaa\_aaaaaaaa aaaaaaaa.
Uaaa aaa aaaaaa, aaa aaaaa aa aaa AAAAaa aaaa aaaa aaaa aaaaaaa aaaa aaaaaaaaa aa aaaaaa aaaaaa aa aaaaaa.
Oaaa aaa aaaaa aaa aaaa aaaaaaa, aaa AAaaHaaaaaa aaa aa aaaaaaaa aaaa aaaaa aaaaaaa aaaaaa.
Taa aaaaaaa aaaaa aa aa AAaaHaaaaa aa aaaaaaaaaa aa aaaaaaa aaaaa aaaa{aaaaa} aaaaaaaa.

\end{document}

Respuesta2

Su algoritmo flota en un figureentorno que llena dos columnas, independientemente del ancho del contenido. Para restringir el algoritmo a una columna, cámbielo a un figure*entorno.

información relacionada