[Tex/LaTex] \begin{problem} analogue to \begin{proof}


I recently learned about \begin{proof} ... \end{proof}, which is a good environment to work in. My question is whether there exists a similar environment to state a problem, or whether I can write some commands for something like that myself. Ideally, I would want something like this:

\begin{problem} Prove that $2+2 = 4$. \end{\problem}

And then it should output something like:

\\\\\noindent\textem{Problem.} Prove that $2+2 = 4$.\\\\

Best Answer

The following provides a MWE:



    This is a new problem.

enter image description here

To further customize the look of the problem environment, we can resort to the amsthm package and the \newtheoremstyle command. A MWE is given below:

\newtheoremstyle{problemstyle}  % <name>
        {3pt}                                               % <space above>
        {3pt}                                               % <space below>
        {\normalfont}                               % <body font>
        {}                                                  % <indent amount}
        {\bfseries\itshape}                 % <theorem head font>
        {\normalfont\bfseries:}         % <punctuation after theorem head>
        {.5em}                                          % <space after theorem head>
        {}                                                  % <theorem head spec (can be left empty, meaning `normal')>

\newtheorem{problem}{Problem}[section] % Comment out [section] to remove section number dependence

\section{Simple Problems}
    Prove that $2+2 = 4$.

enter image description here

Related Question