WrapFigure 및 tcolorbox

WrapFigure 및 tcolorbox

다음과 같이 tcolorbox를 랩 피규어에 넣고 싶습니다.

\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}

불행하게도 제목 규칙이 작동하지 않습니다(흰색 제목 규칙만 표시됩니다). 누군가 나에게 이유를 설명해 줄 수 있습니까?

나는 또한 이 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}

하지만 titlerule style아직 segmentation style작동하지 않습니다 ....

답변1

titlerule style옵션을 만들고 사용할 수 있게 하려면 코드에 추가해야 하는 두 가지가 있습니다 . 1) 프리앰블에 segmentation style추가해야 하고 2) 스타일 옵션에 추가해야 합니다.\tcbuselibrary{skins}enhanced

따라서 전체 코드는 다음과 같아야 합니다.

\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}

여기에 이미지 설명을 입력하세요

죄송합니다. 처음에는 코드에서 문제를 발견하지 못했습니다!

관련 정보