无框突出显示框

无框突出显示框

我怎样才能创建这样的无框架突出显示框:

在此处输入图片描述

答案1

您可以加载framed包和shaded*环境:

...
\usepackage{xcolor}
\usepackage{framed}
\colorlet{shadecolor}{lightgray}
...
\begin{document}
...
\begin{shaded*}
\textbf{Example: Decision space for a College Admission Decision}\\
The decision space for a college admission decision consists of  the (potentially unobservable, hopefully unpredictable) information …
\end{shaded*}
...
\end{document}

它可以跨页显示。无星号的版本会渗入页边距。

答案2

另一个带有tcolorbox软件包的解决方案:

\documentclass{article}

\usepackage{tcolorbox}

\newtcolorbox{mybox}[1]{%
    colbacktitle=gray!30,
    coltitle=black,
    fonttitle=\bfseries,
    colback=gray!30,
    colframe=gray!30,
    sharp corners,
    title=#1}

\begin{document}

\begin{mybox}{Example: Decision space for a College Admissions Decision}
The decision space for a college admissions decision consists of  the \dots
\end{mybox}
\end{document}

在此处输入图片描述

相关内容