2

I am quite new to using the TikZposter package. One thing I currently find hard to understand is how to make block positioning more flexible.

More specifically: For my poster, I have the following design in mind (see sketch)

enter image description here

Not too many unusual bits, the thing I struggle with is the flow chart/block combination in the middle. Essentially I have a flow chart (which I intend to make in TikZ, but inserting pngs might work too) consisting of FIG 1, Arrow and FIG 2. The arrow needs an explanation next to it, which is in form of a 3rd figure FIG 3.

This flow chart illustrates the central scientific idea presented in the poster. FIG 1 and FIG 2 than need some background and explanation, so I thought it would be nice to have them sit in the corner of two blocks (Block 1, Block 2).

So I know how to make the flow chart in the middle, I have done that in TikZ before. But how to add the blocks Block 1, Block 2. Their lower right (lower left) corners have to be fixed (set by the flow chart figures). The rest of the block should adjust to the title etc. in the usual block-manner.

How can you do something like that in TikZposter? Is it possible to get blocks to do that? Or am I asking too much of the package?


Minimal working example

\documentclass[a0paper]{tikzposter}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}

\usetheme{Desert}
\title{AWESOME POSTER HERE!!!}
\author{MyName}
\institute{MyUniversity}
\usepackage{url,lipsum}

\definetitlestyle{sampletitle}{
    width=\paperwidth, roundedcorners=10, linewidth=2pt, innersep=5pt,
    titletotopverticalspace=0mm, titletoblockverticalspace=30mm
}{
\begin{scope}[line width=\titlelinewidth, rounded corners=\titleroundedcorners]
    \draw[color=blocktitlebgcolor, fill=titlebgcolor]
    (\titleposleft,\titleposbottom) rectangle (\titleposright,\titlepostop);
\end{scope}
}
%%% Added for avoding small caps in the title
\usepackage{etoolbox}
\makeatletter
\patchcmd{\TP@maketitle}
{\bfseries \Huge \sc}
{\bfseries\Huge}
{}{}
\makeatother
%%%

%%% Added to change title font
\makeatletter
\settitle{ \hspace{10mm} \vbox{
        \vspace*{1em}
        \@titlegraphic \\[\TP@titlegraphictotitledistance] \raggedright
        \color{titlefgcolor} {\Huge \@title \par}
        \vspace*{1em}
        {\huge \@author \par} \vspace*{0em} {\Large \@institute}
    }}
