latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
245 stars 29 forks source link

Re-do radicals setup #476

Open wspr opened 6 years ago

wspr commented 6 years ago

Description

Radicals are currently set up with:

\tl_set:Nn \l_@@_radicals_tl {\sqrt \longdivision}

This should be done explicitly in unicode-math-table.tex instead.

Check/indicate

Minimal example demonstrating the issue

Doesn't work:

\documentclass{article}
\usepackage{unicode-math}
\ExplSyntaxOn
\tl_set:Nn \l__um_radicals_tl {\sqrt\longdivision\cuberoot}
\ExplSyntaxOff
\setmathfont{xits-math.otf}
\begin{document}

Further details

eg9 commented 6 years ago

I see that \sqrt, \cuberoot, \fourthroot and \longdivision are marked as \mathopen in unicode-math-tables.tex.

I think that a class marker such as \mathradical should be used (analogously to \mathalpha, \mathfence, \mathaccent, \mathaccentwide and similar new markers).

wspr commented 6 years ago

Exactly my line of thinking :)

Originally unicode-math-table.tex was fairly limited, and the radical code was written very long ago. When I started adding to the "math classes" I never got around to doing the same for the radicals (largely because they're such a small set).

khaledhosny commented 6 years ago

While at it, it would be nice to handle the Arabic versions of \cuberoot and \fourthroot as well: U+0606 ARABIC-INDIC CUBE ROOT ؆ U+0607 ARABIC-INDIC FOURTH ROOT ؇