Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using thmtools to define a custom example environment. I'm styling the head as italic, but the number is not being styled correctly: it appears in normal mode instead of italic (the dot after the number is being styled correctly). If I style the head as bold, then the number is styled correctly. Am I missing something or is it a bug?

Minimal working example:

\documentclass[11pt,twoside]{article}

\usepackage{amsthm,thmtools}

\declaretheoremstyle[
   name=Example,
   spaceabove=\topsep, spacebelow=\topsep,
   headindent=0pt, postheadspace=1ex,
   headfont=\normalfont\itshape, headpunct=.,
   bodyfont=\normalfont,
   qed=$\diamond$
]{example}
\declaretheorem[style=example]{example}

\begin{document}
\begin{example}
test
\end{example}
\end{document}
share|improve this question

1 Answer 1

up vote 5 down vote accepted

The problem is that thmtools defines

\def\NUMBER{\bgroup\@upn{##2}\egroup}

and

\let\@upn=\textup

so the change to italics won't have any effect on the number that will always be typeset in up-right font; one way to override this setting (and I am not sure if this is a good typographical practice) is to use preheadhook to redefine \@upn:

\documentclass[11pt,twoside]{article}

\usepackage{amsthm,thmtools}
\makeatletter
\declaretheoremstyle[
   preheadhook=\renewcommand\@upn{},
   name=Example,
   spaceabove=\topsep, spacebelow=\topsep,
   headindent=0pt, postheadspace=1ex,
   headfont=\itshape,notefont=\itshape, headpunct=.,
   bodyfont=\normalfont,
   qed=$\diamond$
]{example}
\declaretheorem[style=example]{example}
\makeatother

\begin{document}
\begin{example}
test
\end{example}
\end{document}

enter image description here

share|improve this answer
    
\let\@upn\@firstofone will also remove a pair of braces; just nitpicking. :) I would prefer an upright number too. –  egreg Jan 12 '13 at 20:22

Your Answer

 
discard

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.