Skip to content
Snippets Groups Projects
Forked from vaclab / ptb-latex
158 commits behind the upstream repository.
ptbposter-tcb.sty 2.20 KiB

\ProvidesPackage{ptbposter-tcb}[2020/02/28 v0.1f ptbposter/tcolorbox (RN)]

\newcommand*\PTB@posterSet{%
  columns=3,rows=5,spacing=\PTB@texthsep,showframe=false,}
\newcommand*\posterSet[1]{%
  \g@addto@macro\PTB@posterSet{#1,}%
}

\RequirePackage{kvoptions}[2009/07/17]
\SetupKeyvalOptions{%                                                  
  family=ptbposter-tcb,%
  prefix=PTB@,%
}

\DeclareStringOption[2]{boxlayout}

\ProcessKeyvalOptions*\relax

\newcommand*\PTB@boxesSet{} 

\newcommand*\ARC{0.005\PTB@scale@base}

\ifcase \PTB@boxlayout
    % 0
  \g@addto@macro\PTB@boxesSet{enhanced jigsaw,sharp corners=downhill,arc=\ARC}
\or % 1
  \g@addto@macro\PTB@boxesSet{enhanced jigsaw,sharp corners=uphill,arc=\ARC}
\or % 2
  \g@addto@macro\PTB@boxesSet{enhanced jigsaw,arc=\ARC}
\or % 3
  \g@addto@macro\PTB@boxesSet{arc=0pt}
\fi

\RequirePackage[most]{tcolorbox}
\tcbuselibrary{poster}
\usetikzlibrary{shadings,arrows.meta}
 
\colorlet{backgroundTop}{Goldenrod2!20}
\colorlet{backgroundBottom}{Goldenrod2!90}
\colorlet{boxBackground}{white}

\renewcommand*\backgroundContent{%
  \begin{tikzpicture}%
    \shade[top color=backgroundTop, bottom color=backgroundBottom,%
      shading angle=\ifPTBlandscape 64.07\else 41.55\fi](0,0)%
      % Winkel auf Basis von \PTB@framewidth und \PTB@frameheight
      rectangle(\PTB@framewidth,\PTB@frameheight);%
  \end{tikzpicture}%  
}

\tcbposterset{%    
  coverage={%
    height=\textheight,
    width=\textwidth,
    interior style={opacity=0},
    top=0pt,bottom=0pt,left=0pt,right=0pt
  }%
}% 

\g@addto@macro\PTB@boxesSet{
  ,boxrule=\PTB@framethickness,
  boxsep=0pt,
  top=1ex,bottom=1ex,left=1ex,right=1ex,
  toptitle=.6ex,bottomtitle=.6ex,lefttitle=1ex,righttitle=1ex,
  %before title pre=\strut, 
  colback=boxBackground,
  %opacityback=0.75,% ????
  colframe=PTBcolor,
  coltitle=white,
  fonttitle=\sffamily\bfseries\centering,
  title style={PTBcolor},
  valign=top% center
}

\tcbset{% scheint so günstiger
  adjusted title/.style={title={\raisebox{0pt}[\height][0pt]{#1}}}
}

\AtBeginDocument{%   
  \protected@edef\PTB@tempa{\noexpand\tcbposterset{poster={\PTB@posterSet},%
    boxes={\PTB@boxesSet}}}%
  \PTB@tempa
  \begin{tcbposter}%
}
\AtEndDocument{%
  \end{tcbposter}%
}

\endinput