# ntheorem and attributions without redefinining a theorem style

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?

-
not any help for you, but an observation on style. there have been many requests for what amsthm calls a "theorem note" (and by default sets it in \normalfont) to be set in bold, the same as the "theorem name". yours is the first request i've seen to do the opposite. i conclude from this that the choice is subjective, and thus very likely subject to a publisher's "house style". –  barbara beeton Feb 20 '12 at 15:07

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}%
\llap{##2}\hskip\labelsep\relax ##1\theorem@separator}\hbox{\strut}}}]}
\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}


-
That works, thanks! By the way, I didn't know the package lipsum. Looks great. –  Giacomo d'Antonio Feb 20 '12 at 15:11

By default the font can be customised but it uses the same font for all of the header, so if you want Theorem in bold but the optional argument in normal, easiest is to copy the definition and add normalfont so:

\documentclass{book}
\usepackage{ntheorem}

\makeatletter
\newtheoremstyle{mymarginbreak}%
\llap{##2}\hskip\labelsep\relax ##1\theorem@separator}\hbox{\strut}}}]}
\llap{##2}\hskip\labelsep\relax ##1\
({\normalfont ##3})\theorem@separator}\hbox{\strut}}}]}
\makeatother

\theoremstyle{mymarginbreak}
\theoremindent1cm

\begin{document}

\newtheorem{teo}{Theorem}[chapter]

\tracingmacros2

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}

\end{document}

-

You don't need to redefine things. Theorem styles "inherit" what was above them. So:

\documentclass{article}
\usepackage{ntheorem}
\theoremstyle{marginbreak}
\newtheorem{teo}{Theorem}
\begin{document}
Text

\begin{teo}[not bold]
Text in body
\end{teo}

more text
\end{document}


Basically, \theoremheaderfont redefines the theorem header font. All the other settings will be inherited from marginbreak. There's no need to create a new theorem style for something like this.

-
Sorry, I didn't specify it clearly. I want only the part between the square brackets to have a normal font. So like in "Theorem 1 (Pitagora)" the part "Theorem 1" should be bold, while the part "Pitagora" not. –  Giacomo d'Antonio Feb 20 '12 at 14:57
@Giacomod'Antonio I see. Then it looks like you need some hackery. –  Seamus Feb 20 '12 at 15:21