2

Given that I have a unicode math font with a glyph that I want to use in math mode, how can I, using the unicode-math package, define the glyph? I can get this to kind of work using \DeclareUTFcharacter, but with a resulting "invalid in math mode" warning.

\documentclass{article}
\usepackage{xunicode}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}
\DeclareUTFcharacter[\UTFencname]{x24C7}{\circledR} % "LaTeX Warning: Command \circledR invalid in math mode"
%\UnicodeMathSymbol{"024C7}{\circledR} {\mathrel}{circled R}
%\__um_process_symbol_noparse:nnn {"024C7}{\circledR} {\mathbin}
\begin{document}
circleddash: $\circleddash$
\\circledparallel: $\circledparallel$
\\circledR: $\circledR$
\end{document}
1

I'm not sure there's an official interface; anyway, this works.

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}

\Umathchardef\circledR="0 \symsymbols "24C7

\begin{document}

circleddash: $\circleddash$

circledparallel: $\circledparallel$

circledR: $\circledR$

\end{document}

enter image description here

1
  • Thank you @egreg—that's very helpful. Yes, an interface would be useful (as you suggested some 5 years ago)... if someone had the time to implement one. – Daniel J. Greenhoe Nov 26 '20 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.