使用 tcolorbox 的子弹角框

使用 tcolorbox 的子弹角框

这里我使用的是 tcolorbox 包,我想根据要求根据框跨度设置需要扩展的项目符号/点。这里我附上了屏幕截图,并用红色突出显示了我需要的区域。如果有人能帮忙的话。在此处输入图片描述

梅威瑟:

\documentclass[12pt]{article}

\RequirePackage[most]{tcolorbox}

\newtcolorbox[auto counter]{Boxone}[1][]{%
enhanced,breakable,
before title={\stepcounter{BoxOnecnt}},
toggle left and right,sharp corners,
boxrule=0mm,top=0mm,bottom=0mm,left=0mm,right=0mm,
colframe=white,
colback=black!30,
fonttitle=\bfseries,
left=0pt,%%21.5
leftrule=21.5pt,
rightrule=0pt,
width=\hsize,
overlay unbroken and first ={%
\node[rotate=90,
minimum width=21.5pt,
anchor=south,
font=\fontsize{11.5bp}{11.5bp}\sffamily\bfseries,
yshift=2.5pt,
white]
at (frame.east) {WORKED E.G.~1};
},
}


\begin{document}


\begin{Boxone}%[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{Boxone}

\end{document}

答案1

有这种事吗?

\documentclass[12pt]{article}

\RequirePackage[most]{tcolorbox}
\usetikzlibrary{patterns}
\newtcolorbox[auto counter]{Boxone}[1][]{%
enhanced,breakable,
before title={\stepcounter{BoxOnecnt}},
toggle left and right,sharp corners,
boxrule=0mm,top=0mm,bottom=0mm,left=0mm,right=0mm,
colframe=white,
colback=black!30,
fonttitle=\bfseries,
left=0pt,%%21.5
leftrule=21.5pt,
rightrule=0pt,
width=\hsize,
overlay unbroken and first ={%
\ifodd\thepage
  \fill[overlay,pattern=dots] ([xshift=2.5cm]frame.north east) rectangle
  ([xshift=0.75cm]frame.south east);
  \fill[overlay,green!60!black] ([xshift=0.65cm]frame.north east) rectangle
  ([xshift=0.05cm]frame.south east);
  \node[rotate=-90,
  minimum width=21.5pt,
  anchor=south,
  font=\fontsize{11.5bp}{11.5bp}\sffamily\bfseries,
  yshift=2.5pt,
  white]
  at (frame.east) {WORKED E.G.~1};  
\else
  \fill[overlay,pattern=dots] ([xshift=-2.5cm]frame.north west) rectangle
  ([xshift=-0.75cm]frame.south west);
  \fill[overlay,green!60!black] ([xshift=-0.65cm]frame.north west) rectangle
  ([xshift=0.05cm]frame.south west);
  \node[rotate=90,
  minimum width=21.5pt,
  anchor=south,
  font=\fontsize{11.5bp}{11.5bp}\sffamily\bfseries,
  yshift=2.5pt,
  white]
  at (frame.west) {WORKED E.G.~1};  
\fi  
},
}


\begin{document}


\begin{Boxone}%[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{Boxone}

\clearpage

\begin{Boxone}%[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{Boxone}

\end{document}

在此处输入图片描述

相关内容