# The word “theorem” of a theorem is not bold if it appears inside another environment

I'm typing up solutions to a problem set. I've defined a theorem and solution environment, as in the following document.

\documentclass{article}

\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\theoremstyle{definition}
\newtheorem{problem}{Problem}
\theoremstyle{remark}
\newtheorem*{solution}{Solution}

\begin{document}
\begin{theorem}
The word theorem'' at the beginning of a theorem is bold, unless it appears inside a solution.
\end{theorem}

\begin{problem}
What is $2+2$?
\end{problem}

\begin{solution}
We use the following theorem.
The result is therefore $2+2=4$.
\end{solution}

\end{document}


For the theorem that is outside the solution, the word "Theorem" appears correctly as bold. However, inside the solution environment, the title for the theorem environment is italic, matching the style for the solution environment.

How do I get the theorem inside the solution to be correctly boldface?

This is a shortcoming of amsthm. You can cure it by using thmtools:

\documentclass{article}

\usepackage{amsthm,thmtools}

\declaretheoremstyle[
bodyfont=\itshape,
]{myplain}
\declaretheoremstyle[
bodyfont=\normalfont,
]{mydefinition}
\declaretheoremstyle[
bodyfont=\normalfont,
]{myremark}

\declaretheorem[
style=myplain,
name=Theorem,
]{theorem}
\declaretheorem[
style=mydefinition,
name=Problem,
]{problem}
\declaretheorem[
style=myremark,
unnumbered,
name=Solution,
]{solution}

\begin{document}

\begin{theorem}
The word theorem'' at the beginning of a theorem is bold, unless it appears inside a solution.
\end{theorem}

\begin{problem}
What is $2+2$?
\end{problem}

\begin{solution}
We use the following theorem.
The result is therefore $2+2=4$.