I've recently been experimenting with typesetting and I stumbled upon an issue, where the following preamble:
\documentclass[12pt,a4paper]{memoir}
\usepackage{stix2}
\usepackage{mathspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{fontspec}
\setmainfont[
Extension={.otf},
UprightFont={-Regular},
BoldFont={-Bold},
ItalicFont={-Italic},
BoldItalicFont={-BoldItalic}
]{StixTwoText}
\setmathfont(Latin,Greek){StixTwoText-Italic.otf}
\setmathfont(Digits){StixTwoText-Regular.otf}
\setmathrm[BoldFont={StixTwoText-Bold.otf}]{StixTwoText-Regular.otf}
Generates errors written in the title. Removing both the \setmathfont and \setmathrm OR \usepackage{stix2} commands fixes the issue, but changes the math fonts.
Can I somehow use the STIX Two Text Italic font in math mode while still having the alternate math symbols defined in stix2?


mathspecat all? I believe thatunicode-mathis better with the fonts you want. – egreg Jul 19 '21 at 17:02unicode-math. How would I go about implementing the above code with it? – J0K3R_12QQ Jul 19 '21 at 17:07