0

I am writing some math homework in LaTex and I would like to format somehow like this:

10.2) Question Statement

My Answer


Meaning, I would like the question statement stand out, either in a colored box like above, or in some other way. Is this possible? Thank you.

EDIT: Here is an example of how I would like to to look like:

10.2) Let $R$ be an integral domain. Show that if $R[x]$ is a principal ideal domain, then $R$ is a field.

Proof: The map $\varphi : R[x] \to R$ defined by $\varphi: p(x) \mapsto p(0)$ is a surjective homomorphism with kerned $(x)$. By the first isomorphism theorem, we have $R[x]/(x) \cong R$. Furthermore, $(x)$ is a maximal ideal, is a prime ideal, and because $R[x]$ is a principal ideal domain, $(x)$ is maximal. Therefore $R[x]/(x)$ is a field, so $R$ is a field as well.

Ovi
  • 527

1 Answers1

2

As others have pointed out, there are a massive range of options for doing boxed and colored text. Here's just one example. Whichever you use, you probably want to set it up as a personally defined environment: that way you can easily change the precise implementation without having to alter your document in more than one place. If you learn anything from this, learn that!

\documentclass[12pt]{article}
\usepackage{tcolorbox}% Here's the package we will use. Many options for sure.

\newenvironment{question}[1]% We set up an environment which takes one mandatory argument: the question number.
{\begin{tcolorbox}[title=#1]}% Its start is to begin a tcolorbox with our question-number as the title
{\end{tcolorbox}}% And its end is just to end tcolorbox

\tcbset{colback=orange!20!white,colframe=orange!75,fonttitle=\sffamily\bfseries}% Fiddle with colors, fonts etc here

\begin{document}
\begin{question}{10.2}
    Let \(R\) be an integral domain. Show that if \(R[x]\) is a principal ideal domain, then \(R\) is a field.
  \end{question}
Proof: The map \(\varphi : R[x] \to R\) defined by \(\varphi: p(x) \mapsto p(0)\) is a surjective homomorphism with kerned \((x)\). By the first isomorphism theorem, we have \(R[x]/(x) \cong R\). Furthermore, \((x)\) is a maximal ideal, is a prime ideal, and because \(R[x]\) is a principal ideal domain, \((x)\) is maximal. Therefore \(R[x]/(x)\) is a field, so \(R\) is a field as well.

\end{document}

Boxed text image

You could start by experimenting with tcolorbox: find its documentation with texdoc tcolorbox at the terminal or on CTAN.

Paul Stanley
  • 18,151