0

enter image description here

I'm planning on doing these during a lecture so the quickest method is the best for me. Any suggestions are welcome!

Vincent
  • 20,157
  • @gernot it does not, however I have found a solution. I appreciate your help. If there is a way to mark this post as solved, please do let me know since I'm new to stackexchange! – user228720 Nov 11 '20 at 16:19
  • What do you mean by "doing these during a lecture so the quickest method is the best"? If you're creating the document before the lecture but presenting it in lecture, then quickest doesn't matter. If you're creating it in front of the audience in the middle of lecture, then your lecture isn't about math but about coding, and you would still want a better standard than "quickest". – Teepeemm Nov 11 '20 at 16:19
  • The appropriate thing for TeX.SE would be to post the answer you found as an "Answer", so that we can also vote on it. You can then accept it after two days (IIRC). But I think it would also be appropriate to explain why the suggestion doesn't answer your question (it's not a well written question, but the code will do the trick). (Welcome to TeX.SE, by the way.) – Teepeemm Nov 11 '20 at 16:22
  • @Teepeemm I'm a student, not a teacher. I want my notes to look relatively pretty but don't care too much. As with anything, I'd imagine there are multiple ways to go about doing what I wanted. Whichever method of doing it is quickest is optimal for me – user228720 Nov 11 '20 at 16:23
  • I used this answer: https://tex.stackexchange.com/questions/191572/beginframed-with-background-color?rq=1

    Thank you!

    – user228720 Nov 11 '20 at 16:24

1 Answers1

1

The package tcolorbox is great to do this kind of boxes.

\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}
Vincent
  • 20,157