
내 목표는 아래와 같이 열거를 얻는 것입니다.
아래의 일부 코드를 조정했습니다.
\documentclass[]{article}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{xcolor}
\newcommand*\mycirc[1]{\tikz[baseline=(myc.base)]{\node[shape=circle,fill=green!75!black,inner sep=2.2pt](myc){#1};}}
\begin{document}
\begin{enumerate}[label=\protect\mycirc{\bfseries \arabic*}]
\item You decide to use the normal distribution to approximate the binomial distribution. You want to know the probability of getting exactly 16 tails out of 20 coin flips.
\begin{enumerate}[label=\textbf{\alph*}]
\item
\item
\item
\end{enumerate}
\item 108 people took a test for which the probability of passing is 0.88. Let \textit{X} be the number of people who passed the test. Using the normal distribution ....
\end{enumerate}
\end{document}
그 결과 아래 이미지가 나타났습니다.
답변1
나는 다음을 기반으로 한 솔루션을 제안합니다 tcolorbox
. 색상과 텍스트 왼쪽 여백에서 열거형의 수직 세그먼트까지의 거리라는 두 가지 인수를 취하는 환경 enumerate
이 수정됩니다 .lenumerate
주목.질문자의 초기 코드를 유지했습니다.
업데이트.열거가 두 페이지로 분할되는 경우에 작동하도록 코드를 수정했습니다. 세 페이지로 나누면 어떻게 되는지 확인하지 못했습니다. 아마도 작동하지 않을 수도 있지만 다음과 같은 것을 사용 overlay middle
하면됩니다 ...
코드
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins, breakable}
\tcbset{shield externalize}
\usepackage{enumitem}
\usepackage{lipsum}
\newcommand*\mycirc[2]{%
\tikz[baseline=(myc.base)] {%
\node[shape=circle, fill=#2, inner sep=2.2pt] (myc) {#1};
}
}
\newenvironment{noticeB}[2]{% color, delta x
\tcolorbox[%
notitle,
empty,
enhanced, % delete the edge of the bottom page for a broken box
breakable,
coltext=black,
opacityback=0,
fontupper=\rmfamily,
parbox=false,
noparskip,
boxrule=-1pt, % width of the box' edges
frame hidden,
left=0\parindent, % inner space from text to the left edge
right=0\parindent,
top=-1pt,
bottom=5pt,
% boxsep=0pt,
before skip=2ex,
after skip=2ex,
overlay unbroken and first={%
\draw[color=#1, fill=#1, line width=1pt]
($(frame.north west) +(#2, -15pt)$)
-- ($(frame.south west) +(#2, 7pt)$);
},
overlay unbroken={%
\draw[color=#1, fill=#1, line width=1pt]
($(frame.north west) +(#2, -15pt)$)
-- ($(frame.south west) +(#2, 7pt)$) circle (1.5pt);
},
overlay last={%
\draw[color=#1, fill=#1, line width=1pt]
($(frame.north west) +(#2, -1pt)$)
-- ($(frame.south west) +(#2, 7pt)$) circle (1.5pt);
}]
}{\endtcolorbox}
\newenvironment{lenumerate}[2]{%
\begin{noticeB}{#1}{#2}%
\begin{enumerate}[label=\protect\mycirc{\bfseries \arabic*}{#1}]}{%
\end{enumerate}
\end{noticeB}
}
\begin{document}
\lipsum[1]
\begin{lenumerate}{green!65!black}{11pt}
\item
You decide to use the normal distribution to approximate the
binomial distribution. You want to know the probability of getting
exactly 16 tails out of 20 coin flips.
\begin{enumerate}[label=\textbf{\alph*.}]
\item
Some text.
\item
Some mode text.
\item
Well\ldots
\end{enumerate}
\item
108 people took a test for which the probability of passing is
0.88. Let \textit{X} be the number of people who passed the
test. Using the normal distribution\ldots
\end{lenumerate}
\lipsum[2]
\end{document}