TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 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

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.