2

I'm using unicode-math like so in my preamble:

\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

Compiling with XeLaTeX, for $g \circ f$, I get this:

enter image description here

But this is different as what I get just deleting the two previous lines of code:

enter image description here

Noticeably, the \circ you get without the previous two lines of code is bigger than the one you get with them.

I would like to know: is there a way in which I could still use unicode-math (with the previous two lines of code) yet getting the \circ I would get without them?

This is a MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

\begin{document}
\[
g \circ f
\]
\end{document}
5
  • Without unicode-math you get the normal \circ symbol in the Computer Modern Symbol font. Apparently, the developers of Latin Modern thought it is too big (and I can agree with them).
    – egreg
    Oct 13, 2021 at 21:54
  • 1
    Aside: Do not load the fontenc package under XeLaTeX (or LuaLaTeX).
    – Mico
    Oct 13, 2021 at 21:54
  • @egreg I wanted to keep the original size to use it as in \accentset{\circ}{A} (using the package accents), to denote the topological interior of a set. Because in this case Computer Modern Symbol's \circ is just the right size and the one from Latin Modern ends up being too small. Oct 13, 2021 at 22:40
  • 1
    It doesn't have a significantly different size, but for use as an accent you would normally use \ocirc in unicode-math. Oct 13, 2021 at 23:22
  • You can pick another font’s \circ with \setmathfont[range=\circ, Scale=MatchUppercase]{STIX TWo Math}. Or your math font of choice.
    – Davislor
    Oct 14, 2021 at 4:49

1 Answer 1

1

Apparently, the developers of Latin Modern deemed the Computer Modern \circ symbol too big (and I don't disagree with them). When you don't load font packages (including unicode-math), the default math fonts for XeLaTeX is the standard Computer Modern family. When you load unicode-math, the default is Latin Modern Math (be it selected with \setmathfont or not).

On the other hand, the fact that \accentset{\circ}{U} gives a decent result with the Computer Modern math fonts is more of an accident than a feature: it's just because the symbol is big that it seems to sit correctly above a letter.

Let's try some examples based on

\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}

%\usepackage{unicode-math}           % for 2 and 3
%\setmathfont{Latin Modern Math}     % for 2
%\setmathfont{NewCMMath-Regular.otf} % for 3

\begin{document}

\begin{gather*}
g \circ f \\
\mathring{U}\accentset{\circ}{U}
\end{gather*}

\end{document}

Example 1 – No unicode-math

enter image description here

Example 2 – With Latin Modern

enter image description here

Example 3 – With NewCMMath

enter image description here

Comments

As you see, NewCM has taken from Latin Modern.

After looking at the result, my opinion is strongly favoring \mathring over \accentset{\circ}. But since this is just opinion, let's see how we can do.

\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}

\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

\DeclareSymbolFont{CMsymbols}{OMS}{cmsy}{m}{n}
\DeclareMathSymbol{\CMcirc}{\mathbin}{CMsymbols}{"0E}


\begin{document}

\begin{gather*}
g \circ f \\
\mathring{U}\accentset{\CMcirc}{U}
\end{gather*}

\end{document}

This defines \CMcirc as the Computer Modern \circ symbol, so you can use it in \accentset.

enter image description here

You must log in to answer this question.

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