[Tex/LaTex] Algorithm problem in poster with tikzposter

algorithmicalgorithmstikzposter

I am creating a poster using tikzposter. But it seems to have a bug with algorithm packages. I use the following code but the borders of algorithm block span to the whole width of the poster:

\documentclass[a0paper, landscape]{tikzposter} 
\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{algorithm}
\usepackage{algorithmic}
\title{Title} 
\usetheme{Autumn} 
\begin{document}
    \maketitle

    \begin{columns} 

        \column{0.25} 
            \block[titlecenter]{1. Introduction}{
                \begin{algorithm}[H]
                \caption{Algorithm}
                \begin{algorithmic}[1]
                     \STATE get the input
                     \STATE do the computation
                     \STATE output the results
                \end{algorithmic}
                \end{algorithm}
            }

        \column{0.50}
            \block{2. Some graphic}{
                some graphic
            }

        \column{0.25} 
            \block[titlecenter]{3. Efficiency Comparison}{
                some results                
            }


    \end{columns}
\end{document}

I tried \begin{frame}[fragile also tried] \end{frame} but didn't work. Is there a solution?

I used the packages in this zip file that I got from fancytikzposter project page: https://bitbucket.org/surmann/tikzposter/downloads

Best Answer

The \column command doesn't update the value of \columnwidth that algorithm relies upon for setting its width (and the length of the rules).

Fix: add \setlength{\columnwidth}{\linewidth} at the beginning of an algorithm environment. This is easily done with etoolbox and \AtBeginEnvironment.

\documentclass[a0paper, landscape]{tikzposter} 
\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{etoolbox}
\AtBeginEnvironment{algorithm}{%
  \setlength{\columnwidth}{\linewidth}%
}
\title{Title} 
\usetheme{Autumn} 
\begin{document}

\maketitle

\begin{columns} 
\column{0.25} 
\block[titlecenter]{1. Introduction}{
  \begin{algorithm}[H]
  \caption{Algorithm}
  \begin{algorithmic}[1]
  \STATE get the input
  \STATE do the computation
  \STATE output the results
  \end{algorithmic}
  \end{algorithm}
}

\column{0.50}
\block{2. Some graphic}{
  some graphic
}

\column{0.25} 
\block[titlecenter]{3. Efficiency Comparison}{
  some results                
}

\end{columns}
\end{document}

enter image description here