Tikzposter - 块的不透明度

Tikzposter - 块的不透明度

我正在尝试让 tikzposter 类中的块不那么不透明。除了更改 cls 之外,我找不到直接的方法来做到这一点,这似乎相当复杂。有什么想法吗?

\documentclass[11pt,a0paper]{tikzposter}
\begin{document}
\begin{columns}

\column{0.5}
\block{A test!}{ %% Normal block
  asddd
}

\column{0.5}
%% how do I change the background opacity of the block here?
%% I assume i need to do a renewcommand on \block, but that seems 
%% somewhat a daunting task
\block[opacity = 0.5]{A test!}{ 
 asd
}

\end{columns}
\end{document}

答案1

好的,创建了一个具有不透明度参数的新块样式。

简单的基本示例:

\documentclass[11pt,a0paper]{tikzposter}

 \defineblockstyle{Default1}{
    titlewidthscale=1, bodywidthscale=1, titlecenter,
    titleoffsetx=0pt, titleoffsety=0pt, bodyoffsetx=0pt, bodyoffsety=0pt,
    bodyverticalshift=0pt, roundedcorners=30, linewidth=0.4cm,
    titleinnersep=1cm, bodyinnersep=1cm
}{
    \begin{scope}[line width=\blocklinewidth, rounded corners=\blockroundedcorners]
        \ifBlockHasTitle %
           \draw[color=blocktitlebgcolor, fill=blocktitlebgcolor] (blocktitle.south west) rectangle (blocktitle.north east);
           \draw[color=blocktitlebgcolor, fill=blockbodybgcolor, opacity=0.5] (blockbody.south west) rectangle (blockbody.north east);
        \else
           \draw[color=blocktitlebgcolor, fill=blockbodybgcolor, opacity=0.5] (blockbody.south west) rectangle (blockbody.north east);
        \fi
    \end{scope}
}
\useblockstyle{Default1}

\begin{document}
\node[above right,opacity=0.5,inner sep=0pt,outer sep=0pt] at (bottomleft) {\includegraphics[width=\paperwidth,height=\paperheight]{frog.jpg}};

\begin{columns}

\column{0.5}
\block{A test!}{
  asddd
  \input{sensitivity}
}

\column{0.5}
\block{A test!}{
 asd
}

\end{columns}

\end{document}

相关内容