Как я могу сделать что-то похожее на это? (Цветной квадрат)

Как я могу сделать что-то похожее на это? (Цветной квадрат)

введите описание изображения здесь

Я планирую сделать это во время лекции, поэтому для меня самый быстрый способ — лучший. Любые предложения приветствуются!

решение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}

Связанный контент