Open Wrzlprmft opened 6 years ago
I think unicode-math should not only add \__um_switchto_up:
to \Url@FormatString
but also switch the digits back to the symoperator family: (I'm using here \Url@MathSetup for the patch as it is executed behind the \__um_switchto_up:
):
\documentclass{article}
\usepackage{unicode-math}
\usepackage{url}
\setmathfont{Asana Math}
\setmathfont[range=up/{num}->sf]{Asana Math}
\usepackage{xpatch}
\makeatletter
\preto\Url@MathSetup
{%
\Umathcode 48=7\symoperators 48
\Umathcode 49=7\symoperators 49
\Umathcode 50=7\symoperators 50
\Umathcode 51=7\symoperators 51
\Umathcode 52=7\symoperators 52
\Umathcode 53=7\symoperators 53
\Umathcode 54=7\symoperators 54
\Umathcode 55=7\symoperators 55
\Umathcode 56=7\symoperators 56
\Umathcode 57=7\symoperators 57
}
\makeatother
\begin{document}
$1=a$
\url{a1b2/~#c3d4e56789}
\urlstyle{sf}
\url{a1b2/~#c3d4e56789}
\urlstyle{rm}
\url{a1b2/~#c3d4e56789}
\end{document}
Description
If I change the math font for a range of characters, these characters break in URLs set by hyperref.
Check/indicate
Minimal example demonstrating the issue
In the output the numbers are replaced by spaces.
Further details
Issue #228 is similar