[Tex/LaTex] Changing the color of theorem headings

amsthmcolortheorems

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.

Best Answer

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

Related Question