[Tex/LaTex] ntheorem and theoremname

fontstheorems

I'm using ntheorem (mostly for thmmarks), and I'd like to change the font used for the theorem name. Specifically, I'd like

\begin{theorem}[Name of theorem]

to generate "Theorem 1 (Name of theorem)" with only "Theorem 1" in bold (I think this is the default style in amsthm). Is there any easy way to do this?

\documentclass{article}
\usepackage{ntheorem}
\theoremstyle{plain}
\theorembodyfont{\itshape}
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Name of theorem]
$1 + 1 = 2$.
\end{theorem}
\end{document}

Best Answer

you can modify the plain style as you wish as follows:

\documentclass{article}
\usepackage{ntheorem}
\usepackage{xcolor}
%--------------------------------
\makeatletter
\renewtheoremstyle{plain}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2 \theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ \normalfont\textcolor{red}{##3}  \theorem@separator]}
\makeatother
%------------------------------------
\theoremstyle{plain}
\theorembodyfont{\itshape}
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}
%------------------------------------
\begin{document}
\begin{theorem}[Name of theorem]
$1 + 1 = 2$.
\end{theorem}
\end{document}
Related Question