フレームなしのハイライトボックス

フレームなしのハイライトボックス

次のようにフレームなしのハイライトボックスを作成するにはどうすればよいですか?

ここに画像の説明を入力してください

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

ここに画像の説明を入力してください

関連情報