6

I am attempting to use Minion Pro with the fontspec package in XeLaTeX, but am encountering problems with the vertical alignment of subscripts when used with certain Greek characters:

\documentclass[a4paper,12pt,oldfontcommands]{article}
\usepackage{amsmath}
\usepackage[MnSymbol]{mathspec}
\usepackage{MnSymbol}
\defaultfontfeatures{Ligatures=TeX}
\setallmainfonts{Minion Pro}

\begin{document}

\begin{equation}
  V_\text{PSD} = V_sV_m\sin(\omega_r t + \phi_{\!s})\sin\left(\omega_r t + \phi_s\right)
\end{equation}

\begin{equation}
  \zeta_s \varsigma_s \gamma_s \kappa_s \phi_{\!s} \varphi_s \theta_s \xi_s \Xi_s f_s p_s 6_6 6_p p_6
\end{equation}

\end{document}

Various subscript alignments

As can be seen in the image, the subscripts for some letters are in the correct places, except for zeta, sigma variant, gamma, both phi variants, and lowercase xi.

There are many other answers around concerning the kerning of external fonts with XeLaTeX, but this doesn't seem to be the issue here as using a fix such as \phi_{\!s} only brings the subscripted character closer and does not change the vertical alignment (as I have put in two examples above).

Why is this occurring? Is it possible to prevent it?

2
  • Any updates here? Fits the answer all your needs? Would you accept/ vote for the answer? - Or are you looking for another solution?
    – Bobyandbob
    May 14, 2018 at 19:51
  • Actually, I switched to using plain ol' LaTeX with the MinionPro package... I felt that having to redefine all the greek letters is quite hacky and not something one would want to have if it can be avoided. May 15, 2018 at 5:22

1 Answer 1

2

Edit: See the last code for the suggested solution

Old answer:

Seems that typing the Greek letters by a Greek keyboard solves the problem.

After many tests, found that the next code works with my font:

\documentclass[11pt,oneside]{article}

\usepackage{amsmath}
\usepackage[MnSymbol]{mathspec}
\usepackage{MnSymbol}
\defaultfontfeatures{Ligatures=TeX}
\setallmainfonts{Linux Libertine O}
\usepackage{polyglossia}
\setmainlanguage{greek}
\setotherlanguage{english}
\setmainfont{Linux Libertine O}
%\newfontfamily\greekfont{Linux Libertine O}

\begin{document}
\selectlanguage{english}
\begin{equation}
V_\text{PSD}= V_sV_m\sin(\omega_r t + φ_{s})\sin\left(\omega_r t + φ_s\right)
\end{equation}

\begin{equation}γ_s  ζ_s ς_s  κ_s φ_{s} \varphi_s θ_s ξ_s Ξ_s f_s p_s 6_6 6_p p_6
\end{equation}
\begin{equation}\gamma_s  \zeta_s \varsigma_s  \kappa_s \phi_{s} \varphi_s \theta_s \xi_s \Xi_s f_s p_s 6_6 6_p p_6
\end{equation}
\selectlanguage{greek}
Κείμενο εδώ
\end{document}

Try with your font too.

Output:

enter image description here

As you can see, the equation (2) where greek letters typed from a greek keyboard gives enough better results.

PS: You don't have to use greek as mainlanguage... You may remove it if not installed or something.

And without \setallmainfonts{Linux Libertine O} (with system default math fonts for greek -just for comparsion-) I get:

enter image description here

Edit (suggested solution):

Many people want to use greek letters but they don't have a greek keyboard. But even they do have one, it is a bad practice (in my opinion) to write from the keyboard greek letters in your math. (Let's suppose you want to create a latex code from your xelatex or you want to translate in other language and don't want to change your math code too). Then the solution is to write with the usual way your math and just redefine the greek letters in your preamble as shown below:

\documentclass[11pt,oneside]{article}    
\usepackage{amsmath}
\usepackage[MnSymbol]{mathspec}
\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{β}
\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

\[
\alpha_{α}
\beta_{β}
\gamma_{γ}
\delta_{δ}
\epsilon_{ε}
\zeta_{ζ}
\eta_{η}
\theta_{θ}
\iota_{ι}
\kappa_{κ}
\lambda_{λ}
\mu_{μ}
\nu_{ν}
\xi_{ξ}
%\ο_{o}
\pi_{π}
\rho_{ρ}
\sigma_{σ}
\tau_{τ}
\upsilon_{υ}
\phi_{φ}
\varphi_{ϕ}
\chi_{χ}
\psi_{ψ}
\omega_{ω}
\varsigma_{ς}
\varrho_{ϱ}
\vartheta_{ϑ}\]
\[
\Alpha_{Α}
\Beta_{Β}
\Gamma_{Γ}
\Delta_{Δ}
\Epsilon_{Ε}
\Zeta_{Ζ}
\Eta_{Η}
\Theta_{Θ}
\Iota_{Ι}
\Kappa_{Κ}
\Lambda_{Λ}
\Mu_{Μ}
\Nu_{Ν}
\Xi_{Ξ}
%\Ο_{O}
\Pi_{Π}
\Rho_{Ρ}
\Sigma_{Σ}
\Tau_{Τ}
\Upsilon_{Υ}
\Phi_{Φ}
\Chi_{Χ}
\Psi_{Ψ}
\Omega_{Ω}
\]


\selectlanguage{greek}

Ελληνικό κείμενο εδώ
\end{document}

Output:

enter image description here

2
  • Thanks for the answer! Any idea why this works? It is not an ideal solution as I've already got a large document with Greek letters as math macros. Oct 17, 2017 at 6:31
  • 3
    @tusky_mcmammoth: I don't know why this works. I just found it by testing... I initially thought that alphabeta package solves the problem, but found out it doesnt. As for your document, you can always redefine the math macros like (\def\alpha{α} etc) just after loading all the packages
    – koleygr
    Oct 17, 2017 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .