13

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$.\\\\

3
  • Using the amsmath package, you can declare \newtheorem{problem}{Problem}
    – azetina
    Nov 18, 2013 at 1:30
  • Or \newtheorem*{problem}{Problem} if a number is not wanted.
    – egreg
    Nov 18, 2013 at 7:54
  • are you citing the proof environment because you want some marker at the end, or are the suggestions regarding the various theorem options (with no end marker) sufficient? (your example doesn't show an end marker, but the end marker is one of the hallmarks of proof.) Nov 18, 2013 at 15:25

2 Answers 2

14

The following provides a MWE:

\documentclass{article}
\usepackage{amsmath}

\newtheorem{problem}{Problem}

\begin{document}
\begin{problem}
    This is a new problem.
\end{problem}
\end{document}

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:

\documentclass{article}
\usepackage{amsmath,amsthm}
\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')>
\theoremstyle{problemstyle}

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

\begin{document}
\section{Simple Problems}
\begin{problem}[Analytic]
    Prove that $2+2 = 4$.
\end{problem}
\end{document}

enter image description here

6
  • But also \theoremstyle{remark}, if it should be italicised. Nov 18, 2013 at 1:35
  • @PrzemysławScherwentke Probably a second answer with your suggestion will help the OP identify what he really wants.
    – azetina
    Nov 18, 2013 at 1:37
  • @PrzemysławScherwentke -- i think you mean "should not be italicized". Nov 18, 2013 at 15:22
  • @barbarabeeton "It" means "the word 'Problem'", as I guess from MWE. Nov 18, 2013 at 19:10
  • @PrzemysławScherwentke -- okay, i misunderstood. but i was commenting with respect to your comment on azetina's answer -- without an alternate \theoremstyle, that will result in the text of the problem being italicized, which i seriously doubt is what is wanted. (i agree with the use of the remark style in your answer.) Nov 18, 2013 at 19:17
3

Also mine suggestion, as azetina suggested:

\documentclass{article}

\usepackage{amsthm}

\theoremstyle{remark}
\newtheorem{problem}{Problem}

\begin{document}

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

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .