I specifically want "⦂" (U2982, Z NOTATION TYPE COLON) to appear as a colon with mathrel spacing (or better yet, the way amsmath redefines \colon
)
But redefining \typecolon
with \AtBeginDocument
doesn't work. I have also tried using lower level unicode-math commands. A MWE containing my attempts follows:
%!TEX program = lualatex
\documentclass{article}
\usepackage[math-style=ISO, partial=upright]{unicode-math}
\setmathfont{LibertinusMath-Regular.otf}
\AtBeginDocument{
\let\typecolon\colon % fails
% \renewcommand{\typecolon}{\nobreak\mskip2mu\mathpunct{}\nonscript
% \mkern-\thinmuskip{:}\mskip6muplus1mu\relax} % fails
}
% \ExplSyntaxOn
% \AtBeginDocument{
% \__um_process_symbol_noparse:nnn {"02982}{:}{\mathrel} % fails
% \__um_process_symbol_noparse:nnn {"02982}{\colon}{\mathrel} % fails
% \__um_remap_symbol:nnn {\`⦂} {\mathrel} {"02236} % fails
% \__um_remap_symbol:nnn {\typecolon} {\mathrel} {"02236} % fails
% }
% \ExplSyntaxOff
\begin{document}
With explicit symbol: $f ⦂ A → B.$
With \verb|\symbol|: $f \symbol{"02982} A → B.$
With \verb|\typecolon|: $f \typecolon A → B.$
\end{document}
My assumption was that unicode-math defines the bare unicode character is defined as an ‘active character’ which expands to \typecolon
, as per unicode-math-table.tex but, obviously, I'm wrong or redefining \typecolon
would work.
What is the correct approach here? And where is my misunderstanding? Thanks in advance for all replies.
Version details:
I am using LuaLaTeX with unicode-math:
>_ lualatex --version
This is LuaHBTeX, Version 1.14.0 (TeX Live 2022/dev/Debian) […]
Specifically, that which is packaged with Ubuntu 22.04.
__um
ones doesn't work but... because they're "low level" what do you expect...__um
functions, they've been used to good effect, so I expected they might work. They're not part of the public interface but that doesn't mean they're not useful, right?