3

I'm not able to unify colours of box header and box border. The colours are very similar but never the same. I tried it to set them globally as well as localy but without any success.

\documentclass[a0paper, portrait, margin = 2.2em]{baposter}

\usepackage{url}            % For \url
\usepackage{booktabs}
\usepackage{amsmath, amsfonts, amsthm}
\usepackage{multirow}
\usepackage{etoolbox}

\graphicspath{{pix/}}   % Root directory of the pictures 

\definecolor{bordercol}{RGB}{230, 184, 0}
\definecolor{headercol1}{RGB}{230, 184, 0}
\definecolor{headerfontcol}{RGB}{0,0,0}
\definecolor{boxcolor}{RGB}{255, 255, 250}
\definecolor{backgroundcol}{RGB}{255, 255, 250}
\definecolor{higlightcol}{RGB}{255, 110, 0}

\newcommand{\rowgroup}[1]{\hspace{1.5em}#1}

\begin{document}

\bgroup
%\patchcmd{<command>}{<code to replace>}{<code>}{<success>}{<failure>}
\makeatletter
\patchcmd{\baposter@box@headerdrawtext@rectangle}{0em}{0.5\boxwidth}{}{}
\patchcmd{\baposter@box@headerdrawtext@rectangle}{west}{center}{}{}
\makeatother

\begin{poster}{
    borderColor=bordercol,
    headerColorOne=headercol1,
    headerColorTwo=headercol1,
    headerFontColor=headerfontcol,
    boxColorOne=boxcolor,
    boxColorTwo=boxcolor,
    headershape=rectangle,
    headerborder=closed,
    headerfont=\Large\scshape,
    textborder=rectangle,
    headerheight=0.09\textheight,
    colspacing=0.35em, % Column spacing
    bgColorOne=backgroundcol,
    bgColorTwo=backgroundcol
}
%%% Eye Cacther %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
    Eye Catcher, empty if option eyecatcher=false - unused
}
%%% Title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\sf\scshape
    Unifying colours of box header and border in baposter
}
%%% Authors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
    Box Expert
}


\headerbox{Standard box}{name = box1, column = 0, row = 0}{
This is standard box.
}

\headerbox{Highlighted box}{name = box2, column = 0, below = box1,
boxColorOne = purple!40, headerColorOne = purple, headerColorTwo = purple, borderColor = purple}{
This should be highlighted box.
}

\end{poster}
\end{document}

Difference is still apparent: enter image description here

Any suggestions how to make the colours to be the same are welcomed!

2 Answers 2

5

The problem is that per default the background of the title is colour shade, even if you specify both colours of the shading to be the same, there is still a colour shading between the two colours.

The colour shading is done via some pgf magic which uses another colour model than the lines around your box which causes the colours to look slightly different -- or something like that, I did not really investigate this problem.

Luckily one can simply switch of the colour shading using headershade=plain.

\documentclass[a0paper, portrait, margin = 2.2em]{baposter}


\begin{document}

\begin{poster}{
    headershape=rectangle,
    headerborder=closed,
    textborder=rectangle
}{}{}{}


\headerbox{Highlighted box}{%
    headerColorOne = purple, 
    headershade=plain,
    borderColor = purple
}{
This should be highlighted box.
}

\end{poster}
\end{document}

enter image description here

1
  • Great, this works! Thank you. Interesingly, color now responds to border not to header but at least is unified!
    – Adela
    Jul 12, 2017 at 15:44
3

Update

tikz now supports CMYK shadings since version 3.1.3. So the original example will work without any changes.


Another solution to this problem is now available using a new package pgf-cmykshadings which provides support for CMYK shadings for pgf.

The fundamental problem is this: baposter loads the xcolor package with the cmyk option. This means that all the colours in the document will be output in CMYK. This is true even of the colours defined in the MWE using the RGB model.

But pgf is not able to output shadings in CMYK, only RGB. So the headerCol, which is a shading will be output in RGB. But the border will be output in CMYK. The result is a colour mismatch.

In order to get consistent colours there are two other options apart from that listed in the other answer:

  1. Select the rgb colour model in the xcolor package which will force all colours to be RGB and therefore match the shadings. Change the start of the document document to:

    \documentclass[a0paper, portrait, margin = 2.2em]{baposter}
    \selectcolormodel{rgb}
    

enter image description here

  1. Load the new package pgf-cmykshadings which provides support for CMYK shadings. It's also necessary to load xcolor with the cmyk option to avoid an option clash. All colours including the shadings will now be in CMYK. Change the start of your file to:

    \RequirePackage[cmyk]{xcolor}
    \RequirePackage{pgf-cmykshadings}
    \documentclass[a0paper, portrait, margin = 2.2em]{baposter}
    

enter image description here

1

You must log in to answer this question.

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