# Changing typesetting language without command

I have a problem with typesetting LaTeX using both Greek and English characters. All this time, I've been using the polyglossia+fontspec packages which allowed me to change between Greek and English just by changing language on my keyboard.

This combination allows me to choose the fonts that I will use, but when letters in math mode mix with letters outside of math mode, the result is not so aesthetic. A solution to this is to substitute all math mode letter with \textrm, but I hope to find something less tiresome.

I actually want to change the font that I am using to, say, Kerkis. What I found online is that I have to add the following two packages

\usepackage{kmath,kerkis}
\usepackage[T1]{fontenc}


Adding these two packages (while removing fontspec) makes the file to not even compile.

So, my question is: how can I change the typesetting font in and out of math mode (let's say to Kerkis) while keeping the ability to change language without having to use a TeX command?

Edit: I used the mathspec package instead of fontspec, downloaded Kerkis fonts and manually added them using these:

\usepackage[MnSymbol]{mathspec}
\setmainfont{KerkisSans}
\setmathsfont(Digits,Latin)[Scale=MatchLowercase]{Kerkis}
\setmathsfont(Greek)[Scale=MatchLowercase]{Kerkis}
\usepackage{polyglossia}


Still, it feels like a half-measure since I'm feeling like I should just load a "Kerkis" package or something that would do the job for me, shouldn't I?

• When the alfabet is Latin, glyphs in math mode should also look different as those in text mode. – Przemysław Scherwentke Jan 8 '18 at 13:53
• Please give a real, compilable example of font combinations you find unsatisfactory. – Mico Jan 8 '18 at 14:13
• @mico any font i try in greek language except from the latex defaults does not seem fine. – royal with cheese Jan 8 '18 at 14:22
• Does my answer in this question helps? :(tex.stackexchange.com/q/396528/120578 ) It is about XeLaTeX for these languages and you can chose font for math and for text at any time... – koleygr Jan 8 '18 at 14:25
• Nice approach but I do not know if it answers my question exactly. I still only use greek letters outside of math mode. For math mode I restrict myself to latin characters. – royal with cheese Jan 8 '18 at 15:34

Here is the solution I suggested in the comment above:

\documentclass[11pt,oneside]{article}
\usepackage{amsmath}
\usepackage{mathspec}%[MnSymbol]{mathspec} %<-No need for this in this example
%\usepackage{MnSymbol}
\defaultfontfeatures{Ligatures=TeX}
\setallmainfonts{Linux Libertine O}
\usepackage{polyglossia}
\setmainlanguage{greek}
\setotherlanguage{english}
\setmainfont{Linux Libertine O}
%\newfontfamily\greekfont{Linux Libertine O}

% Definitions of Greek (in math mode)
\def\alpha{α}
\def\beta{β}
\let\oldgamma\gamma %<-see the difference below
\def\gamma{γ}
\def\delta{δ}
\def\epsilon{ε}
\def\zeta{ζ}
\def\eta{η}
\def\theta{θ}
\def\iota{ι}
\def\kappa{κ}
\def\lambda{λ}
\def\mu{μ}
\def\nu{ν}
\def\xi{ξ}
%\def\ο{o}
\def\pi{π}
\def\rho{ρ}
\def\sigma{σ}
\def\tau{τ}
\def\upsilon{υ}
\def\phi{φ}
\def\varphi{ϕ}
\def\chi{χ}
\def\psi{ψ}
\def\omega{ω}
\def\varsigma{ς}
\def\varrho{ϱ}
\def\vartheta{ϑ}

\def\Alpha{Α}
\def\Beta{Β}
\def\Gamma{Γ}
\def\Delta{Δ}
\def\Epsilon{Ε}
\def\Zeta{Ζ}
\def\Eta{Η}
\def\Theta{Θ}
\def\Iota{Ι}
\def\Kappa{Κ}
\def\Lambda{Λ}
\def\Mu{Μ}
\def\Nu{Ν}
\def\Xi{Ξ}
%\def\Ο{O}
\def\Pi{Π}
\def\Rho{Ρ}
\def\Sigma{Σ}
\def\Tau{Τ}
\def\Upsilon{Υ}
\def\Phi{Φ}
\def\Chi{Χ}
\def\Psi{Ψ}
\def\Omega{Ω}

\begin{document}
\selectlanguage{english}

English text

$$α=\frac{β}{γ_s \text{ or }\oldgamma_s} \text{ or }\alpha=\frac{\beta}{\gamma_\sigma} \text{ and } 6_p$$

\selectlanguage{greek}

Ελληνικό κείμενο εδώ

$$α=\frac{β}{γ_s \text{ or }\oldgamma_s} \text{ or }\alpha=\frac{\beta}{\gamma_\sigma} \text{ and } 6_p$$

\setmainfont{FreeSans}
\selectlanguage{english}

English text

$$α=\frac{β}{γ_s \text{ or }\oldgamma_s} \text{ or }\alpha=\frac{\beta}{\gamma_\sigma} \text{ and } 6_p$$

\selectlanguage{greek}

Ελληνικό κείμενο εδώ

$$α=\frac{β}{γ_s \text{ or }\oldgamma_s} \text{ or }\alpha=\frac{\beta}{\gamma_\sigma} \text{ and } 6_p$$

\end{document}


Output:

PS: The package MnSymbol didn't used here and see the correction on the \oldgamma spacing.