これに似たものを作るにはどうしたらいいでしょうか?(色付きのボックス)

これに似たものを作るにはどうしたらいいでしょうか?(色付きのボックス)

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

講義中にこれをやろうと思っているので、一番早い方法が一番いいです。何か提案があれば歓迎します!

答え1

tcolorboxこの種類のボックスを作るにはこのパッケージが最適です。

\documentclass{article}
\usepackage{newpxtext}
\usepackage{newpxmath}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\newtcbtheorem{theorem}{Theorem}{
    arc=0mm,
    fonttitle=\bfseries,
    fontupper=\itshape,
    coltitle=black,
    colback=red!10,
    colframe=red!10,
}{thm}
\begin{document}
\begin{theorem}{Fundamental Theorem of Algebra}{fundalg}
If
\[
p(x) = a_nx^n + a_{n-1}x^{n-1} + \hdots + a_0
\]
is a polynomial with \(a_n \neq 0\), and \(a_n, a_{n-1}, \hdots, a_0 \in C\), then \(p(x)\) factors into linear factors,
\[
p(x) = a_n \cdot (x - r_1) \cdot (x - r_2) \cdot \hdots \cdot (x - r_n).
\]
\end{theorem}
\end{document}

関連情報