
Eu gostaria de colocar um tcolorbox em um wrapfigure, assim:
\begin{wrapfigure}{r}{0.4\textwidth}
\vspace{-8mm}
\begin{tcolorbox}[width=\linewidth,
colback=cyan!10!white,
colframe=white,
colbacktitle=cyan!30!white,
fonttitle=\bfseries,
coltitle=black!20!black,
title= \vspace{1mm}My title,
titlerule=1mm,
titlerule style=cyan
segmentation style={cyan, line width=1.5pt, solid}
]
Just some text, but the titlerule is not working :(
\tcblower
More text, but the segmentation style is not working neither.
\end{tcolorbox}
\end{wrapfigure}
Infelizmente, a regra do título não está funcionando (só recebo uma regra do título branca). Alguém pode me explicar por quê?
Eu também tentei este MWE:
\documentclass[12pt,a4paper, xcolor=dvipsnames]{scrartcl}
\PassOptionsToPackage{svgnames}{xcolor}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}
\usepackage{blindtext}
\usepackage{wrapfig}
\begin{document}
\begin{wrapfigure}{r}{0.4\textwidth}
\begin{tcolorbox}[width=\linewidth,
%enhanced jigsaw,
colback=cyan!10!white,
colframe=white,
colbacktitle=cyan!30!white,
fonttitle=\bfseries,
coltitle=black!20!black,
title= \vspace{1mm}My title,
titlerule=3mm,
titlerule style=red,
segmentation style={cyan, line width=1.5pt, solid}
]
Just some text, but the titlerule is not working :(
\tcblower
More text, but the segmentation style is not working neither.
\end{tcolorbox}
\end{wrapfigure}
\blindtext
\end{document}
Mas titlerule style
e segmentation style
ainda não está funcionando....
Responder1
Há duas coisas que você deve adicionar ao seu código para tornar as opções titlerule style
utilizáveis segmentation style
: 1) Você precisa adicionar \tcbuselibrary{skins}
ao seu preâmbulo e 2) você precisa adicionar enhanced
às opções de estilo.
Portanto, o código completo deve ficar assim:
\documentclass[12pt]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\begin{wrapfigure}{r}{0.4\textwidth}
\begin{tcolorbox}[
width=\linewidth,
enhanced,
colback=cyan!10!white,
colframe=white,
colbacktitle=cyan!30!white,
fonttitle=\bfseries,
coltitle=black!20!black,
title={\vspace{1mm}My title},
titlerule=3mm,
titlerule style=cyan,
segmentation style={cyan, line width=1.5pt, solid}
]
Just some text, now the titlerule is working :)
\tcblower
More text, and the segmentation style is also working.
\end{tcolorbox}
\end{wrapfigure}
\blindtext
\end{document}
Desculpe, primeiro não identifiquei o problema no seu código!