3

With the standard theorem-like environemnts (at least when using amsthm), one obtains something like

Theorem 2.3.

where "Theorem" is in bold but "2.3." is not. I would like to have the number in bold too. A first solution may look like

\newtheorem{thm}{Theorem}[section]
\renewcommand{\thethm}{\textbf{\arabic{section}.\arabic{thm}}}

The problem with this solution is that every reference to a theorem number will be in bold as well, and I don't want this inside the text.

Is there a way to have only the numbers in theorem headings in bold?

EDIT As it was pointed out, my actual example is slightly more complicated than that. I am using a modified theorem style; a minimal example follows

\documentclass[reqno]{amsart}

\usepackage{amsthm, lipsum}
\swapnumbers

\newtheoremstyle{dotless-thm}
{3pt}
{3pt}
{\it}
{}
{\bfseries}
{}
{.5em}
{}

\theoremstyle{dotless-thm}
\newtheorem{thm}{Theorem}[section]

\begin{document}
\begin{thm}
\lipsum
\end{thm}
\end{document}

Even though I use bfseries for the theorem body font, the number appears in normal font.

3
  • 1
    Can you please post a minimal working example that illustrates this behaviour? The standard plain style of amsthm typesets both the name and the number boldfaced. Apr 6, 2011 at 12:52
  • I think editing \thethm is probably not the way to achieve what you want. amsthm and ntheorem packages provide their own functionality for changing how theorems appear...
    – Seamus
    Apr 6, 2011 at 13:03
  • The problem is with \swapnumbers commenting that out makes the number bold. So there's something funny going on with swap numbers and theorem head styling...
    – Seamus
    Apr 6, 2011 at 14:11

3 Answers 3

3

You can redefine the internal command \swappedhead of amsart.cls which changes the number font when the \swapnumbers command is invoked. This can be done adding the lines between \makeatletter and \makeatother in my example code:

\documentclass{amsart}
\usepackage{amsthm}
\swapnumbers

\makeatletter
\def\swappedhead#1#2#3{%
  % original definition:
  % \thmnumber{\@upn{\the\thm@headfont#2\@ifnotempty{#1}{.~}}}%
  % change:
  \thmnumber{\@upn{\the\thm@headfont#2\@ifnotempty{#1}{.~}}}%
  \thmname{#1}%
  \thmnote{ {\the\thm@notefont(#3)}}}
\makeatother

\newtheoremstyle{dotless-thm}
  {3pt}
  {3pt}
  {\itshape}
  {}
  {\bfseries}
  {}
  {.5em}
  {}
\theoremstyle{dotless-thm}
\newtheorem{theo}{Theorem}

\begin{document}

\begin{theo}
Test
\end{theo}
\end{document}

EDIT: as Seamus has suggested in his answer, the fact that the number font for theorem-like structures changes if the \swapnumbers switch is in use is a feature provided by the AMS document classes.

2
  • It's worth noting that this isn't a bug or error: it's part of AMS style that if the number is swapped, its font attributes matches the section heading...
    – Seamus
    Apr 6, 2011 at 16:40
  • @Seamus: Yes, I know that... and no one has suggested it was a bug. I'll, however, add a anote to my solution. Apr 6, 2011 at 16:45
4

Quoting from amsthdoc.pdf

In AMS document classes, when numbers are swapped, the style of the numbers matches that of section headings; this may not be the same style as the rest of the theorem heading.

That's what's causing the problem. If you get rid of \swapnumbers then you should be fine. Or if you really want swapnumbers, you might need to do some jiggery pokery with the section fonts or some such...

The ntheorem package is more powerful, and might provide a simpler way to achieve what you want. Very quickly, you could do this.

%\documentclass[reqno]{amsart}
\documentclass{article}
\usepackage{ntheorem, lipsum}
\theoremstyle{change}
\newtheorem{thm}{Theorem}[section]
\begin{document}
\begin{thm}
\lipsum
\end{thm}
\end{document}

Note the change of documentclass: there seems to be a conflict between amsart and ntheorem.

2
  • Annoyingly, amsart also seems to conflict with titlesec so my preferred way of hacking your section headings into bold so that they fit with the theorem style doesn't work...
    – Seamus
    Apr 6, 2011 at 14:54
  • 2
    re conflict between amsart and ntheorem, that is to be expected. amsart doesn't load amsthm, those features are built in directly; that is true for all ams document classes. in fact, the amsthm package is slightly different (e.g. in choice of heading fonts) from what's in the document classes. as someone has already said, what's in the document classes is tailored for ams style. if something different is wanted, creating a derivative class (or using a different one entirely) is probably the way to go. Apr 6, 2011 at 17:45
2

Use the asmthm style file and then

\newtheoremstyle{common}
    {6pt plus 5\p@ minus 2\p@}% above space (default)
    {6pt plus 5\p@ minus 2\p@}% below space
    {\itshape}% body font
    {0em}% indent
    {\bfseries}% head font
    {}% punct after head
    {.5em}% space
    {}% custom
\theoremstyle{common}

%%%With Chapter Number
\newtheorem{theorem}{Theorem}[chapter]%
2
  • Thorsten edited your post and I approved it. You can mark code by indenting four spaces, or by selecting the code and clicking the 10101 button.
    – Seamus
    Apr 6, 2011 at 13:24
  • I edited my question. I am actually doing something like that but the number appears in normal font instead of bold.
    – Andrea
    Apr 6, 2011 at 13:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .