4

I am making a poster with tikzposter and have chosen the Desert theme. However I find the graded colors of the block titles annoying and would like to just have the color instead.

However I can't seem to get rid of that. When I change the color using \colorlet{blocktitlebgcolor}{green} the color is changed, but the grading is still there.

(I hope grading is the right word, I mean the effect that the color changes to grey across the block title)

Minimal working example:

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

\usetheme{Desert}
\title{Title}
\author{authors}
\institute{institute}
\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{ \centering \vbox{
        \@titlegraphic \\[\TP@titlegraphictotitledistance] \centering
        \color{titlefgcolor} {\bfseries \Huge \@title \par}
        \vspace*{1em}
        {\huge \@author \par} \vspace*{1em} {\LARGE \@institute}
    }}
\makeatother
%%%

\usetitlestyle{sampletitle}
\colorlet{blocktitlebgcolor}{green}

\begin{document}

    \maketitle;

    \block{Block 1}{Block1}

\end{document}

1 Answer 1

4

The Desert theme uses the Slide style for the blocks, in which the background of the title is a gradient from blocktitlebgcolor to blockbodybgcolor. You can see that the colour at the right side of the title is the same as the body of the block.

One way of fixing this is to redefine the Slide style, by adding the following to the preamble:

\defineblockstyle{Slide}{
    titlewidthscale=1, bodywidthscale=1, titleleft,
    titleoffsetx=0pt, titleoffsety=0pt, bodyoffsetx=0pt, bodyoffsety=0pt,
    bodyverticalshift=0pt, roundedcorners=0, linewidth=0pt, titleinnersep=1cm,
    bodyinnersep=1cm
}{
    \ifBlockHasTitle%
        % changed "right color=..,left color=.." to "fill=blocktitlebgcolor"
        \draw[draw=none, fill=blocktitlebgcolor] 
           (blocktitle.south west) rectangle (blocktitle.north east);
    \fi%
    \draw[draw=none, fill=blockbodybgcolor] %
        (blockbody.north west) [rounded corners=30] -- (blockbody.south west) --
        (blockbody.south east) [rounded corners=0]-- (blockbody.north east) -- cycle;
}

This is taken from tikzposterBlockstyles.tex, with left color=blocktitlebgcolor, right color=blockbodybgcolor changed to fill=blocktitlebgcolor.

screenshot of block generated by code below

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

\usetheme{Desert}
% redefine Slide style
\defineblockstyle{Slide}{
    titlewidthscale=1, bodywidthscale=1, titleleft,
    titleoffsetx=0pt, titleoffsety=0pt, bodyoffsetx=0pt, bodyoffsety=0pt,
    bodyverticalshift=0pt, roundedcorners=0, linewidth=0pt, titleinnersep=1cm,
    bodyinnersep=1cm
}{
    \ifBlockHasTitle%
        % changed "right color=..,left color=.." to "fill=blocktitlebgcolor"
        \draw[draw=none, fill=blocktitlebgcolor] 
           (blocktitle.south west) rectangle (blocktitle.north east);
    \fi%
    \draw[draw=none, fill=blockbodybgcolor] %
        (blockbody.north west) [rounded corners=30] -- (blockbody.south west) --
        (blockbody.south east) [rounded corners=0]-- (blockbody.north east) -- cycle;
}
% end of redefinition

\title{Title}
\author{authors}
\institute{institute}
\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{ \centering \vbox{
        \@titlegraphic \\[\TP@titlegraphictotitledistance] \centering
        \color{titlefgcolor} {\bfseries \Huge \@title \par}
        \vspace*{1em}
        {\huge \@author \par} \vspace*{1em} {\LARGE \@institute}
    }}
\makeatother
%%%

\usetitlestyle{sampletitle}
\colorlet{blocktitlebgcolor}{green}

\begin{document}

    \maketitle;

    \block{Block 1}{Block1}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .