# How can I draw a line to connect blocks in tikzposter?

I am using tikzposter and I would like to connect blocks with lines/arrows to indicate the sequence in which the boxes should be read. I was wondering whether tikzposter defines names for the blocks and if these can be used in a path... (Or any other solution to my problem)

I guess one could draw on the page by trial and error, but I am hoping there is a better way.

Here is a MWE:

\documentclass[colspace=5cm]{tikzposter}

\title{How do I draw lines connecting blocks 1--2--3--4?}
\author{Stefano Ghirlanda}

\begin{document}

\maketitle

\begin{columns}

\column{0.5}

\block{Block 1}{ Block 1 text }

\block{Block 4}{ Block 4 text }

\column{0.5}

\block{Block 2}{ Block 2 text }

\block{Block 3}{ Block 3 text }

\end{columns}

\end{document}

• Welcome to TeX.SX!! You are more likely to get help if you give a minimal working example. Currently we have to guess what packages etc you are using and this makes it really hard to help you. A MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. Cutting your code down to a MWE may well reveal what your problem actually is. In any case, it is really difficult to help you without more information. – Andrew Sep 19 '17 at 16:19

Look in tikzposter.cls, the definition of \block is in lines 355-444.

The title and body of a block are given separate names, blocktitle and blockbody. But the same name is always used, they're not unique.

You can however use the fit library to make new nodes. For example, if you do

\block{foo}{bar}
\node [fit=(blockbody),inner sep=0pt,draw,line width=2mm,yellow,dashed] (a) {};
\node [fit=(blocktitle),inner sep=0pt,draw,line width=2mm,red,loosely dashed] (b) {};


the output looks like this:

So you can see where the outlines of those nodes are.

For convenience you can make a new command for making and naming a node that fits title and body of a block. It has to be used immediately after a block, of course.

\documentclass[a2paper]{tikzposter}
\usetikzlibrary{fit}
\newcommand\NameBlock[1]{\node[fit=(blockbody)(blocktitle),inner sep=5pt] (#1) {};}
\begin{document}
\begin{columns}
\column{0.5}
\block{foo}{bar}
\NameBlock{a}
\column{0.5}
\block{bar}{baz}
\NameBlock{b}
\end{columns}

\draw [-stealth, line width=2mm] (a.south) to[bend right=40] (b.south);
\end{document}

• Works great! I tweaked a bit removing the blockbody and having inner sep=-5pt so that I can draw arrows connecting the rounded title boxes that are used in my theme. – Stefano Sep 19 '17 at 17:08