3

I want to include some TeX output (mainly math) in an SVG image. The SVG is meant to be used in a presentation and I would like to use a sans serif font for this (currently, I use Biolinum but another font would be acceptable as well).

The font used in the TeX output should match the one used in the SVG. Therefore, I am using XeLaTeX and set the font to the same I am using for the text in the SVG.

The problem is with the math parts of the TeX output. Ideally, I would like to make the font used there to match the one of the text. After some searching, I understand that (currently) there is no sans serif font which fully supports Unicode math. However, is there some way to get "as close as possible"? What I mean by this is a setting where the glyphs from the font get used whenever possible and, if the font does not provide something, some fallback (which looks similar) is used.

What I currently have is the following:

% !TEX program = xelatex
\documentclass{article}
\usepackage[no-math]{fontspec}

\renewcommand{\familydefault}{\sfdefault}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}

\usepackage{mathspec}
\setallmainfonts(Digits,Latin,Greek){Linux Biolinum O}

\usepackage{lipsum}

\begin{document} 
  $\sum_{i = 0}^{n} a \gamma i \Sigma$ γ​ɣ\textit{a} Σ
  \lipsum[1]
\end{document}

visual output

However, as you can see, the font, for example, provides a capital Sigma but it is not used for the sum. Even worse, the Sigma used for the sum has serifs and looks a bit out of place.

Please note that this is meant as an example and that I am looking for a more general answer to the problem (than, e.g., replacing the sum by a capital Sigma).

Your Answer

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

Browse other questions tagged or ask your own question.