TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the ntheorem package to display endmarks on my examples/defns, etc. The problem is that it creates lots of bad boxes when the titles on theorems etc. are too long. I found a solution overfull-hbox-produced-by-ntheorem-subtitles, which is to define the following in the preamble bit:

{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2]\theorem@headerfont (##3)\theorem@separator\newline\normalfont\itshape}
{\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}%
{\item[\theorem@headerfont\hskip \labelsep ##1]\theorem@headerfont (##3)\theorem@separator\newline\normalfont}


And I use it with:

\begin{defn}[Definition of function]This is a definition of $f(x) = p_i(x^2)$.

in my document to get this:

I don't want the math stuff to be in bold and italics. If I remove the label/title of the definition (Definition of function), the problem's solved. How do I change it so it looks normal even with a label? I know I have to mess around with the stuff after the \makeatletter but I don't understand it. Someone help please :(

share|improve this question
Is there some reason not to switch to using amsthm and thmtools (as the accepted answer in your link suggests) to change the endmark display? – Alan Munn May 11 '11 at 22:27
Yep, unfortunately those two have endmarks (for non-proof environments) that work poorly when you finish with a displayed equation. – P.A May 12 '11 at 7:05

For some reason, the declaration \boldmath is in force when the optional argument is typeset (this might depend on settings in ntheorem). Solution:

{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]\normalfont}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2]{\theorem@headerfont (##3)}\theorem@separator\newline\normalfont}
{\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]\normalfont}%
{\item[\theorem@headerfont\hskip \labelsep ##1]{\theorem@headerfont (##3)}\theorem@separator\newline\normalfont}
share|improve this answer
Thanks once again. I changed the \itshape to \upshape and it got rid of the italics in the text for defns. with labels. It had no effect for definitions without labels -- still italics (but the math stuff is fine), but if I add \normaltext to each such definition it looks fine. Thank you again. – P.A May 11 '11 at 22:39
@P.A. Look at the changes in the proposed solution, that will give upright text in the environment's body. – egreg May 11 '11 at 22:45
the reason for the \boldmath is that ntheorem has a \theorem@checkbold macro which automatically switches \boldmath on when bold is used. – Philippe Goutet May 11 '11 at 22:47
Thanks so much. Perfect. – P.A May 11 '11 at 22:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.