2

I am struggling with my document: I use XeLaTeX to change my document font to SourceSansPro (Font Source). Everything works the way I need it, except I have no idea how add the greek letters, which are already included in the font.

Thanks a lot in advance.

\documentclass[a4paper,10pt]{article}

\usepackage{mathspec}
\defaultfontfeatures{Mapping=tex-text}
\setmathrm{Source Sans Pro}
\setmathfont(Digits,Latin){Source Sans Pro}
\setmainfont[
    Scale = 1.0,
    BoldFont = *-Semibold
    ]{Source Sans Pro}


\begin{document}
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

123456789

\textbf{Bold}

\textit{Italic}

\textbf{\textit{Bolditalic}}

$math$

$\gamma \rho \epsilon \epsilon \kappa$
\end{document}
1

The problem is that Source Sans Pro Italic does not contain most Greek characters. It does have π, so your example will work with \pi to illustrate this. You can also confirm this by typing Greek letters into the sample section of the web page you link to.

You could use upright characters instead of italic characters for Greek in maths:

\setmathfont(Greek)[Uppercase=Regular,Lowercase=Regular]{Source Sans Pro}

Or you could use a different but similar font, e.g., Noto Sans:

\setmathfont(Greek){Noto Sans}

MWE with Source Sans Pro Upright Greek

\documentclass[a4paper,10pt]{article}

\usepackage{mathspec}
\defaultfontfeatures{Mapping=tex-text}
\setmathrm{Source Sans Pro}
\setmathfont(Digits,Latin){Source Sans Pro}
\setmathfont(Greek)[Uppercase=Regular,Lowercase=Regular]{Source Sans Pro}
\setmainfont[
    Scale = 1.0,
    BoldFont = *-Semibold
    ]{Source Sans Pro}

\begin{document}
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

123456789

\textbf{Bold}

\textit{Italic}

\textbf{\textit{Bolditalic}}

$math$

$\gamma \rho \epsilon \epsilon \kappa$
\end{document}

output with Source Sans Pro Upright Greek


MWE with Noto Sans

\documentclass[a4paper,10pt]{article}

\usepackage{mathspec}
\defaultfontfeatures{Mapping=tex-text}
\setmathrm{Source Sans Pro}
\setmathfont(Digits,Latin){Source Sans Pro}
\setmathfont(Greek){Noto Sans}
\setmainfont[
    Scale = 1.0,
    BoldFont = *-Semibold
    ]{Source Sans Pro}

\begin{document}
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

123456789

\textbf{Bold}

\textit{Italic}

\textbf{\textit{Bolditalic}}

$math$

$\gamma \rho \epsilon \epsilon \kappa$
\end{document}

output with Noto Sans

  • Thank you so much, exactly what I was looking for! – TeXUser Jan 7 at 12:42

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.