基于这个答案我尝试过买透明的tcolorbox
,但我想买一个titlerule
我注意到当我添加行时
- 上盒不透明,
attach boxed title to top left
- 出现完整的框
titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}} ]
肯定是有原因的,而我确实忽略了一些东西。
平均能量损失
\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
使用boxed titles
,标题样式独立于 tcolorbox 样式,那么您必须将不透明度选项重复放入boxed title style
。
通常,这frame
不是一条线,而是一个填充的框,colback
框被添加到上面。这就是为什么opacityback=0
最终的框显示较暗的原因,因为框架仍然可见。
\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}