Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use fontspec with LuaLaTeX to load fonts from external file even if they are not installed on the system. Such as

\usepackage{fontspec}
\setmainfont[Path=fonts/,
             Extension=.otf,
             UprightFont=*-Regular,
             ItalicFont=*-Italic,
             BoldFont=*-Bold,
             SmallCapsFont=*-AllSC,]{EBGaramond12}

I also use unicode-math, because it's awesome, usually with XITS Maths for the operators and numbers and EB Garamond for the letters.

\usepackage[math-style=TeX]{unicode-math}
    \setmathfont{XITS Math}
    \setmathfont[range=\mathbfsfit/{greek,Greek,latin,Latin}]{EB Garamond}

Is there a way to combine these packages to use the letters from the local EB Garamond instead of the system's one?

share|improve this question
    
All fontspec options are valid for unicode-math as well. –  Khaled Hosny Jan 22 '13 at 14:54
add comment

1 Answer 1

up vote 1 down vote accepted

Thanks to @Khaled Hosny, I have found out how to do it. It is not exactly true that all fontspec options are available for unicode-math. In this case, unicode-math doesn't seem to support the wildcard expansion feature of fontspec, so instead of

\setmathfont[
    range=\mathbfsfit/{greek,Greek,latin,Latin}
    Path=fonts/,
    Extension=.otf,
    UprightFont=*-Regular,
    ItalicFont=*-Italic,
    BoldFont=*-Bold]{EBGaramond12}

one has to use

 \setmathfont[
    range=\mathbfsfit/{greek,Greek,latin,Latin},
    Path=fonts/,
    Extension=.otf,
    ItalicFont=EBGaramond12-Italic,
    BoldFont=EBGaramond12-Bold]{EBGaramond12-Regular}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.