11

(I updated this answer significantly after learning that modifying \everydisplay can cause serious problems with various display math style environments.) Setting the Color=... option while loading a math font appears to override anything that \textcolor is supposed to do. Instead of setting a Color option at the \setmathfont stage, you may achieve your ...


10

You chose the wrong command name. In unicode-math-table.tex we find \UnicodeMathSymbol{"02AA2}{\Gt}{\mathrel}{double nested greater-than}% The table is read at begin document and, unfortunately, it overrides commands without warning. You might do \AtBeginDocument{\renewcommand*{\Gt}{\Group_{\symrm{T}}}} but my advice is to choose a different name. Note ...


8

unicode-math and and amsmath are not really related, the first is primarily about font setup and the latter is about defining macros for math layout structures and is more or less independent of the fonts used. If typesetting mathematics using OpenType math fonts, it is recommended that you load both (load amsmath first). In fact the development version (...


8

First, some general comments and observations about the code shown in your preamble: When using LuaLaTeX or XeLaTeX, you should not load the fontenc and inputenc packages. (Even when using pdfLaTeX, it's no longer necessary to load the inputenc package unless your file's input encoding is not UTF8 or ASCII, which is a proper subset of UTF8.) Loading the ...


8

The command \Question is defined to represent the double question mark character, along with a whole bunch of other unicode character mapping definitions ("mathtable"), done at begin document. You should choose a non-clashing environment name. I agree it is annoying that \Question isn't defined immediately by unicode-math, so it would be detected by the \...


8

One way to accomplish this is to insert the symbol as text: \documentclass[11pt]{article} \usepackage[svgnames]{xcolor} \usepackage{amsmath,amsthm,verbatim} \usepackage{unicode-math} \pagestyle{empty} % Suppress page numbers in this MWE. \setmainfont{STIX Two Text} \setmathfont[slash-delimiter=frac,Color=Navy]{STIX Two Math} \begin{document} \begin{gather*...


7

This seems to be a bug (or a missing feature) in XeTeX. The macro \not does a few checks and if a suitable name derived from the following token does not exist (it should be a Unicode defined negated symbol), it uses \notaccent. See https://github.com/wspr/unicode-math/issues/363 This command should overlay the accent on the symbol, but it doesn't in XeTeX....


6

Here, I restore \mathcal to a more traditional look, saving the undesired revision as \svmathcal. \documentclass{article} \usepackage{amsmath,bm} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont{Asana Math} \let\svmathcal\mathcal \DeclareSymbolFontAlphabet{\mathcal} {symbols} \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} \SetMathAlphabet{\...


6

Asana Math includes these as Stylistic Alternates, so you can request them by adding Style=Alternate to \setmathfont. \documentclass{article} \usepackage{amsmath} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont[Style=Alternate]{Asana Math} \begin{document} $\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ $\mathbfcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ \end{...


6

Here is a minimal example: \setupbackend[export=yes] \starttext Here is a sample of a math document which has some random $x = a + \sqrt{\frac{1}{2}}$ inline math and some random display math \startformula A = B + C + \frac{A}{B} + \binom{C}{D} \stopformula \stoptext Let's say this is called test.tex. When you run context test.tex, you will get a ...


6

Explanation \Question is one of math symbol commands unicode-math provides. Therefore after your \newenvivonment{Question}..., \Question is redefined to the double question mark (U+2047) at the beginning of document (\begin{document}) by unicode-math. Since the default unicode math font Latin Modern Math font does not provide this symbol, XeLaTeX (or ...


6

bookmarks can contain only rather simple text. This means that hyperref has to translate LaTeX input into something that makes sense there. For this it often drops or replace problematic content. In general hyperref is quite good to at least avoid errors in this process, but it can't handle commands which have been let to a char: https://github.com/latex3/...


5

If you don't like the symbols provided by Libertinus Math, you can load them from another math font you like. You can select the symbols you want to change with option range=. Let's try Fira Math: \documentclass{article} \usepackage{amsmath} \usepackage{libertinus-otf} \setmathfont[range={\vert,\lbrack,\rbrack}]{FiraMath-Regular.otf} \begin{document} \...


5

To answer question 1: All (or at least most) \mathXX are internally the same a, they only look different as they are from different fonts. The sym-variants are different symbols with different unicode code points. You can see the difference if you try to copy and paste from a pdf. \documentclass{article} \usepackage{unicode-math} \begin{document} $\mathrm{a}...


5

The bm package is for legacy 8-bit fonts. In unicode-math, load a math font that comes in bold (currently, XITS Math, Libertinus Math or Minion Math) and use \boldsymbol for bold operators and signs. If you only need bold letters, you can use \mathbf, \mathbfcal, etc. Or the new commands \symbfup for bold upright, \symbfit for bold italic, etc., as Mico ...


5

I'm afraid that the Color option to the font overrides any color specification, because it's applied later. You can define a noncolored font for a different math version and specify it. I added an optional argument to help in case the symbol is not an ordinary one. \documentclass[11pt]{article} \usepackage{xcolor} \usepackage{amsmath} \usepackage{fontspec} \...


5

Here's a construction with the help of \ooalign that superimposes glyphs. \documentclass{article} \DeclareRobustCommand{\Colon}{{% \ooalign{% \hidewidth\raisebox{0.2ex}{/}\kern0.1em\hidewidth\cr C\cr \hidewidth\kern0.1em\raisebox{0.2ex}{/}\hidewidth\cr }% }} \begin{document} You owe me \Colon 100 \end{document} First a /, almost centered,...


4

According to the documentation of unicode-math, \setminus is the character U+29F5 (⧵), the Unicode reverse solidus operator. Asana Math, STIX Two Math, XITS Math, Libertinus Math and Cambria Math all have it, at least. I believe that Latin Modern, the TeX Gyre fonts and Fira Math do not (as of 2020). Generally, XITS and STIX Two attempt to be absolutely ...


4

You can newly load the font with an artificial negative slant just for the glyph you need. \documentclass[margin=2pt]{standalone} \usepackage{fontspec} \usepackage[math-style=TeX]{unicode-math} \setmathfont{XITSMath-Regular}[ Extension = .otf, BoldFont = XITSMath-Bold, Ligatures=TeX, ] \setmathfont{XITSMath-Regular}[ Extension = .otf, BoldFont = ...


4

You could locally reset the Umathcode. Or you could use the (very new and experimental) fallback method to pull in a glyph from another font. This doesn't work for a math alphabet so you would have to use a text command, which is a bit cheating. \documentclass{article} \usepackage{unicode-math} \directlua {luaotfload.add_fallback ("myfallback", { "...


4

You can use \pdfliteral directly in pdfTeX: \def\mybigtimes{\mathop{\mathchoice{%display: \vcenter{\hbox to10bp{\vrule height15bp width0pt \pdfliteral{ q 1 J .8 w 0 1 m 10 14 l S 0 14 m 10 1 l S Q }\hss}}}{%text: \vcenter{\hbox to10bp{\kern1bp\vrule height10bp width0pt \pdfliteral{ q 1 J .65 w 0 0 m 8 10 l S 0 10 m 8 0 l S Q }\hss}}}{\times}{\...


4

This is the image with pdflatex: This is the image with xelatex: For mysterious reasons, the developers of TeX Gyre Termes Math decided not to give all big operators the same dimensions. It's up to you to decide whether to use \bigcup as a model or \sum as in the code below. \documentclass{article} \usepackage{amsmath,pict2e} \usepackage{iftex} \ifTUTeX ...


4

The definition of \not is getting too clever by half by looking up whether \nmodels or \notmodels already exist. It works if you change the name: \documentclass{standalone} \usepackage{iftex} \iftutex \usepackage{unicode-math} \else \usepackage{newtxmath} \fi %\newcommand{\aintmodel}% %{\mathrel{\ooalign{\(\models\)\cr\hidewidth\(\mathslash\)\...


4

The current implementation of \not does essentially the same in pdflatex as in (Xe|Lua)LaTeX with unicode-math. More precisely, \not takes the next token, say \foo and first checks whether \notfoo is defined; if the test succeeds, \notfoo is used. Otherwise the next check is whether \nfoo is defined. Again, if this test succeeds, \nfoo is used. Otherwise ...


4

You used a latin o not an omicron (\omicron) which is particularly noticeable here as it means you get the dejavu math character not latin modern. \omicron is defined in unicode-math. It did not exist in classic TeX, which was limited to 127-character 7-bit encoding, so omitted definitions for anything that looked the same in both Latin and Greek.


4

The amscd package performs \mathcode`@="8000 in order to make @ math active. It also executes \CDat when starting a CD environment, where \CDat is defined by \gdef\CDat{\let @=\Iat} in a context where @ is active. It's not important to know what \Iat is, just that it is essential that @ is math active and has the meaning \Iat during processing of the ...


4

\documentclass{article} \usepackage{siunitx} \usepackage[mathrm=sym]{unicode-math} \begin{document} \num{\pi/3} \end{document}


3

unicode-math side: \setmathfont redefines \tilde, this changes the one-step expansion of \tilde from \protect\tilde␣ to \tilde. And if \setmathfont is not used in preamble, unicode-math uses it at the beginning of document environment. glossaries-extra side: The first usage of \gls{tilde} uses the value of an internal macro corresponding to the glossaries ...


3

With current LaTeX, the document produces the error ! LaTeX Error: Math alphabet identifier \mathrm is undefined in math version bold After any error the PDF output is not intended to be useable, just possibly an aid to debugging. With older releases you get a lot of warnings rather than an error but the issue is essentially the same. ntheorem is ...


3

\documentclass{article} \usepackage{amsmath} \begin{document} $\forall x: P (x)$ using \verb|:| $\forall x \colon P(x)$ using \verb|\colon| \def\newcolon{% \nobreak\mskip2mu\mathpunct{}\nonscript\mkern-\thinmuskip{\text{:}}% \mskip 6mu plus 1 mu \relax} \mathcode`\:="8000 % {\catcode`:=\active \global\let:\newcolon} $\forall x: P (x)$ using ...


Only top voted, non community-wiki answers of a minimum length are eligible