# Subscript spacing with mathdesign

I have a rather elaborate font setup in a larger document, were I recently noticed some funny spacing with greek letters and subscripts in mathmode.

I verified on a MWE (below) that it's not cmap, microtype, or even lato (why should it ever?). The culprit seems to be mathdesign. I have a sort-of-fix with a sledgehammer – use negative space where it feels right, but this is impossibly a correct solution. It also requires a different amount of spacing in each letter pair. The effect is present in TeXLive 2016 and 2017.

What is the correct fix?

The MWE version with mathdesign, garamondx:

Standard font (lmodern):

Adding negative space \! by hand:

MWE:

%\documentclass[a4paper,11pt,twoside,openright,final]{memoir}
\documentclass{standalone}

\usepackage{cmap} %% copy-paste usable

%% hyphenation?
%\usepackage[english]{babel}
\usepackage[main=british,ngerman,french]{babel}

%% quotes
\usepackage[babel=true]{csquotes}
\defineshorthand{"}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}
\useshorthands{"}
\useshorthands{"}

\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}

\usepackage{lmodern}
\usepackage{amsmath}
%% works too, finer

%% the current standard
\usepackage[garamond]{mathdesign}
%\usepackage[garamondx]{newtxmath} %% does not work, unsure if better
\usepackage[full]{textcomp}
%\usepackage{garamondx}
\usepackage[swashQ]{garamondx}
\usepackage[T1]{fontenc}
%\newcommand{\mathbold}[1]{\ensuremath{\boldmath{#1}}}
\newcommand{\mathbold}[1]{\ensuremath{\mathbf{#1}}}
\usepackage[supstfm=NewG8-sups]{superiors}

%% the real sans-serif for texts
\usepackage[scale=0.91,defaultsans]{lato}

\usepackage[activate={true,nocompatibility},kerning=true,spacing=true,tracking=true,final]{microtype}
\microtypecontext{spacing=nonfrench} %% log said so

\begin{document}

The subscripts with greek letters have too much horizontal spacing:

$\epsilon_l$, $\varepsilon_l$, $\varepsilon_{\textup{\emph{l}}}$, $\varepsilon{}_l$.

$\epsilon_g$, $\varepsilon_g$, $\varepsilon_{\textup{\emph{l}}}$, $\varepsilon{}_g$.

$d_l$, $d_l$, $d_{\textup{\emph{l}}}$.

$\xi_l$, $\xi_\phi$, $\xi_{\textup{\emph{l}}}$.

\end{document}

• possibly helpful: subscriptcorrection for mathdesign? – barbara beeton Nov 5 '17 at 17:51
• if the suggestion allowed you to solve your problem, can this question be closed? – barbara beeton Nov 5 '17 at 22:29
• Yes. (I don't see a way to do this myself.) A more permanent and easy solution would be nice, but it does not seem it is out there. – Oleg Lobachev Nov 5 '17 at 23:11