答案1
这是 David Purton 在聊天中发布的答案的代码。非常感谢 David。请不要为我投票,非常感谢。
\documentclass{article}
\usepackage{lipsum}
\usepackage[breakable,skins]{tcolorbox}
\newtcolorbox[auto counter, number within=section]{quickquiz}[1][]{%
enhanced, breakable, fonttitle=\sffamily\bfseries\Large,
title=Q, fontupper=\bfseries, left=\tcboxedtitlewidth,
boxsep=0pt, top=2mm, right=2mm, bottom=2mm+0.7\baselineskip,
sharp corners, colback=white, colbacktitle=orange, frame hidden,
pad before break=-0.7\baselineskip,
before upper = {\begingroup\sffamily\bfseries\Large
\textcolor{green!50!black}{uick Quiz}
\textcolor{orange}{\thetcbcounter}\quad\endgroup},
attach boxed title to top left={
yshift=-\tcboxedtitleheight+2pt-2mm},
boxed title style={
empty, left=0mm, right=0mm, top=0mm, bottom=0mm, boxsep=2pt},
underlay boxed title={
\path[fill=tcbcolbacktitle] (title) circle (\tcboxedtitleheight/2);},
overlay unbroken={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-\tcboxedtitleheight-0.7\baselineskip] (nw) at (frame.north west);
\node (sw) [circle, fill=orange, inner sep=2pt,
xshift=\tcboxedtitlewidth/2, yshift=\tcboxedtitlewidth/2]
at (frame.south west) {};
\draw[gray, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);},
overlay first={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-\tcboxedtitleheight-0.7\baselineskip] (nw) at (frame.north west);
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=0.7\baselineskip] (sw) at (frame.south west);
\draw[gray, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);},
overlay middle={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-0.7\baselineskip] (nw) at (frame.north west);
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=0.7\baselineskip] (sw) at (frame.south west);
\draw[gray, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);},
overlay last={
\coordinate[xshift=\tcboxedtitlewidth/2,
yshift=-0.7\baselineskip] (nw) at (frame.north west);
\node (sw) [circle, fill=orange, inner sep=2pt,
xshift=\tcboxedtitlewidth/2, yshift=\tcboxedtitlewidth/2]
at (frame.south west) {};
\draw[gray, line cap=round, line width=2pt,
dash pattern=on 0pt off 4\pgflinewidth] (nw) -- (sw);},
#1}
\begin{document}
\section{First Section}
\begin{quickquiz}[label=QQ:A]
\lipsum[1]
\end{quickquiz}
\begin{quickquiz}[label=QQ:B]
\lipsum[2]
\end{quickquiz}
\section{Second Section}
\begin{quickquiz}[label=QQ:C]
\lipsum
\end{quickquiz}
\begin{quickquiz}[label=QQ:D]
\lipsum[4]
\end{quickquiz}
Cross references work: see Quick Quiz \ref{QQ:A}.
\end{document}