Some time ago now, I answered this question Tikzposter block with no content And I thought all was nice and good.
But after having had to use the command I created I realized that around 2cm of blank space is inserted in after any titleblock
. This can bee fixed with the titleoffsety=2cm
and bodyoffsety=2cm
on any top block right below the title block. To streamline this I could make an aftertitleblock
that adds this, but it seems like a dirty macro if I need to make a new macro to clean after myself.
So I was wondering if there was a way to remove the 2cm of emptyness, from within the defineblockstyle
command.
MWE:
\documentclass{tikzposter}
\defineblockstyle{Justtitle}{
}{
\ifBlockHasTitle
\draw[color=framecolor, fill=blocktitlebgcolor,
rounded corners=\blockroundedcorners] (blocktitle.south west)
rectangle (blocktitle.north east);
\fi
}
\newcommand{\titleblock}[1]{\useblockstyle{Justtitle}\block{#1}{}\useblockstyle{Default}}
\begin{document}
\titleblock{Cool title}
\begin{columns}
\column{0.5}
\block[titleoffsety=2cm,bodyoffsety=2cm]{cool block title}{block text} %NOTE THE OFFSET
\block{next block}{more text}
\column{0.5}
\block{even cooler, but wrongly placed title}{Super cool text here}%NOTE THE LACK OF OFFSET
\block{hello}{duck}
\end{columns}
\end{document}
tikzposter.cls
, line 399) but I think that even when body is empty, some parbox is defined for it and space is reserved. This can be seen in your solution where there's some space belowbob
box.linewidth
which are always drawn behind|around boxes text.titleblock
command to remove them afterwards?\newcommand{\titleblock}[1]{\useblockstyle{Justtitle}\block[bodyinnersep=-1cm]{#1}{}\useblockstyle{Default}}