1

Based on this answer I tried to get a transparent tcolorbox but I'd like to have a titlerule

enter image description here

I notice that when I add the line

  • the upperbox is not transparent, attach boxed title to top left
  • the full box appears titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}} ]

enter image description here

enter image description here

There must be a reason and I am certainly missing something.

MWE

\documentclass[tikz]{article}
\usepackage{xcolor}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}} ] <= I'd like it to be transparent
%    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}

1 Answer 1

2

With boxed titles, title style is independent of tcolorbox style, then you have to repeat opacity options into boxed title style.

In general the frame is not a line but a filled box over which the colback box is added. This is the reason why with opacityback=0 the resulting box shows darker because the frame is still visible.

\documentclass[tikz]{article}
\usepackage{xcolor}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, % <= I'd like it to be transparent
%    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}

\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, %  <= I'd like it to be transparent
    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
    boxed title style={opacityframe=0, opacityback=0}
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}

\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, % <= I'd like it to be transparent
    %attach boxed title to top left, % <= I'd like it to be transparent
    opacityframe=0,    
    opacityback=0,  
%   opacitybacktitle=0,
%   boxed title style={opacityframe=0, opacityback=0}
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}

enter image description here

1
  • 1
    Very clear thank you.
    – JeT
    Commented Oct 8, 2021 at 17:17

You must log in to answer this question.

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