6

When compiling this code with lualaTeX (from TeXLive 2011),

\documentclass{minimal}
\usepackage{unicode-math}
\usepackage{ntheorem,thmtools}
\setmathfont{xits-math}
\makeatletter
\newtheoremstyle{mathfonttest}
  {\item[\theorem@headerfont $ABC$ DEF $:!?$ ]} % 1. option
  {\item[$ABC$ DEF ]} % 2. option
 \makeatother
\declaretheorem[style=mathfonttest]{test}

\begin{document}
\begin{test} % 1. option, ABC invisible
  Something. 
\end{test}
\begin{test}[triggers 2. option] % 2. option, ABC visible
  Something.
\end{test}
\end{document}

the first ABC, and more generally any greek or latin character in inline math mode – when preceded by \theorem@headerfont – is invisible and I have no clue why. What I want to do is use math code in optional or alternative description to a definition like '1.1. Definition (of $pi$)'.

Does anybody know how to solve this or circumvent it?

6
  • I can't reproduce the problem. When I copied and pasted your code, some strange invisible characters appeared, and lualatex rejected the file. Everything worked after I deleted the invisible characters, though. Sep 1, 2012 at 15:21
  • Do you mean 'doesn't get printed when compiled' with 'invisible' (as I did)? I'm not sure I understand what you mean. Where did your strange characters appear?
    – k.stm
    Sep 1, 2012 at 15:57
  • No, I mean you can't see them when you edit the code. However, I just tried again and they didn't appear, so it seems it was just a strange copy-paste failure. Sep 1, 2012 at 16:03
  • How up to date your TeX installation is, do you have the bold XITS math font installed? This example shows fine here. Sep 1, 2012 at 17:01
  • I just realised I use TeXLive 2011 since I needed something from TLcontrib which doesn't seem to work with 2012 yet.
    – k.stm
    Sep 1, 2012 at 17:59

1 Answer 1

6

The problem is that \theorem@headerfont calls \theorem@checkbold and this macro does

\if b\expandafter\@car\f@series\@nil\boldmath\fi

This is the reason for the disappearance: the font used is boldface and this causes \boldmath to come into action but XITS Math has no bold version.

If you want to use ntheorem and math in the theorem labels, then you need to use a non boldface font.

The most recent TeX distributions (TeX Live 2012) should have a bold version of XITS Math, so you can try updating yours.

3
  • Thanks. Now I could somehow circumvent this problem by putting \unboldmath in my definition of the theorem styles. But this doesn't really solve the problem for me since xits-math DOES have bold-face characters, which could be used in a bold-face font. Is there any way I could use them?
    – k.stm
    Sep 1, 2012 at 16:13
  • 1
    XITS math has bold version now, the example works fine here. Sep 1, 2012 at 17:02
  • @KhaledHosny It surely depends on the installed TeX distribution. I'll add this to my answer.
    – egreg
    Sep 1, 2012 at 17:40

You must log in to answer this question.

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