I tried to load STIX Two with fontspec
, STIX Two Math with unicode-math
, and load newtxtt
package directly. However, it seems that the document cannot be complied properly: If I load newtxtt
before fontspec
, then the monospace font will still be the default one; if I load it after fontspec
(as well as the \setmainfont
part, see the code sample) but before unicode-math
, then the file cannot be compiled due to an 'Insufficient math symbols' error; if I load it after unicode-math
, then though the math font is STIX 2 and the monospace font is newtxtt, the text font changed to the default computer modern.
\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{fontspec}
\setmainfont {STIX2Text-Regular}[
Extension=.otf,
BoldFont=STIX2Text-Bold,
ItalicFont=STIX2Text-Italic,
BoldItalicFont=STIX2Text-BoldItalic,
]
\usepackage[zerostyle=b]{newtxtt}
\usepackage{unicode-math}
\setmathfont{STIX2Math.otf}[StylisticSet=02, StylisticSet=08]
\usepackage{cabin}
\usepackage{dutchcal}
\usepackage{ulem}
\usepackage{leftidx}
\usepackage{physics}
\usepackage{mattens}
\usepackage[e]{esvect}
\usepackage{units}
\usepackage{minted}
\begin{document}
\usemintedstyle{murphy}
\begin{minted}{python}
# Propagate two balls with velocities v1 and v2, print "The
# two balls collided" if they collide:
while 1==1:
ball1.pos=ball1.pos+v1*dt
ball2.pos=ball2.pos+v2*dt
if mag(ball1.pos-ball2.pos) < ball1.radius+ball2.radius:
print("The two balls collided")
\end{minted}
\end{document}