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}
Tobias
  • 928

2 Answers2

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}
Tobias
  • 928
  • 9
    I get transparent background with enhanced too. Try opacityfill=0 –  Jan 13 '16 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 Nov 06 '17 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". – muzimuzhi Z Jan 14 '24 at 20:10
13

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}
flav
  • 4,714
  • 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 Jan 15 '16 at 08:06