[Tex/LaTex] ntheorem and attributions without redefinining a theorem style

ntheoremtheorems

I'm using the theoremstyle marginbreak from the package ntheorem as follows:

\theoremstyle{marginbreak}
\theoremindent1cm
\newtheorem{teo}{Theorem}[chapter]

The problem is that when I want to specify a reference or an attribution as in

\begin{teo}[Pitagora]
    $a^2+b^2=c^2$
\end{teo}

the text between square brackets is showed in a bold font.

I've seen this answer: ntheorem and theoremname. But since I'm not comfortable with theoremstyles I'm not able to redefine the marginbreak style.

On the other hand the following works:

\begin{teo}[\normalfont Pitagora]
    $a^2+b^2=c^2$
\end{teo}

but of course writing everytime \normalfont is not a solution. If this was a command, instead of an envirovment, I would do something like this:

\renewcommand{\teo}[1]{\teo{\normalfont #1}}

But with environments I don't know how to do it.

Any suggestions?

Best Answer

The answer to your question involves performing a \renewtheoremstyle on the marginbreak environment. In the MWE below, note that (##3) has been expanded to {\normalfont(##3)}. With this change, only the optional title of the theorem header and the surrounding parentheses are set in the normal (non-bold) font.

Relative to your example code, I've also changed the amount of \theoremindent to 0cm to make the default positioning of the theorem header visible; use a positive (negative) length to right-shift (left-shift) the position of the theorem header.

\documentclass{book}
\usepackage{ntheorem,lipsum}
\makeatletter
\renewtheoremstyle{marginbreak}%
  {\item[\rlap{\vbox{\hbox{\theorem@headerfont
    \llap{##2}\hskip\labelsep\relax ##1\theorem@separator}\hbox{\strut}}}]}
  {\item[\rlap{\vbox{\hbox{\theorem@headerfont
    \llap{##2}\hskip\labelsep\relax ##1        {\normalfont(##3)}\theorem@separator}\hbox{\strut}}}]}
\makeatother

\theoremstyle{marginbreak}
\setlength\theoremindent{0cm} % default
\newtheorem{teo}{Theorem}[chapter]

\begin{document}
\chapter{Start}
\begin{teo}[Pitagora]
$a^2+b^2=c^2$
\end{teo}
\lipsum[2] % filler text
\end{document}

enter image description here