Code Monkey home page Code Monkey logo

Comments (10)

georgd avatar georgd commented on May 23, 2024

Hi Rogério,

Thank you very much!

Indeed I am considering math support, but if I see it correctly, it needs italic and bold to be usable, so those cuts have to be done first.

For use with pdfLaTeX, by the way, one could consider adopting the mathdesign package for FS Garamond, which fits metrically quite will with EB Garamond. That, however, would need the creation of TeX-fonts from EB-Garamond.

from eb-garamond.

Evpok avatar Evpok commented on May 23, 2024

There is a way to use EB Garamond for maths in LaTeX right now with unicode-math:

\usepackage[math-style=french]{unicode-math}
    \setmathfont{XITS Math} % base font
    \setmathfont[range=\mathup/{latin,Latin,greek,Greek}]{EBGaramond12-Regular}
    \setmathfont[range=\mathit/{latin,Latin}]{EBGaramond12-Italic}

Works with the latest TeXLive version of LuaLaTeX at least. I didn't test it elsewhere. Not perfect though, the kerning is sometimes wrong and the greek italic letters may look weird if you are used to XITS Math.

from eb-garamond.

georgd avatar georgd commented on May 23, 2024

Interesting idea, thanks, @Evpok !

from eb-garamond.

itzsimpl avatar itzsimpl commented on May 23, 2024

I second the request for math support and I too think the font is becoming very beautiful.

Besides the Evpok approach there's another option, both have their own issues, and unfortunately the two approaches can't be combined.

In Evpok's case the numerals, at least for me, when I compile with XeLaTeX, remain in the XITSMath font and so do the bold math fonts and subscripts.

When instead of using the unicode-math package, one uses the mathspec package and the following commands:

\setallmainfonts[Ligatures=TeX, Numbers=OldStyle, AutoFakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}

for OldStyle numbers in both main body and math, and

\setmainfont[Ligatures=TeX, Numbers=OldStyle, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}  
\setmathsfont(Digits)[Ligatures=TeX, Numbers={Lining}, AutoFakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}
\setmathsfont(Greek)[Ligatures=TeX, Numbers={Lining}, AutoFakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}
\setmathsfont(Latin)[Ligatures=TeX, Numbers={Lining}, AutoFakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}
\setmathrm[Ligatures=TeX, Numbers={Lining}, AutoFakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}

for OldStyle numbers in main body and Lining numbers in math.

With these commands all math is typeset in EB Garamond, but one looses the \mathbb and \mathcal fonts, for which one needs to find separate typefaces. But the biggest issue is the loss of quality in symbols like fences, ... which are now bitmapped. Preceding the commands by

\usepackage[unicode-math] 
\setmathfont{Asana-Math.otf}

solves the symbols, \mathbb and \mathcal issue, but creates a new ones; at least the bold math font and the greek alphabet are no longer EB Garamond. I haven't figured out how to solved these issues, yet.

from eb-garamond.

itzsimpl avatar itzsimpl commented on May 23, 2024

It seems that in the end the @Evpok way is the way to go :)

The solution to my previous post is:

  \usepackage[math-style=french,bold-style=TeX]{unicode-math}
    \setmathfont{Asana Math} % base font
    \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}, Ligatures=TeX, Numbers={Lining}, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}
    \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}, Ligatures=TeX, Numbers={Lining}, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EBGaramond12-Italic}
    \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}, Ligatures=TeX, Numbers={Lining}, FakeBold=1.5, SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}}]{EB Garamond}

with this one sets math (lining numbers, lowercase, uppercase, greek, uppercase greek) in EB Garamond, in upright, italic and a fake bold variant (only upright). The remaining math symbols are typeset using the Asana Math typeface.

from eb-garamond.

Evpok avatar Evpok commented on May 23, 2024

That's almost what I was about to answer to your first comment :) except that I stick to XITS and that I do use EBGaramond-Bold (yes, I like challenges :)

from eb-garamond.

jooert avatar jooert commented on May 23, 2024

The method @Evpok and @itzsimpl describe works quite well for me, too, but accents above italic characters are slightly displaced. Is there a workaround for this as well?

from eb-garamond.

markvanatten avatar markvanatten commented on May 23, 2024

A specific mathfont to go with EB Garamond would perhaps be the most beautiful solution.
But I find I very much like the combination of EB Garamond and (Neo) Euler,
in particular setting
\setmathfont[Scale=MatchLowercase,math-style=upright,vargreek-shape=unicode]{Neo Euler}

from eb-garamond.

stone-zeng avatar stone-zeng commented on May 23, 2024

Recently @YuanshengZhao has created a math font with OpenType support: see https://github.com/YuanshengZhao/Garamond-Math

from eb-garamond.

Artoria2e5 avatar Artoria2e5 commented on May 23, 2024

That one can be a good starting point for the parts (XTIS) with a correct license (OFL)! The TeX Gyre parts are GFL/LPPL which isn't quite compatible though. Perhaps replace Thermes with STIX/XTIS? Both are Times-like anyway…

(Yeah, Math fonts are messy – in addition to the symbols, you need to make a bunch of new letter styles and all that…)

from eb-garamond.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.