[XeTeX] Unicode sans serif math

76nemo76 at gmx.ch 76nemo76 at gmx.ch
Sat Dec 2 18:43:26 CET 2017


Hi All,
  I would typeset a document  containig unicode mathematic characters
and sans serif fonts. It seems that this is almost impossible
since the fonts used to typeset the variables in math mode use always
a serif font.

Do you have an idea if it is possible to type a document only with sans serif
fonts. I have read quite carefully the documentation
for the "fontspec" and "unicodemath" package without finding
any clear direction on how to achieve that. Should I define new math alphabet?


My example is with the "DejaVu Sans" font but the problem should
be more or less the same if the "lucida sans" font would have been choosen.

Sans serif math is useful for presentation (the beamer class) and sometimes
for printed document too.

Thanks for your help,

Alan

Here is an example to show the problem: the variable "F" and subscript "n"
are in serif font.

-------------------------------Example--------------------------------------
\documentclass{article}

\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmathfont{texgyredejavu-math.otf}
\setmainfont{DejaVuSans}[
   Extension=.ttf,
   UprightFont=*,
   ItalicFont=*-Oblique,
   BoldFont=*-Bold,
   BoldItalicFont=*-BoldOblique,
]
\setsansfont{DejaVuSans}[
   Extension=.ttf,
   UprightFont=*,
   ItalicFont=*-Oblique,
   BoldFont=*-Bold,
   BoldItalicFont=*-BoldOblique,
]
\setmonofont{DejaVuSansMono}[% main typewriter
   Extension=.ttf,
   UprightFont=*,
   ItalicFont=*-Oblique,
   BoldFont=*-Bold,
   BoldItalicFont=*-BoldOblique,
]


\begin{document}

\section{Number $\mathbf{φ}$ properties}
This is one interessant property:
\begin{equation}
	φ^2=φ+1 
\end{equation}

and an other one (related to Fibonacci numbers)

\begin{equation}
	\lim_{n→∞} \dfrac{F_{n+1}}{F_n}=φ
\end{equation}

\end{document}


More information about the XeTeX mailing list