5

I want the symbols such \int or \sum from the Latin Modern Math font and the \nabla and all the greek letter such \alpha \beta \psi etc from the Latin Modern Math but all numbers and letters from the EB Garamond. How can i do that?

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmathfont[range=\mathup]  {EB Garamond}
\setmathfont[range=\mathbfup]{EB Garamond} 
\setmathfont[range=\mathbfit]{EB Garamond}
\setmathfont[range=\mathit]  {EB Garamond}

\usepackage{mathptmx}

\setmainfont{EB Garamond}

\begin{document}
\[ \int f(\alpha+x)=\sum\beta \]
Some text\dots
\begin{equation}
\begin{split}
\frac{\partial^2 \nabla}{\partial \nabla^2}&=x^2 + yimc^2=z^2 \\
                                           &=\mathrm{x^2 + y^2 = z^2} \\
                                           &=\mathbf{x^2 + y^2 = z^2}
\end{split}
\end{equation}

\begin{equation}
i\hbar \frac{\partial \psi }{\partial t}=\frac{\hbar c}{i}\left(\alpha _1\frac{\partial \psi }{\partial x^1}+\alpha _2\frac{\partial \Psi }{\partial x^2}+\alpha _3\frac{\partial \psi }{\partial x^3}\right)+\alpha _4mc^2\psi
\end{equation}

\end{document}

And the shape of \partial how this example

\documentclass{article}

\usepackage[T1]{fontenc}

\usepackage{txfonts}

\begin{document}

\begin{equation}
\frac{\partial}{\partial}
\end{equation}

\end{document}
5
  • 1
    By doing this a large amount of cute furry animals will die horribly, are you really sure this is what you want? Aug 2, 2012 at 16:20
  • haha lool is not good idea?
    – Aurelius
    Aug 2, 2012 at 16:39
  • 2
    From \usepackage{mathptmx} till \setmainfont should be removed as it makes no sense at all with unicode-math. Aug 2, 2012 at 21:36
  • 1
    Also you shouldn’t be loading amsfonts, amssymb or type1ec packages, they too make no sense here. Aug 2, 2012 at 21:38
  • @KhaledHosny i have updated my answer, but if i remove \usepackage{mathptmx} the \hbar disappears...
    – Aurelius
    Aug 3, 2012 at 8:43

1 Answer 1

3

You have to carefully select the ranges and the symbols you need. Here's an example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}

\setmathfont[range=\mathup]  {EB Garamond}
\setmathfont[range=\mathbfup]{EB Garamond} 
\setmathfont[range=\mathbfit]{EB Garamond}
\setmathfont[range=\mathit]  {EB Garamond}
\setmathfont[range={\partial,\nabla,\hslash}]{TG Termes Math}
\setmathfont[range=\mathit/{greek,Greek}]{Latin Modern Math}

\setmainfont{EB Garamond}

\begin{document}
\[ \int f(\alpha+x)=\sum\beta \]
Some text\dots
\begin{equation}
\begin{split}
\frac{\partial^2 \nabla}{\partial \nabla^2}&=x^2 + yimc^2=z^2 \\
                                           &=\mathrm{x^2 + y^2 = z^2} \\
                                           &=\mathbf{x^2 + y^2 = z^2}
\end{split}
\end{equation}

\begin{equation}
i\hbar \frac{\partial \psi }{\partial t}=\frac{\hbar c}{i}\left(\alpha _1\frac{\partial \psi }{\partial x^1}+\alpha _2\frac{\partial \Psi }{\partial x^2}+\alpha _3\frac{\partial \psi }{\partial x^3}\right)+\alpha _4mc^2\psi
\end{equation}

\end{document}

enter image description here

2
  • Shouldn’t \mathit use “EB Garamond Italic”? Jan 6, 2013 at 9:34
  • @KhaledHosny I think so, but that's what the OP seemed to want.
    – egreg
    Jan 6, 2013 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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