答案1
\documentclass{article}
%\usepackage{geometry}
\usepackage{enumitem}
\usepackage{tcolorbox}
\newtcolorbox{solutionbox}{
colframe=cyan!20!white,
colback =cyan!20!white,
top=0mm, bottom=0mm, left=0mm, right=0mm,
arc=0mm,
%
fontupper=\color{blue!70!black},
fonttitle=\bfseries\color{blue!70!black},
title=Solution:
}
\begin{document}
\begin{solutionbox}
\begin{enumerate}[leftmargin=*, nosep, label=(\alph*)]
\item $A\cup B=\{0,1,2,3,4,5,6,7,8\}$
\item $A\smallsetminus C = \{0,6 \} $
\item $B\smallsetminus A = B $
\item $B\cap C = \varnothing$
\item $C\smallsetminus B = C$
\end{enumerate}
\end{solutionbox}
\end{document}
答案2
这是一个简单的解决方案(!),使用framed
和ntheorem
:
\documentclass[11pt]{article}
\usepackage{amsfonts, amssymb}
\usepackage{framed}
\usepackage[svgnames]{xcolor}%
\usepackage[inline]{enumitem}
\usepackage[framed,thmmarks,thref, hyperref]{ntheorem}
\theoremheaderfont{\bfseries}
\theorembodyfont{\normalfont}
\theoremseparator{.}
\newtheorem{example}{Example}[section]
\colorlet{shadecolor}{LightBlue!60}
\def\theoremframecommand{\colorbox{shadecolor}}
\theoreminframepreskip{0.5ex}
\theoreminframepostskip{0.4ex}
\theoremprework{\color{NavyBlue}}
\theoremseparator{:}
\newshadedtheorem{sol}{Solution}
\usepackage{hyperref}%
\begin{document}
\setcounter{section}{1}
\setcounter{example}{2}
\begin{example}
Suppose $ A = \{0,2,4,6,8 \}$, $ B = \{1,3,5,7 \}$ and $ C = \{2,8,4 \}$. Find: \\
\begin{enumerate*}[label=(\alph*)]
\item $ A ∪ B$
\item $ A\smallsetminus C $
\item $ B\smallsetminus A $
\item $ B ∩ C $
\item $ C\smallsetminus B$.
\end{enumerate*}
%
\end{example}
\begin{sol}
\begin{enumerate}[label=(\alph*), wide
=0pt]
\item $ A ∪ B = \{0, 1,2,3,4,5,6, 7,8 \} $
\item $ A\smallsetminus C = \{0,6 \} $
\item $ B\smallsetminus A = B $
\item $ B ∩ C = ∅$
\item $ C\smallsetminus B = C$.
\end{enumerate}
\end{sol}
\end{document}