# How to change the mathematical symbol class of a unicode math symbol?

In unicode-math-table.tex the math class of many symbols is defined by lines like:

\UnicodeMathSymbol{"026AC}{\mdsmwhtcircle}{\mathord}{medium small white circle}%

Now if I want to use this particular circle as binary operator for function composition I have to change its math class to \mathbin. What I would like to do in the preamble is something like:

\usepackage{unicode-math}%
\UnicodeMathSymbol{"026AC}{\mdsmwhtcircle}{\mathbin}{medium small white circle}%


Thereby overwriting unicode-math’s defaults. However the marco \UnicodeMathSymbol seems only to be available internally, when unicode-math processes unicode-math-table.tex.

Of course I can copy unicode-math-table.tex to a local texmf-tree, modify it and achieve the desired result. But I would prefer to keep this change local to the document and make the change in the preamble.

How can I overwrite unicode-math’s defaults with regard to the symbols math class?

There are two choices; one is easier:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITS Math}

\newcommand{\bcirc}{\mathbin{\mdsmwhtcircle}}

\begin{document}
$f\bcirc g$
\end{document}


The second one is more complicated:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITS Math}

\ExplSyntaxOn
\AtBeginDocument
{
\um_process_symbol_noparse:nnn {"026AC}{\mdsmwhtcircle}{\mathbin}
}
\ExplSyntaxOff

\begin{document}
$f\mdsmwhtcircle g$
\end{document}


Unfortunately there is apparently no higher level tool for setting symbols.

• The second solution is what I am looking for. I can just write f⚬g and get the correct spacing. No command sequences needed. – uli Feb 23 '14 at 14:39
• Just a quick note, the latest changes to unicode-math have changed the internal command used in the second solution. it should now be \__um_process_symbol_noparse:nnn (the command is prefixed with a double underscore. – ArTourter Aug 3 '15 at 15:37
• @ArTourter Which makes it a private command. :-(` There should be some interface to associate a Unicode point to a command with the math type. – egreg Aug 3 '15 at 16:54
• @egreg I am not quite sure what the fact that it has become a private command actually entails. Your solution still works. – ArTourter Aug 3 '15 at 18:59