如何使用 tcolorbox 設定傾斜陰影框和連字符框

如何使用 tcolorbox 設定傾斜陰影框和連字符框

再會!大家好,我在這裡使用 tcolorbox 包,我有兩種類型的盒子樣式,一種是傾斜陰影類型,另一種是沒有傾斜和連字符邊框的。我用“紅色”顏色突出顯示了第一個框,並用“綠色”顏色突出顯示了第二個框。請建議如何解決這個問題。

微量元素: 在此輸入影像描述

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

在此輸入影像描述

相關內容