20

I would like to have transparent background in tcolorbox.

Most time colback=white is a work-around but it is not clean.

\documentclass{article}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}[
    title=Title,
%   opacityback=1,  % this does not work
%   colback=white,  % this is not what I want
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}
1
  • 1
    see in the documentation : Transparency in the Option Key section
    – flav
    Commented Jan 13, 2016 at 14:59

2 Answers 2

20

Thanks to flav.

Transparent background in tcolorbox is only possible with the skin key standard jigsaw. Otherwise there is no effect of the key opacityback=0

\documentclass{article}
\usepackage{xcolor}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}[
    standard jigsaw,
    title=Title,
    opacityback=0,  % this works only in combination with the key "standard jigsaw"
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}
3
  • 9
    I get transparent background with enhanced too. Try opacityfill=0
    – user31729
    Commented Jan 13, 2016 at 18:33
  • 1
    standard jigsaw, opacityback=0 and enhanced, opacityfill=0 do different things. I can see that here, where I have a figure inside a box inside a box:
    – PatrickT
    Commented Nov 6, 2017 at 15:25
  • Each of jigsaw styles works: standard jigsaw, enhanced jigsaw, and bicolor jigsaw. See tcolorbox package manual v6.2.0 (2024-01-10), sec. 10.11 "Jigsaw Skin Variants". Commented Jan 14 at 20:10
14

You must use enhanced :

\documentclass{article}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\begin{document}
\begin{tcolorbox}[enhanced,
  title=Title,
  opacityframe=.5,
   opacityback=.5,  % this does not work
%   colback=white,  % this is not what I want
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}
1
  • 2
    Thanks for your reply, but this makes everything transparent. I just want to remove the background color from the main part of the box. My answert does exactly what I want and I found it because of your comment. Thanks again.
    – Tobias
    Commented Jan 15, 2016 at 8:06

You must log in to answer this question.

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