# Unicode math and double factorial

I must confess that the details of font usage and related packages are pretty fuzzy to me. That said, I am under the impression that to use the TeX Gyre fonts, my document must look like the following (compile with lualatex):

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setromanfont{Tex Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
\begin{document}
$(2n)!!$
\end{document}


My question is regarding the appearance of the double factorial in the above. With the preamble removed, the double factorial appears as I would hope, but has extra(?) spacing in the document above. I can manually correct for the spacing, but then if I change fonts the spacing is off again. Why does the spacing change and is it possible to get the desired spacing without manual intervention?

classically ! is mathclose but unicode math sets it as mathpunct which makes two adjacent ones have \thinmuskip between them. You can use {!}{!} to avoid that.
Unicode has a !! character which unicode-math makes available as \Exclam but unfortunately it's not in this font, the log shows
Missing character: There is no ‼ (U+203C) in font TeXGyreTermesMath:mode=base;

• Thanks, {!}{!} fixes the spacing. Out of curiosity, is there an argument to be made for whether mathclose or mathpunct is the appropriate classification? – Scott H. May 8 '16 at 20:36
• in math ! is pretty much only used for factorial so mathclose probably works better although it isn't really a mathclose in the sense of ) I'll complain to Will. see what happens:-) – David Carlisle May 8 '16 at 20:40