| 1 |
\documentclass[10pt,a4paper]{article} |
| 2 |
\usepackage[width=210mm, height=297mm, left=15mm, right=15mm, top=15mm, bottom=15mm]{geometry} |
| 3 |
\usepackage{mathtools} |
| 4 |
\usepackage{amssymb} |
| 5 |
\usepackage{babel} |
| 6 |
\usepackage{array,booktabs} |
| 7 |
\usepackage{listings,xcolor} |
| 8 |
|
| 9 |
\usepackage{xstix2} |
| 10 |
\setsansfont{Lato}[Scale=MatchLowercase] |
| 11 |
\setmonofont{Anonymous Pro} |
| 12 |
\newfontfamily\STIX{STIX2} |
| 13 |
|
| 14 |
\usepackage{hyperref} |
| 15 |
|
| 16 |
\def\cmd#1{{\tt\textbackslash#1}} |
| 17 |
\def\Hfil{\mbox{}\hfil\mbox{}} |
| 18 |
\DeclareRobustCommand\XeTeX{\reflectbox{X}\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.135em{\protect\TeX}} |
| 19 |
\makeatletter |
| 20 |
\DeclareRobustCommand\LuaTeX{L\kern-.20em\lower.5ex% |
| 21 |
\hbox{\check@mathfonts\fontsize\sf@size\z@ |
| 22 |
\math@fontsfalse\selectfont U}\kern-.4em\lower.275ex\hbox{\sbox\z@ A\vbox to\ht\z@{\hbox{\check@mathfonts\fontsize\sf@size\z@ |
| 23 |
\math@fontsfalse\selectfont A}\vss}}\kern-.175em\TeX} |
| 24 |
\makeatother |
| 25 |
|
| 26 |
\def\MathSample{$x={\displaystyle∫_0^u\sqrt{\frac{a^2+x^2}{b^2-x^2}}\,dx = E(𝛿,r)}\quad[b>u⩾0],\quad 𝛿=\arccos\tfrac{u}{b},\quad r=\tfrac{b}{\sqrt{a^2+b^2}}.$} |
| 27 |
\def\SampleMath{$x={\displaystyle∫_0^u\sqrt{\frac{a^2+x^2}{b^2-x^2}}\,dx = E(𝛿,r)}\dots$} |
| 28 |
|
| 29 |
|
| 30 |
\begin{document} |
| 31 |
|
| 32 |
\title{\sf The xstix2 package} |
| 33 |
\author{Alexey Kuznetsov} |
| 34 |
\date{version 2026/03/01} |
| 35 |
\maketitle |
| 36 |
\begin{abstract} |
| 37 |
Using resources of the \textsf{fontspec} package, the \textsf{xstix2} package adjusts letter widths of the STIXTwo fonts and makes all the fonts in this collection available. |
| 38 |
\end{abstract} |
| 39 |
|
| 40 |
|
| 41 |
The STIXTwo collection contains following OpenTyype fonts:\\[1ex] |
| 42 |
\Hfil\begin{tabular}{l >\itshape l} |
| 43 |
\multicolumn{2}{c}{STIXTwoMath-Regular,}\\ |
| 44 |
STIXTwoText-Regular, & STIXTwoText-Italic,\\ |
| 45 |
\STIXMedium STIXTwoText-Medium, & \STIXMedium STIXTwoText-MediumItalic,\\ |
| 46 |
\bfseries STIXTwoText-SemiBold, & \bfseries STIXTwoText-SemiBoldItalic,\\ |
| 47 |
\STIXBold STIXTwoText-Bold, & \STIXBold STIXTwoText-BoldItalic.\\ |
| 48 |
\end{tabular}\\[1ex] |
| 49 |
Like most other TrueType and OpenType fonts, all fonts of the collection are designed only at 10pt, at the same time, font sizes vary in \LaTeX\ documents from 5pt (\cmd{tiny}) to 24.88pt (\cmd{Huge}). |
| 50 |
\TeX\ generates missing fonts using proportional scaling, making small text difficult to read, while large text appears clunky because fonts with different optical sizes require larger letters to be narrower. |
| 51 |
Through the \textsf{FakeStretch} feature, the \textsf{fontspec} package enables \LuaTeX\ and \XeTeX\ to perform non-proportional scaling.\footnote{% |
| 52 |
\textsf{Fontspec's} author Will Robertson warns: ``Please don’t overuse these (Fake) features; they are \textit{not} a good alternative to having the real shapes.'' |
| 53 |
But STIX Two fonts were released five years ago and their development has ceased. In this case, I think, `\textit{not} a good alternative` is better than nothing.} |
| 54 |
The \textsf{xstix2} package implements this feature for the STIXTwo collection and provides access to all it's fonts. |
| 55 |
To do that, it loads the \textsf{fontspec} and \textsf{unicode-math} packages and uses the fonts from the \textsf{stix2-otf} and \textsf{xits} packages. |
| 56 |
The latter contains a bold mathematical font, missing from the STIXTwo collection. |
| 57 |
When loading, \textsf{xstix2} checks the compiler, and if Pdf\LaTeX{} is used, it does nothing. |
| 58 |
|
| 59 |
For basic use, no package options are required:\\[.5ex] |
| 60 |
\mbox{}\hfil\verb+\usepackage{xstix2}+\\[.5ex] |
| 61 |
In this case, Regular/\textit{Italic}/\textbf{SemiBold}/\textbf{\textit{SemiBoldItalic}} fonts are used as the main. |
| 62 |
For rest of fonts two declarations are defined: \cmd{STIXMedium} {\STIXMedium activates fonts of medium weight, as in this example,} \cmd{STIXBold} {\STIXBold activates bold fonts of the collection.} |
| 63 |
STIXTwoMath-Regular and XITSMath-Bold are used as math fonts of normal and bold versions. |
| 64 |
|
| 65 |
\medskip |
| 66 |
There are two options for \cmd{usepackage[\dots]\{xstix2\}}: |
| 67 |
\hspace*{1em} |
| 68 |
\begin{tabular}{ll} |
| 69 |
[bold] & use bold fonts;\\{}% |
| 70 |
[original] & use proportionally scaled fonts. |
| 71 |
\end{tabular} |
| 72 |
|
| 73 |
\medskip |
| 74 |
\noindent The table below illustrates them. It's last column contains names of files with \textsf{fontspec's} descriptions of the main fonts. |
| 75 |
|
| 76 |
\begin{center} |
| 77 |
\begin{tabular}{ lll >\tt >\small l @{\ } >\small l >\sf l} \toprule |
| 78 |
\sf Options &\sf Features & \sf Main font weights & |
| 79 |
\multicolumn{2}{c}{\sf Additional font weights} & fontspec \\ \midrule |
| 80 |
& stretched & Regular, \bf SemiBold & \cmd{STIXBold}, & \cmd{STIXMedium} |
| 81 |
& XSTIX2 \\{}% |
| 82 |
[bold] & stretched & Regular, \STIXBold Bold & \cmd{STIXBold}, & \cmd{STIXMedium} |
| 83 |
& XSTIX2B \\{}% |
| 84 |
[original] & & Regular, \bf SemiBold & \cmd{STIXBold}, & \cmd{STIXMedium} |
| 85 |
& STIX2 \\{}% |
| 86 |
[original, bold] & & Regular, \STIXBold Bold & \cmd{STIXBold}, & \cmd{STIXMedium} |
| 87 |
& STIX2B \\ |
| 88 |
\bottomrule |
| 89 |
\end{tabular} |
| 90 |
\end{center} |
| 91 |
|
| 92 |
When \textsf{xstix2} is loaded with the [bold] option, {\STIXBold Bold fonts are used as the main} (\cmd{bf}, \cmd{bfseries}) and the declaration \cmd{STIXBold} {\bf activates SemiBold fonts.} |
| 93 |
The option [original] cancels non-proportional scaling of fonts. |
| 94 |
|
| 95 |
Examples of text typed with fonts having different sizes and weights are presented below. |
| 96 |
|
| 97 |
Happy \TeX ing! |
| 98 |
|
| 99 |
\newpage |
| 100 |
\centerline{\Large\bf Font samples} |
| 101 |
|
| 102 |
%------------------------------------------------------------------------------------------- |
| 103 |
\vspace{\baselineskip}\centerline{Regular fonts (\cmd{normalfont})} |
| 104 |
\noindent Test string to compare Latin letters in different fonts.\hfill \cmd{rm}\\ |
| 105 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 106 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 107 |
|
| 108 |
\medskip\noindent{\scshape% |
| 109 |
Test string to compare Latin letters in different fonts.\hfill \cmd{sc}\\ |
| 110 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 111 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.} |
| 112 |
|
| 113 |
\medskip\noindent{\itshape% |
| 114 |
Test string to compare Latin letters in different fonts.\hfill \cmd{it}\\ |
| 115 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 116 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 117 |
|
| 118 |
\medskip\noindent\scshape% |
| 119 |
Test string to compare Latin letters in different fonts.\hfill \cmd{it}\cmd{scshape}\\ |
| 120 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 121 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.}\\ |
| 122 |
|
| 123 |
%------------------------------------------------------------------------------------------- |
| 124 |
\STIXMedium\centerline{Medium fonts (\cmd{STIXMedium})} |
| 125 |
\noindent Test string to compare Latin letters in different fonts.\\ |
| 126 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 127 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 128 |
|
| 129 |
\medskip\noindent{\scshape% |
| 130 |
Test string to compare Latin letters in different fonts.\hfill \cmd{scshape}\\ |
| 131 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 132 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.} |
| 133 |
|
| 134 |
\medskip\noindent{\itshape% |
| 135 |
Test string to compare Latin letters in different fonts.\hfill \cmd{itshape}\\ |
| 136 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 137 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 138 |
|
| 139 |
\medskip\noindent\scshape% |
| 140 |
Test string to compare Latin letters in different fonts.\hfill \cmd{itshape}\cmd{scshape}\\ |
| 141 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 142 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.}\\ |
| 143 |
|
| 144 |
%------------------------------------------------------------------------------------------- |
| 145 |
\bf\centerline{SemiBold fonts (\cmd{bf})} |
| 146 |
\noindent Test string to compare Latin letters in different fonts.\hfill \cmd{bf}\\ |
| 147 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 148 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 149 |
|
| 150 |
\medskip\noindent{\scshape% |
| 151 |
Test string to compare Latin letters in different fonts.\hfill \cmd{bf}\cmd{scshape}\\ |
| 152 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 153 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.} |
| 154 |
|
| 155 |
\medskip\noindent{\itshape% |
| 156 |
Test string to compare Latin letters in different fonts.\hfill \cmd{bf}\cmd{itshape}\\ |
| 157 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 158 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 159 |
|
| 160 |
\medskip\noindent\scshape% |
| 161 |
Test string to compare Latin letters in different fonts.\hfill \cmd{bf}\cmd{itshape}\cmd{scshape}\\ |
| 162 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 163 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.} |
| 164 |
|
| 165 |
%------------------------------------------------------------------------------------------- |
| 166 |
\bigskip\STIXBold\centerline{Bold fonts (\cmd{STIXBold})} |
| 167 |
\noindent Test string to compare Latin letters in different fonts.\\ |
| 168 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 169 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 170 |
|
| 171 |
\medskip\noindent{\scshape% |
| 172 |
Test string to compare Latin letters in different fonts.\hfill \cmd{scshape}\\ |
| 173 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 174 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.} |
| 175 |
|
| 176 |
\medskip\noindent{\itshape% |
| 177 |
Test string to compare Latin letters in different fonts.\hfill \cmd{itshape}\\ |
| 178 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 179 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах. |
| 180 |
|
| 181 |
\medskip\noindent\scshape% |
| 182 |
Test string to compare Latin letters in different fonts.\hfill \cmd{itshape}\cmd{scshape}\\ |
| 183 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 184 |
Тестовая строка для сравнения букв кириллицы в различных шрифтах.}\\ |
| 185 |
|
| 186 |
%------------------------------------------------------------------------------------------- |
| 187 |
\newpage |
| 188 |
\normalfont\centerline{\large Regular fonts} |
| 189 |
|
| 190 |
\vspace{2\baselineskip} |
| 191 |
\noindent\tiny 5pt\\ |
| 192 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{original}}\\ |
| 193 |
Test string to compare width of Latin letters in different fonts.\\ |
| 194 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\hfill\textsc{original}}\\ |
| 195 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 196 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\hfill\textsc{original}}\\ |
| 197 |
Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\\ |
| 198 |
\MathSample |
| 199 |
|
| 200 |
\vfill\noindent\normalsize 10pt\\ |
| 201 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{orig.}}\\ |
| 202 |
Test string to compare width of Latin letters in different fonts.\\ |
| 203 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\hfill\textsc{orig.}}\\ |
| 204 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 205 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\hfill\textsc{orig.}}\\ |
| 206 |
Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\\ |
| 207 |
\MathSample |
| 208 |
|
| 209 |
\vfill\noindent\Large 14.4pt\\ |
| 210 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{orig.}}\\ |
| 211 |
Test string to compare width of Latin letters in different fonts.\\ |
| 212 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών\dots\hfill\textsc{orig.}}\\ |
| 213 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών\dots\\ |
| 214 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы в различных\dots\hfill\textsc{orig.}}\\ |
| 215 |
Тестовая строка для сравнения ширины букв кириллицы в различных\dots\\ |
| 216 |
\MathSample |
| 217 |
|
| 218 |
\vfill\noindent\mathversion{normal}\Huge 24.88pt\\ |
| 219 |
{\STIX Test string to compare width of Latin\dots\hfill\textsc{orig.}}\\ |
| 220 |
Test string to compare width of Latin\dots\\ |
| 221 |
{\STIX Δοκιμαστική συμβολοσειρά για τη\dots\hfill\textsc{orig.}}\\ |
| 222 |
Δοκιμαστική συμβολοσειρά για τη\dots\\ |
| 223 |
{\STIX Тестовая строка для сравнения\dots\hfill\textsc{orig.}}\\ |
| 224 |
Тестовая строка для сравнения\dots\\ |
| 225 |
\SampleMath |
| 226 |
|
| 227 |
%------------------------------------------------------------------------------------------- |
| 228 |
\newpage |
| 229 |
\normalsize\bf\boldmath |
| 230 |
\centerline{\large SemiBold text and Bold math} |
| 231 |
|
| 232 |
\vspace{2\baselineskip} |
| 233 |
\noindent\tiny 5pt\\ |
| 234 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{original}}\\ |
| 235 |
Test string to compare width of Latin letters in different fonts.\\ |
| 236 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\hfill\textsc{original}}\\ |
| 237 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές γραμματοσειρές.\\ |
| 238 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\hfill\textsc{original}}\\ |
| 239 |
Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\\ |
| 240 |
\MathSample |
| 241 |
|
| 242 |
\vfill\noindent\normalsize 10pt\\ |
| 243 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{original}}\\ |
| 244 |
Test string to compare width of Latin letters in different fonts.\\ |
| 245 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές\dots\hfill\textsc{original}}\\ |
| 246 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών γραμμάτων σε διαφορετικές\dots\\ |
| 247 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\hfill\textsc{original}}\\ |
| 248 |
Тестовая строка для сравнения ширины букв кириллицы в различных шрифтах.\\ |
| 249 |
\MathSample |
| 250 |
|
| 251 |
\vfill\noindent\Large 14.4pt\\ |
| 252 |
{\STIX Test string to compare width of Latin letters in different fonts.\hfill\textsc{orig.}}\\ |
| 253 |
Test string to compare width of Latin letters in different fonts.\\ |
| 254 |
{\STIX Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών\dots\hfill\textsc{orig.}}\\ |
| 255 |
Δοκιμαστική συμβολοσειρά για τη σύγκριση του πλάτους των ελληνικών\dots\\ |
| 256 |
{\STIX Тестовая строка для сравнения ширины букв кириллицы\dots\hfill\textsc{orig.}}\\ |
| 257 |
Тестовая строка для сравнения ширины букв кириллицы\dots\\ |
| 258 |
\MathSample |
| 259 |
|
| 260 |
\vfill\noindent\Huge 24.88pt\\ |
| 261 |
{\STIX Test string to compare width of Latin\dots\hfill\textsc{orig.}}\\ |
| 262 |
Test string to compare width of Latin\dots\\ |
| 263 |
{\STIX Δοκιμαστική συμβολοσειρά για τη\dots\hfill\textsc{orig.}}\\ |
| 264 |
Δοκιμαστική συμβολοσειρά για τη\dots\\ |
| 265 |
{\STIX Тестовая строка для сравнения\dots\hfill\textsc{orig.}}\\ |
| 266 |
Тестовая строка для сравнения\dots\\ |
| 267 |
\SampleMath |
| 268 |
|
| 269 |
\newpage\centerline{\Large\bf The code} |
| 270 |
\normalfont\small\tt |
| 271 |
\lstset{language=TeX, |
| 272 |
morekeywords={IfFontExistsTF,iftutex}, |
| 273 |
emph={PackageWarning}, emphstyle={\bfseries\color{purple}}, |
| 274 |
emph={[2]DeclareOption,ProcessOptions}, emphstyle={[2]\bfseries\color{blue}}, |
| 275 |
emph={[3]RequirePackage}, emphstyle={[3]\bfseries\color{violet}}} |
| 276 |
|
| 277 |
\begin{lstlisting} |
| 278 |
\ProvidesPackage{xstix2}[2026/02/28] |
| 279 |
\PackageInfo{xstix2}{Extended support for STIXTwo fonts.} |
| 280 |
|
| 281 |
\def\@STIX@{XSTIX2} |
| 282 |
\def\@STIX@Main{XSTIX2} |
| 283 |
\def\@STIX@Bold{XSTIX2Bold} |
| 284 |
|
| 285 |
\DeclareOption{original}{\def\@STIX@{STIX2}} |
| 286 |
\DeclareOption{bold}{\def\@STIX@Bold{\@STIX@ SemiBold}\def\@STIX@Main{\@STIX@ B}} |
| 287 |
\DeclareOption*{\PackageWarning{xstix2.sty}{Package options: original, bold.}} |
| 288 |
\ProcessOptions |
| 289 |
|
| 290 |
\RequirePackage{iftex} |
| 291 |
\iftutex |
| 292 |
\RequirePackage[quiet]{fontspec} |
| 293 |
\RequirePackage{unicode-math} |
| 294 |
\IfFontExistsTF{STIXTwoText-Regular}{ |
| 295 |
\setmainfont{\@STIX@Main} |
| 296 |
\newfontfamily\STIXBold{\@STIX@Bold} |
| 297 |
\newfontfamily\STIXMedium{\@STIX@ Medium} |
| 298 |
\IfFontExistsTF{STIXTwoMath-Regular}{ |
| 299 |
\setmathfont{STIX Two Math} |
| 300 |
\IfFontExistsTF{XITSMath-Bold} |
| 301 |
{ \setmathfont{XITSMath-Bold}[version=bold, Scale= MatchLowercase] |
| 302 |
\setoperatorfont\symup } |
| 303 |
{ \PackageWarning{xstix2.sty}{Install `xits' package to add bold math font.} } |
| 304 |
}{ \PackageWarning{xstix2.sty}{Install `stix2-otf' package to use STIXTwo math font.} } |
| 305 |
}{ \PackageWarning{xstix2.sty}{Install `stix2-otf' package to use STIXTwo fonts.} } |
| 306 |
\else |
| 307 |
\PackageWarning{xstix2.sty}{STIXTwo fonts must be used with `LuaLaTeX' or `XeLaTeX'.} |
| 308 |
\fi |
| 309 |
\end{lstlisting} |
| 310 |
|
| 311 |
\end{document} |