5

I'm trying to get the ebgaramond-maths package to work properly in XeLaTeX. Everything seems to work well except for the numbers. The numbers in math mode still show up in the default Computer/Latin Modern typeface.

%!TEX program = xelatex
\documentclass{standalone}
\usepackage{ebgaramond}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage{anyfontsize} 

\begin{document}
123 $123 ABC$
\end{document}

This code gives the following output with no warnings. As you can see, the numbers in math mode aren't set in EB Garamond.

enter image description here

If I remove the first line, to compile with pdfLaTeX, the package works fine and the numbers are in EB Garamond.

enter image description here

I think this has something to do with the encoding of the numbers. I have tried the declaring the math symbols manually using this code, but that didn't work in XeLaTeX (though it did work with pdfLaTeX). I also tried using the mathspec package, but that clashed with ebgaramond-maths.

Does anyone know how to get ebgaramond-maths with EB Garamond numbers in math mode using XeLaTeX?

1
  • Note that ebgaramond-maths is NOT designed for use with XeTeX or LuaTeX and such usage is entirely unsupported. That said, it should work if the traditional TeX maths configuration is left alone. That is, provided that letters and so on are taken from the OT1 type1 fonts and not from the Unicode opentype ones. But if it does not, it is not a bug. Also, it is not suitable for arbitrary mathematics. Only a limited subset of maths can reasonably be expected to look passably satisfactory, even with pdfTeX.
    – cfr
    Mar 14, 2017 at 4:03

1 Answer 1

7

You have to call fontspec with the no-math option.

\documentclass{article}
\usepackage[no-math]{fontspec}
\usepackage{ebgaramond}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}

\begin{document}
123 $123 ABC$
\end{document}

enter image description here

6
  • @cfr No, I'll uncomment it.
    – egreg
    Mar 13, 2017 at 23:35
  • Thanks. Do you know if the failure of ebgaramond with the type1 option is now expected?
    – cfr
    Mar 13, 2017 at 23:38
  • @cfr There's no font definition file for the TU or EU1 encoding, so the text font is substituted. I'm not sure what the type1 option is supposed to do with (Xe|Lua)LaTeX.
    – egreg
    Mar 13, 2017 at 23:48
  • Since the fontspec package needs to be loaded, is there an advantage to running \usepackage{ebgaramond} instead of executing \setmainfont{EB Garamond}?
    – Mico
    Mar 13, 2017 at 23:49
  • 1
    @Mico I'd say yes. It doesn't just do \setmainfont{EB Garamond}.
    – egreg
    Mar 13, 2017 at 23:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .