67

(Please note that this answer has been revised to reflect issues raised in the comments.) unicode-math The unicode-math and mathspec packages have very different goals. The unicode-math package is designed to map math markup into unicode characters as supplied by real OpenType math fonts such as the Latin Modern Math, STIX, Asana Math. It also allows (as ...


48

mathspec is a clever attempt to make it possible to use math in XeLaTeX documents, with system fonts for the letters and symbols from standard math fonts. With unicode-math one can basically use only specially tailored OpenType math fonts such as Latin Modern Math, TeX Gyre Termes Math, TeX Gyre Pagella Math, XITS Math, Asana Math (among the free ones) or ...


38

The problem is that one of the subpackages loaded by datatool, namely datatool-base has the line \RequirePackage{amsmath} and mathspec sets up a (very poor) check for possible loading of amsmath after it, which triggers the error even if amsmath has already been loaded when another package requires it. The normal setup of LaTeX is not reloading packages, ...


29

unicode-math is mainly concerned about facilitating the use of using Unicode math fonts, namely OpenType math fonts in LaTeX. While mathspec is about allowing to take math alphabets from text fonts in the absence of matching math font. Unicode defines a large set of math symbols and many fonts include them, but proper math typesetting requires many font ...


11

Interaction of mathspec with font packages is not really predictable. You can fool the package with this trick: \documentclass{article} \usepackage{amsmath} \usepackage{mathspec} \setmainfont{Palatino} \setmathsfont(Digits){Palatino} \newcommand{\mathbbm}[1]{\text{\usefont{U}{bbm}{m}{n}#1}} % from mathbbm.sty \begin{document} This blackboard bold $\...


11

mathfont and mathspec have similar purpose, but mathfont works not only with xelatex but also with lualatex. Both packages allow to change the font of various math symbols and math alphabets. Both packages have in my view the same deficiency: they care only about the look of the math and not about the mathematical meaning of the symbols. The difference ...


10

You're right that the symbol are italic. However, there seems to be a limitation in mathspec that doesn't define a "Punctuation" set, so basically one has to choose either from \eu@LatinLowercase@symfont or \eu@LatinUppercase@symfont and these, with the default setting, both point to Latin:m:it. So the complete solution may be \documentclass[a4paper,12pt]{...


10

Yes. If you want to use mathspec, then at present you need to run XeLaTeX. (The mathspec package pre-dates wide availability of LuaTeX.) There are few technical reasons for this, but mathspec does use one primitive that would need to be emulated in LuaTeX before it could fully supported: \XeTeXglyphbounds — this is used in the \" and " definitions to ...


8

You can simply remove the option math when loading mathspec. MWE \documentclass[11pt]{article} \usepackage{mathspec} \setprimaryfont{Linux Libertine O} \begin{document} 1 $1$ $\mathrm{1}$ $\text{1}$ \end{document} Output Loading mathspec with the math option forces mathspec to load fontspec without the no-math option. And the fontspec manual states: ...


8

The right order to load those packages is amsthm, newtxmath, mathspec \usepackage{amsthm} \usepackage[libertine]{newtxmath} \usepackage{mathspec} You don't need to load amsmath since it is already loaded by newtxmath. That's also the reason why mathspec complains when you load newtxmath after it. Moreover, note that both amsthm and newtxmath define the \...


7

I'm not absolutely certain what you're asking, especially because your example is not compilable nor does it make a lot of sense. unicode-math doesn't work with mathspec or mathalfa. All those packages are mutually exclusive. That said, I think what you want to achieve can already be done in the default settings of unicode-math. \documentclass{article} \...


7

This is clearly due to the new LaTeX kernel using b as the default value for \bfseries. Probably fontspec should also define bx weight for compatibility, but in the meantime you can patch mathspec to use b instead of bx. \documentclass{article} \usepackage{mathspec} \usepackage{xpatch} \xpatchcmd{\setmathrm}{bx}{b}{}{} \xpatchcmd{\setmathrm}{bx}{b}{}{} \...


6

There is no oblique version of DejaVu Sans ExtraLight on my system. So I get the normal weight too. But you could use the FakeSlant-Option: \documentclass[letterpaper, 12pt, oneside]{article} \usepackage{mathspec} \setmainfont[ItalicFont={DejaVu Sans ExtraLight}, ItalicFeatures={FakeSlant=0.2}]{DejaVu Sans ExtraLight} \setmathfont(Greek,Latin,...


6

XeTeX fails to set the correct italic correction in math (http://tug.org/pipermail/xetex/2011-March/020318.html) when open type fonts are used. I would suggest to use the normal T1-encoded font for the letters_ \documentclass{beamer} \usepackage{fontspec} \AtBeginDocument{% \DeclareSymbolFont{pureletters}{T1}{lmss}{\mddefault}{it}% } \begin{document} ...


6

It's not impossible when you have established a math font which has the symbols you need. It's just time consuming. \documentclass[a4paper,twoside,12pt]{article} \usepackage{amsmath} \usepackage{mathspec} \setmainfont[Ligatures=TeX]{Linux Libertine O} \setsansfont[Ligatures=TeX]{Linux Biolinum O} \setmathsfont(Digits,Latin)[Uppercase=Regular,Lowercase=...


6

Like this? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} y& =f\biggl( \sum_{i=1}^{N} w_ix_i+w_0\biggr), \\ U&=i \end{align} \end{document} P.S.: avoid $$ ... $$; use \[ ... \] or \begin{equation} ... \end{equation} instead.


6

You can add a declaration so that the text font knows bx too: \documentclass{article} \usepackage{mathspec} \setallmainfonts{Times New Roman} \DeclareFontShape{TU}{\familydefault}{bx}{n}{<-> ssub*\familydefault/b/n}{} \begin{document} \begin{equation} \nabla \times \mathbf{B} = \mu_0 \mathbf{J} \end{equation} \end{document} fontspec will ...


5

Here's a workaround with fontspec only. The trick is to define a new math symbol font for the lining figures. I wouldn't use detect-all: numbers in \SI or \num should always be typeset in math mode (hence with lining figures). \begin{filecontents}{test.bib} @Article{Hay2011, Title = {Can humans force a return to a `Cretaceous' climate?}...


5

I'm not sure if this is accepted, but I'm going to answer my own question in case someone finds this page. It appears that minionpro (and myriadpro) DOES deal with math specific kerning and spacing. I used the FontPro scripts to convert the MinionPro opentype font included in Adobe CS to the Type1 format and install the 'minionpro' package (the script deals ...


5

you have a typo, you wrote \setmathfont ... but the logfile clearly shows that you typed \setmathsfont mark the extra "s".


5

You're forgetting the proper mathspec way: \documentclass{article} \usepackage{amsmath} \usepackage{mathspec} \setmainfont{Gotham Book} \setmathrm{Gotham Book} \setmathfont(Digits,Latin){Gotham Book} \begin{document} \begin{align*} "f'(x) &= x^2 \\ f'(x) &= x^2 \\ f\,'(x) &= x^2 \end{align*} \end{document} With the italic font (that I managed ...


5

The default beamer theme uses the sans serif font. So if you want to change the font in beamer you either have to set the sans font with \setsansfont or change to the serif font theme \usefonttheme{serif}. fontspec usually does a very good job setting the font features automatically, if you load them by font name. So in case of the Alegreya font it should ...


5

I don't have Arno Pro available, so I used the free Crimson instead. \documentclass{article} \usepackage{blindtext} \usepackage{unicode-math} \setmainfont{Crimson} % Set baseline math font (Crimson goes well with Pagella) \setmathfont{TeX Gyre Pagella Math} % Get alphabets from text font \setmathfont[range={up}]{Crimson-Roman.otf} \setmathfont[range={it}]{...


5

Iteration 1 \documentclass[10pt]{article} \usepackage[MnSymbol]{mathspec} % Includes amsmath. \setmathsfont(Digits,Latin,Greek,Symbols)[Numbers={Lining,Proportional}]{Calibri} \setmainfont[Mapping=tex-text, Ligatures={NoRequired,NoCommon,NoContextual}]{Calibri} \usepackage[italic]{mathastext} \begin{document} ABCDEFGHIJKLMNOPQRSTUVWXYZ \begin{align} ...


5

As @Mico and @oliversm pointed out, there are two basic ways to do this. Solution 1: using the cases package \documentclass{article} \usepackage{cases} \begin{document} \begin{numcases}{f(x)=} x, & \( x \geq 0\) \nonumber \\ 0, & \( x < 0 \) \nonumber \end{numcases} \end{document} Solution 2: using the cases environment of the amsmath ...


4

It's a well known problem with mathspec; you have to precede the letter with " in order that superscripts are better placed: \documentclass{article} \usepackage{amsmath} \usepackage{sfmath} \usepackage{mathspec} %\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \setmainfont{Universalis ADF Std} \setmathfont{XITS Math} \setmathsfont(Digits,Latin){...


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