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 ...


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*...


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 \...


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....


7

The widths of the digits are not the same in STIX Two Math at \footnotesize. Why? Ask STIX. \documentclass{scrartcl} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \usepackage{mathtools} \usepackage{siunitx} \begin{document} \footnotesize \(X = \SI{4.8}{\henry}\) \(X = \hphantom{.} \SI{10}{\...


7

You could use \nolimits to toggle that on a single integral: \documentclass[]{article} \newcommand*\dd{\!\mathop{}\mathrm{d}} \begin{document} \[ A = \int\nolimits_{0}^{b} f(x)\dd x \] \end{document}


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

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,...


5

You’re trying to load an old-fashioned NFSS font command, which is incompatible with unicode-math. To load a new \mathcal alphabet from an OpenType font, use the range= option of \setmathfont, for example, \documentclass{article} \usepackage{unicode-math} \setmathfont{XITS Math}[ Scale = MatchUppercase ] \setmathfont{Latin Modern Math}[ range = {cal,...


5

Changing it to use 0.6 in all cases \Si uses text mode ......\hbox(5.814+0.108)x11.475, direction TLT .......\TU/STIXTwoText(1)/m/n/9 0 .......\TU/STIXTwoMath(1)/m/n/9 . .......\TU/STIXTwoText(1)/m/n/9 6 but \hphantom is using math mode .....\hbox(6.021+0.117)x7.785, direction TLT ......\TU/STIXTwoMath(1)/m/n/9 0 ......\TU/STIXTwoMath(1)/m/n/9 . and as ...


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

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

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}


4

The classic TeX double struck font you show in the first code block is not derived from Computer Modern at all it is the AMS symbol font msbm10 (and the first two rows are set in Computer Modern, not Latin Modern) The second block is using a consistent font for all three rows, Latin Modern Math Opentype. There are other Computer Modern inspired OpenType Math ...


4

You found a solution for legacy fonts that isn’t compatible with unicode-math. Since Unicode maps \mathcal and \mathscr to the same characters, you can only set them to different alphabets if you load a new font with the range= option of \setmathfont. For example, this uses New Computer Modern Book for everything but \mathscr and \mathbfscr, which it takes ...


4

By default unicode-math does not assign a mathematical definition or ƛ, but yu can give it a mathcode yourself: You have to decide which class, family and codepoint it should have. Since our font is Unicode encoded, the codepoint is 0x019B. Since ƛ behaves like a greek letter, we can treat is similar to other greek letters and assign it class 7 (variable ...


4

This may not solve your problem, but I can offer some background on the Unicode assignment. While recognizing that some people may wish to create texts using script or fraktur styles, the Unicode committee specifically stated that alternate fonts should be used for that purpose. This is not possible for such letters used in math, as illustrated in Unicode ...


3

You would really want to change the font inside a group, so the font change doesn’t bleed through to the text after it. So, \newcommand{\xmark}{{\xmarkfont\char"2718}} You would define \xmarkfont as you did in your MWE, to a font that has it, probably scaled with Scale=MatchUppercase. In math mode with unicode-math, you can set the font for a specific ...


3

Some comments and observations: It's a good idea to load math font packages such as amssymb, dsfont, mathrsfs and wasysym before loading unicode-math. For sure, if you follow this piece of advice, the ! LaTeX Error: Command `\eth' already defined. error messages will cease. The unicode-math package works under both XeLaTeX and LuaLaTeX, and it loads ...


3

As wipet pointed out the placement depends on the height of the operator. You can see a similar effect (but much less pronounced) also with classical tex if you use large enough letters: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \def\sin{\qopname\relax o{SIN}} \begin{document} \[\tikz[overlay]\draw[red](0,4.4pt)--++(5,0); \sin^{2}...


3

I experimented with LuaTeX, no XeTeX, but the problems are similar. There are many position parameters read from Unicode math font. They are listed at pages 104--108 of LuaTeX manual. Main rules of vertical position of the exponent are controlled by two parameters: \Umathsupshiftup minimal shifting up. (10pt typesetting, Latin Modern math, displaystyle, ...


3

The error you’re getting is completely unrelated to the Greek language. It’s a font issue. The default math font, Latin Modern Math, does not have a \setminus symbol. The default behavior of TeX is to silently log a warning message to the .log file. You can at least get it to print a warning message by adding the command \tracinglostchars=2. You should ...


3

Short version In LuaLaTex, the HarfBuzz renderer is not and probably will not be supported for math fonts. Just use theBase mode instead. Long version As documented in the page you link in your question: HarfBuzz itself does not implement a math layout solution. The functions and types provided can be used by client programs to access the font data ...


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