\makeatother
%%%

    \usetitlestyle{sampletitle}
    \newcommand{\ini}{\textsuperscript{1}}
    \newcommand{\inii}{\textsuperscript{2}}
    \newcommand{\inS}{\textsuperscript{*}}

    %%% Grid to help positioning
    \makeatletter
    \def\grd@save@target#1{%
        \def\grd@target{#1}}
    \def\grd@save@start#1{%
        \def\grd@start{#1}}
    \tikzset{
        grid with coordinates/.style={
            to path={%
                \pgfextra{%
                    \edef\grd@@target{(\tikztotarget)}%
                    \tikz@scan@one@point\grd@save@target\grd@@target\relax
                    \edef\grd@@start{(\tikztostart)}%
                    \tikz@scan@one@point\grd@save@start\grd@@start\relax
                    \draw[minor help lines] (\tikztostart) grid (\tikztotarget);
                    \draw[major help lines] (\tikztostart) grid (\tikztotarget);
                    \grd@start
                    \pgfmathsetmacro{\grd@xa}{\the\pgf@x/1cm}
                    \pgfmathsetmacro{\grd@ya}{\the\pgf@y/1cm}
                    \grd@target
                    \pgfmathsetmacro{\grd@xb}{\the\pgf@x/1cm}
                    \pgfmathsetmacro{\grd@yb}{\the\pgf@y/1cm}
                    \pgfmathsetmacro{\grd@xc}{\grd@xa + \pgfkeysvalueof{/tikz/grid with coordinates/major step}}
                    \pgfmathsetmacro{\grd@yc}{\grd@ya + \pgfkeysvalueof{/tikz/grid with coordinates/major step}}
                    \foreach \x in {\grd@xa,\grd@xc,...,\grd@xb}
                    \node[anchor=north] at (\x,\grd@ya) {\Huge \pgfmathprintnumber{\x}};
                    \foreach \y in {\grd@ya,\grd@yc,...,\grd@yb}
                    \node[anchor=east] at (\grd@xa,\y) {\Huge \pgfmathprintnumber{\y}};
                }
            }
        },
        minor help lines/.style={
            help lines,
            step=\pgfkeysvalueof{/tikz/grid with coordinates/minor step}
        },
        major help lines/.style={
            help lines,
            line width=\pgfkeysvalueof{/tikz/grid with coordinates/major line width},
            step=\pgfkeysvalueof{/tikz/grid with coordinates/major step}
        },
        grid with coordinates/.cd,
        minor step/.initial=1.0,
        major step/.initial=10.0,
        major line width/.initial=20pt,
    }
    \makeatother
    %%%

    \begin{document}

        \maketitle

        \draw[draw=black,fill=orange] (-20,20) rectangle (-10,30);
        \draw[draw=red,fill=red] (10,20) rectangle (20,30);
        \draw[blue,->,line width=1cm] (-10,25) -- (10,25);
        \draw[fill=green,draw=green] (0,33) circle (8);

        \draw[dashed] (-10,20) rectangle (-40,50);
        \draw[dashed] (10,20) rectangle (40,50);

        \node[align=left] at (25,43) {\huge I want to be a block,\\ \huge wrap text around the red square\\ \huge and nicely adjust my size\\ \huge while keeping my lower left corner\\ \huge around the red square \\ \huge :( };

        \node[align=left] at (-25,43) {\huge I want to be a block,\\ \huge wrap text around the orange square\\ \huge and nicely adjust my size\\ \huge while keeping my lower left corner\\ \huge around the orange square \\ \huge :( };

        %\draw (-40,-50) to[grid with coordinates] (40,50); %%% Uncommenting this shows a grid; convenient for TikZ positioning
    \end{document}

A lot of the preamble is just there to define a grid that is nice to work out where to put TikZ figures. You can cut that out if you want. The command to show the grid is commented out. In the current form it gives:

enter image description here

4

I tried wrapfigure, but didn't work well inside a \block in a column. Might be possible to make it work, but below I present a different approach. It is certainly not ideal, in that there isn't really any wrapping at all. What I do is to use the adjustwidth environment from the chngpage package to change the margin for part of the text in the \block to make room for a figure. Depending on the text in the blocks, it might take a bit of fiddling around to get a good result, which could be OK for a single poster I suppose.

Might be easiest to make the three figures in a separate file using the standalone class, and use \includegraphics, as in the example below, but that's up to you.

I made use of the node names used for blocks (see How can I draw a line to connect blocks in tikzposter?) to define a couple of coordinates, and then I added the images relative to these coordinates.

Note that I also patched the \block macro to fix the problem I reported in https://bitbucket.org/surmann/tikzposter/issues/38/.

output of code

\documentclass[a0paper]{tikzposter}

\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}

\usetheme{Desert}
\title{AWESOME POSTER HERE!!!}
\author{MyName}
\institute{MyUniversity}
\usepackage{url,lipsum}

\definetitlestyle{sampletitle}{
    width=\paperwidth, roundedcorners=10, linewidth=2pt, innersep=5pt,
    titletotopverticalspace=0mm, titletoblockverticalspace=30mm
}{
\begin{scope}[line width=\titlelinewidth, rounded corners=\titleroundedcorners]
    \draw[color=blocktitlebgcolor, fill=titlebgcolor]
    (\titleposleft,\titleposbottom) rectangle (\titleposright,\titlepostop);
\end{scope}
}
%%% Added for avoding small caps in the title
\usepackage{xpatch} % <-- loads etoolbox
\makeatletter

% https://bitbucket.org/surmann/tikzposter/issues/38/
\xpatchcmd{\block}%
{\TP@blockbodywidth-2\TP@blockbodyinnersep-\TP@blockbodyoffsetx}
{\TP@blockbodywidth-2\TP@blockbodyinnersep}
{}{}

\patchcmd{\TP@maketitle}
{\bfseries \Huge \sc}
{\bfseries\Huge}
{}{}
%%%

%%% Added to change title font

\settitle{ \hspace{10mm} \vbox{
        \vspace*{1em}
        \@titlegraphic \\[\TP@titlegraphictotitledistance] \raggedright
        \color{titlefgcolor} {\Huge \@title \par}
        \vspace*{1em}
        {\huge \@author \par} \vspace*{0em} {\Large \@institute}
    }}
\makeatother
%%%

\usetitlestyle{sampletitle}


% defines the adjustwidth environment
\usepackage{chngpage}


\begin{document}

\maketitle

\begin{columns}
\column{0.5}
\block[titlewidthscale=0.8,bodywidthscale=0.8,titleoffsetx=-4cm,bodyoffsetx=-4cm]{title}{%

\lipsum[1]

\begin{adjustwidth}{0cm}{15cm}
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
\end{adjustwidth}
}
\coordinate (blockA lr) at ([yshift=1cm]blockbody.south east);

\column{0.5}
\block[titlewidthscale=0.8,bodywidthscale=0.8,titleoffsetx=4cm,bodyoffsetx=4cm]{Title}{
\lipsum[1]

\begin{adjustwidth}{15cm}{0cm}
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
Lorem ipsum and a lot more text etc.
\end{adjustwidth}
}
\coordinate (blockB ll) at (blockbody.south west);

\end{columns}

% add figures 1 and 2
\node[above left] at (blockA lr) {\includegraphics[width=14cm]{example-image-a}};
\node[above right] at (blockA lr -| blockB ll) {\includegraphics[width=14cm]{example-image-b}};

% draw arrow with figure 3 above it
\draw [blue,line width=1cm,->] (blockA lr) -- 
       node[above=2cm] {\includegraphics[width=14cm]{example-image-c}}
       (blockA lr -| blockB ll);


% the other blocks
\block{C}{\lipsum[1-3]}

\begin{columns}
\column{0.33}
\block{C}{\lipsum[1]}

\column{0.33}
\block{C}{\lipsum[1]}

\column{0.33}
\block{C}{\lipsum[1]}
\end{columns}

\end{document}
  • Particularly convenient solution for me since I already made the flowchart figure in TikZ for an article! – Wolpertinger Dec 4 '17 at 9:45

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.