TransWikia.com

Package unicode-math: map letters in math mode to normal ASCII range by default

TeX - LaTeX Asked by Jarno_C-137 on October 24, 2020

With XeLaTeX I use fontspec and unicode-math with no additional options to produce pdfs and that works as expected in most cases. However under certain circumstances (specified in the end of this question) I want the (latin) letters in math mode to map directly to their normal ASCII counterparts and just use the proper font (italic, bold, etc…) to produce the correct visual output as a default behaviour.

I could achieve that for specific commands e.g. $mathit{x}$ would do that correctly (I assume) with following code but $x$ still maps the ASCII-letter x in the source to U+1D465 code point in output.

documentclass{article}

usepackage{fontspec}       
usepackage{unicode-math}
unimathsetup{
    mathrm=text,
    mathit=text,
    mathsf=text,
    mathbf=text,
    mathtt=text,
    math-style=ISO,
}

begin{document}
$mathit{x}$ <-- maps to ASCII x

$x$ <-- still maps to U+1D465 
end{document}

So shortly: how to make unicode-math to use ASCII-letters in the output by default?

The reasons are:

1: Generally uniformity of visual appearance as with some fonts the normal italic and math italic fonts differ significantly from each other.

2: (Most important) I’m trying to produce svgs from some document fragments by first producing pdf (via template that imports the fragment) and then using inkscape to convert to svg. This has so far produced the best results but inkscape won’t render the math letters correctly and I’m also worried of web compatibility.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP