4

I have a theorem environment, and I would like:

  • The text color of Problems and their contents to be a custom color (defined as `db' below)
  • The text color of Solutions to be a custom color (defined as `dg' below), BUT NOT it's contents. I would like the contents to remain black.
  • I would not like the contents of Problems and Solutionss to be italicized
  • Keep the same counter

    \usepackage{amsmath}
    \usepackage{amsthm}
    
    \definecolor{db}{RGB}{23,20,119}
    \definecolor{dg}{RGB}{2,101,15}
    
    \newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{}
    \theoremstyle{dotless}
    %\theoremstyle{plain}% default
    \newtheorem{thm}{Theorem}%[section]
    \newtheorem{lem}[thm]{Lemma}
    \newtheorem{prop}[thm]{Proposition}
    \newtheorem{cor}[thm]{Corollary}
    \newtheorem{defn}[thm]{Definition}
    \newtheorem{examp}[thm]{Example}
    \newtheorem{conj}[thm]{Conjecture}
    \newtheorem{rmk}[thm]{Remark}
    \newtheorem{prob}[thm]{Problem}
    \newtheorem*{sol}{Solution}
    \newtheorem*{qu}{Question}
    \newtheorem*{as}{Assumptions}
    \newtheorem*{rs}{Restatement}
    \newtheorem*{ques}{Question}
    

I've found a few pages about relevant information, but most of it was regarding boxing theorems or changing the entire environment.

  • From the many-argumented \newtheoremstyle, I assume you use amsthm? – Ulrich Schwarz Jan 23 '14 at 5:28
  • Are you referring to a background color or you just want the text to receive some color? – Gonzalo Medina Jan 23 '14 at 5:28
  • @UlrichSchwarz Yes, amsthm, my apologies. I have added the package to the code. – Reck Jan 23 '14 at 5:31
  • @GonzaloMedina The actual color of the text. For Problems I would like the word and count of problem to have the text color, as well as the contents. For Solution, I would like it to have the text color green, but I would like its contents to remain black. I have updated the question to be a bit more specific. – Reck Jan 23 '14 at 5:33
3

I would imagine the following is sufficient. That is, define a \newtheoremstyle for the prob and sol theorems each:

\newtheoremstyle{dotlessP}{}{}{\color{db}}{}{\color{db}\bfseries}{}{ }{}
\theoremstyle{dotlessP}
\newtheorem{prob}[thm]{Problem}
\newtheoremstyle{dotlessS}{}{}{}{}{\color{dg}\bfseries}{}{ }{}
\theoremstyle{dotlessS}
\newtheorem*{sol}{Solution}

enter image description here

  • Worked perfectly, thank you!!! I didn't realize I could change the theorem style while keeping them in the same families. – Reck Jan 23 '14 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.