2

I have been recently reading an article in Nature Reviews Chemistry and was impressed by the beauty of typography. Let me show you a small fragment of text involving some mathematical formulas.

enter image description here

I indicated different fonts with colors. As you can see, STIX is mixed with Minion Pro and with Diverda, but the mixture looks very natural and balanced. Without inspecting properties of PDF I would have never guessed that there are so many fonts here. How is it even possible? I know that unicode-mathsupports Minion Math (proprietary OpenType font), Cambria Math, STIX, but what about Diverda? Obviously it lacks greek letters and therefore Minion Pro Italic is used. But how? Can someone reproduce this beautiful excerpt with XeLaTex? I managed to can close to it by using Minion Pro for text and Cambria Math for equations, but it is not even nearly the same.

Edit

Based on the 2 answers below, I would like to provide a working example and describe what exactly is my problem.

Consider this starting point

\documentclass[11pt,a4paper,onecolumn,openright,final,oneside]{memoir}
%===============================================
\settrims{0.cm}{0.cm}
\setbinding{0cm} % space for binding
\setlrmarginsandblock{*}{5cm}{1} % spine = edge. Edge=3cm
\setulmarginsandblock{2.5cm}{*}{1} % upper=lower. Upper=3cm
\checkandfixthelayout
%===============================================
\usepackage{microtype}
\usepackage{fontspec}
\usepackage[]{amsmath}
\usepackage{lipsum}

% -- text font --
\setmainfont[Ligatures=TeX]{Minion Pro}
\setsansfont[Ligatures=TeX]{Diverda Sans Com Light}[
  BoldFont =Diverda Sans Com Medium
]

% -- math fonts --
\usepackage{unicode-math}
\setmathfont{Cambria Math}[version=body]
\setmathfont{STIX Two Math}[version=box]

% -- frame --
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{xcolor}
\definecolor{Carrara}{HTML}{EEEDEA}
\mdfdefinestyle{refa}{linecolor=Carrara!50!black,
  backgroundcolor=Carrara,roundcorner=5pt,leftmargin=2cm,%
  topline = false,bottomline=false,leftline=false,rightline=false,%
  frametitlerule=true,frametitlerulewidth=0.5pt,%
  font=\sffamily\footnotesize,frametitle={Box}, frametitlefont=\footnotesize\bfseries\sffamily,%
  }

\begin{document}
\pagestyle{empty}
%===============================================
 \mathversion{body}
\lipsum[1][1-2] $W(\omega,t)/v_q+\symbf{\Sigma}(z_1,z_3)\otimes\symbf{G}(z_3,z_2)$, \lipsum[1][4-5]
$\hat{H}_p\equiv \symbf{\nabla}_p$, \lipsum[1][6-7].

\begin{mdframed}[style=refa]
   \mathversion{box}
  \lipsum[2][1-3] $\phi$ that is, $\mathversion{box}\Psi\approx\psi\otimes\phi$. \lipsum[2][4-5]
\begin{align}
  i \hbar \frac{\partial}{\partial t}\psi(t)=\hat{H}_p(t)\psi(t)
\end{align}
\lipsum[3][1]
\end{mdframed}
\end{document}

yielding enter image description here

It has the following characteristics:

  • Body text - Minion Pro Body equations
  • Cambria Math Box text
  • Diverda Sans Com Light Box equations
  • STIX Two Math

Let us say, I am happy with the body, but I want to change the math in the box. Why? Well, heavy STIX does not match light Diverda. But Diverda does not have greeks, therefore, let us use Minion Pro for them. The mathfonts are defined therefore as

\setmathfont{Cambria Math}[version=body]
\setmathfont{STIX Two Math}[version=box]
\setmathfont{Minion Pro Italic}[range=it/{Greek,greek},version=box]
\setmathfont{Diverda Sans Com Light Italic}[range=it/{latin, Latin},version=box]

with this result

enter image description here

What I am doing wrong? Why the body math font has changed? Why some characters are missing in the box?

  • xetex and luatex can use any opentype font you have on the system you can load as many as you need. It is not clear exactly what your question is? – David Carlisle May 10 at 20:04
  • Oh boy, the third line looks like a r e f u r t h e r s i m p l i fi e d a n d r e d u c e d t o, this is a sign that the original is not prepared by TeX :) – Ruixi Zhang May 10 at 20:10
  • 3
    @RuixiZhang -- Nature publications are not prepared with TeX. I had an opportunity to talk with Paul Barnes, one of the principals of the firm that developed the new fonts for Nature. He said that, although LaTeX submissions are accepted, the production flow has several steps with archival files being stored as XML, and the final output "flowed through InDesign". (This information appears in my column in TUGboat 41:1, and was cleared by Barnes.) – barbara beeton May 10 at 20:34
  • 2
    I've been given to understand that there is a plugin for math. I suspect it's based on TeX, but have no firsthand knowledge. (I didn't ask about that, and Barnes isn't the math-knowledgeable partner in the firm.) – barbara beeton May 10 at 20:52
1

I have tried, from one hour, differents options: in this moment the best is for my opinion

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Sans}
\usepackage{unicode-math} 
%\setmainfont{Libertinus Serif}
\setmathfont{TeX Gyre Pagella Math}
%\setmathfont{XITS Math}
%\setmathfont{Libertinus Math}

\begin{document}
If we make a mean-field
\[ i\hbar\frac{\partial}{\partial t}\psi(t)=\hat{H}_p(t)\psi(t)\]
\end{document}

You could to try for the text %\setmainfont{Libertinus Serif} and for the math-style

%\setmathfont{XITS Math} or
%\setmathfont{Libertinus Math}

enter image description here

Here there is a combination only of Libertinus:

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math} 
\setmainfont{Libertinus Serif}
\setmathfont{Libertinus Math}

\begin{document}
If we make a mean-field
\[ i\hbar\frac{\partial}{\partial t}\psi(t)=\hat{H}_p(t)\psi(t)\]
\end{document}

enter image description here

| improve this answer | |
  • 1
    Thanks for a nice idea. I am curious to compare on the bigger piece of text. – yarchik May 10 at 20:53
1

I don’t have all of those fonts on my system to test, but you could get something like this with the combination

\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{Minion Pro}
\setsansfont{Diverda Sans Com}
\setmathfont{STIX Two Math}
\setmathfont[range=it/{Greek,greek}]{Minion Pro italic}
% Similarly for range=up, bfup, bfit, Latin or digits as desired.

Then define your sidebox to use \sffamily and change colors with xcolor.

| improve this answer | |
  • I am agree totally with you. I have given an answer with the disponible fonts. – Sebastiano May 10 at 21:27
  • But there is a problem though, since we declare Diverda as the sans serif font for text, it is also natural to have Diverda Sans Com Light Italic for the majority of symbols in the formula (see OP). But I have to admit that your solutionwith STIX looks beautiful. Except I want almost serifless math. – yarchik May 10 at 21:52
  • @yarchik I was trying to duplicate the selections in the example you gave, but that’s possible too. You would want to \setmathfont{Fira Math} for sans-serif math or \setmathfont{GFS Neohellenic Math} for very subtle serifs. Then you could define \setmathfont[range=it/{Latin,latin,Greek,greek}]{Diverda Sans Com Light Italic} to use its letters in math mode, and similarly for up, bfup and bfit. – Davislor May 10 at 22:06
  • If Diverda doesn’t have Greek (I don’t know one way or the other), just remove greek and Greek from that example. – Davislor May 10 at 22:07
  • I've tried, but Package fontspec Warning: Font "Diverda Sans Com Light Italic" does not contain requested Script "Math". – yarchik May 10 at 22:10

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.