I'm creating a poster and I have a problem to adjust the algorithm block inside of textblock.

My code is in below with the packages and the code.




\usepackage{ae}                         %% Font Encoding T1 (PDF)
\usepackage{lscape}                     %% Utilizar página em landscape
\usepackage{url}                        %% Trata URLs, e-mails e paths
%=========- Color -===========================================%

%=========- Command -======================================%
\def\Head#1{\noindent\hbox to \hsize{\hfil{\LARGE\color{DarkBlue} #1}}\bigskip}
\def\LHead#1{\noindent{\LARGE\color{DarkBlue} #1}\smallskip}
\def\Subhead#1{\noindent{\large\color{DarkBlue} #1}}


\TPGrid[40mm,40mm]{14}{25}  % 4 - 1 - 4 - 1 - 4 Columns
    \caption{Calculate $Q_{ij}$}\label{alg:calcqij}
      \REQUIRE $\tau>0,A\ne\emptyset,N=|A|$
      \ENSURE $Q_{ij}(\Delta t)\sum_{t\in A} e^{-\frac{|t-\delta t|}{\tau}}, \forall t\in A$
      \STATE $\mathbf{A}\Leftarrow\mathrm{sort}(A)\;\{O(N\log N)\}$
      \STATE $Q^-(1)\Leftarrow 1$
      \STATE $Q^+(N)\Leftarrow 0$
      \FOR{$k=1$ \TO $N-1$}
      \STATE  $ed(k)\Leftarrow e^{-\frac{\mathbf{A}(k+1)-\mathbf{A}(k)}{\tau}}$
      \FOR{$k=1$ \TO $N-1$}
      \STATE $Q^-(k+1)\Leftarrow 1+Q^-(k)\cdot ed(k)$
      \STATE $Q^+(N-k)\Leftarrow (Q^+(N-k+1)+1)\cdot ed(N-k)$
      \FOR{$k=1$ \TO $N$}
      \STATE $Q_{ij}(A(k))\Leftarrow Q^+(k)+Q^-(k)$
    \end{algorithm}  %====ERROR LINE====%

Always I have the message error about the float column width.

Undefined control sequence. \endalgorithm ...oatbox \global \setbox \@currbox \float@makebox \columnwidt... l.82 \end{algorithm} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Anyone have some idea how can I fix this problem?

If you have some question let me know.

Thank you.


1 Answer 1


textpos's \textblock is meant to place content in a fixed location on the current page. As such, you shouldn't store content that can float inside of it, even if the float package offers a non-floating, stay right [H]ere float specifier. Instead, you can fool TeX to think it's working with a float by using

\captionof{algorithm}{<your caption here>}

which is provided by caption. Alternatively, the minute capt-of package provides similar functionality. So, your document structure should rather resemble:

  \captionof{algorithm}{Calculate $Q_{ij}$\label{alg:calcqij}}
  • Thank you for the efficient answer/comment. It's work :)
    – Andriel
    Oct 2, 2013 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .