3

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

  • Please complete your example. This is not compilable. – LaRiFaRi Jul 10 '14 at 7:17
  • @LaRiFaRi I now edited the minimal example. If tikzposter style files are needed, I can upload them as well. – orezvani Jul 10 '14 at 7:47
  • Thanks. Just give us a link. And of course check if you even need this class in order to get your error. – LaRiFaRi Jul 10 '14 at 7:50
  • @LaRiFaRi Here is the style files: bitbucket.org/surmann/tikzposter/downloads which I got from their repository. – orezvani Jul 10 '14 at 8:12
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.