latex3 / unicode-math

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

[Feature request] Option to choose if SCRIPT unicode input must be rendered with scr of cal #614

Open pierrecagne opened 1 year ago

pierrecagne commented 1 year ago

Description

When using unicode-math with unicode character in the .tex source, the inputs 𝒜 to 𝒵 (MATHEMATICAL SCRIPT CAPITAL letters, although some of them like ℒ and ℬ seem to be in the Letterlike Symbols block instead) in math mode are rendered with the src style of the main math font. I suggest there is an option to the unicode-math package so that one can choose that these unicode inputs are rendered by the scr or cal style of the rest of the document selected by range.

Add info or delete as appropriate:

Minimal example demonstrating the issue

The following source:

\documentclass{minimal}

\usepackage{fontspec}
\usepackage{unicode-math}

\setmathfont{Libertinus Math Regular}
\setmathfont{TeX Gyre Pagella Math}[range=cal]
\setmathfont{Latin Modern Math}[range=scr]

\begin{document}
Unicode input: $ℒ$

Mathcal input: $\mathcal L$

Mathscr input: $\mathscr L$
\end{document}

renders 3 different Ls. The first of which is the src style of Libertinus Math Regular.

A script=... option of the package would allow the user to choose how to render this first L:

\documentclass{minimal}

\usepackage{fontspec}
\usepackage[script=cal]{unicode-math}

\setmathfont{Libertinus Math Regular}
\setmathfont{TeX Gyre Pagella Math}[range=cal]
\setmathfont{Latin Modern Math}[range=scr]

\begin{document}
Unicode input: $ℒ$

Mathcal input: $\mathcal L$

Mathscr input: $\mathscr L$
\end{document}

In that case, the first L is rendered as the second one.