無框突出顯示框

無框突出顯示框

如何建立像這樣的無框突出顯示框:

在此輸入影像描述

答案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}

在此輸入影像描述

相關內容