tcolorbox를 사용하여 기울어 진 음영 상자와 하이픈 상자를 설정하는 방법

tcolorbox를 사용하여 기울어 진 음영 상자와 하이픈 상자를 설정하는 방법

안녕하세요! 안녕하세요 여러분, 저는 tcolorbox 패키지를 사용하고 있습니다. 두 가지 유형의 상자 스타일이 있습니다. 하나는 기울어진 음영 유형이고 다른 하나는 주위에 기울어짐과 하이픈 테두리가 없습니다. 첫 번째 상자는 "RED" 색상으로, 두 번째 상자 스타일은 "GREEN" 색상으로 강조했습니다. 이 문제를 해결하는 방법을 제안해 주세요.

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

\documentclass[12pt]{article}

\RequirePackage[most]{tcolorbox}
\usetikzlibrary{patterns}

\newenvironment{Boxtwo}{\begin{tcolorbox}[bicolor,colback=white,colbacklower=white,
colframe=black,tikznode lower={inner sep=2pt,draw=red,fill=yellow}]
}{\end{tcolorbox}}



\begin{document}

\begin{Boxtwo}%[WORKED E.G. 1.1]
\begin{itemize}
\item Solving number sentences with multiple operations with or without brackets
\item Writing number sentences to describe problem situations
\item Checking solutions by substitution
\item Using properties of operations on whole numbers to simplify number sentences
\end{itemize}
\end{Boxtwo}

\begin{Boxtwo}%[WORKED E.G. 1.1]
\subsection{Addition}
A patient asks you how many medicines they need to swallow to take all their morning medicines. They have the following medicines to take:
\begin{itemize}
\item 500 mg paracetamol (2 capsules)
\item 40 mg frusemide (1 tablet)
\item 62.5 mcg digoxin (2 tablets)
\end{itemize}
A patient asks you how many medicines they need to swallow to take all their morning medicines. They have the following medicines to take:
\end{Boxtwo}

\end{document}

답변1

여백, 간격, 색상, 글꼴 등을 조정해야 하지만 시작해야 할 것이 있습니다.

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usepackage{lmodern}

\begin{document}
\begin{tcolorbox}[
    enhanced, 
    frame hidden,
    colback=cyan!10,
    top=3mm,
    overlay={%
        \draw[rounded corners, red, dashed, ultra thick] (frame.north west) rectangle (frame.south east);
        \node[font=\Huge\sffamily\bfseries, text=blue, anchor=west, rotate=5] at ([xshift=5mm] frame.north west) {Some title};}, 
    ]
\lipsum[1]
\end{tcolorbox}

\begin{tcolorbox}[
    enhanced, 
    frame hidden,
    colback=white,
    top=3mm,
    underlay={%
        \fill[orange!30, rounded corners] (frame.north west)--([shift={(1mm,1mm)}]frame.north east)--([shift={(3mm,-3mm)}]frame.south east) -- ([shift={(0mm,-1mm)}]frame.south west) -- cycle;
        \fill[white, rounded corners] (interior.north west) rectangle (interior.south east);},
    overlay={%
        \node[font=\Huge\sffamily\bfseries, text=blue, anchor=west, rotate=5] at ([xshift=5mm] frame.north west) {Some title};}, 
    ]
\lipsum[1]
\end{tcolorbox}
\end{document}

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

관련 정보