5

With the following code, the last three items are rendered with the subscript overlapping the tail of the Q. Tested with XeLaTeX and LuaLaTeX.

I can manually fix this, but what is the right solution?

enter image description here

\documentclass{standalone}

\usepackage[p,osf]{ebgaramond}
\usepackage{unicode-math}
\setmathfont{Garamond-Math.otf}

\begin{document}
  $Q_i \mathcal{Q}_i \mathrm{Q}_i \mathbf{Q}_i \mathbb{Q}_i$
\end{document}
2
  • Welcome to TeX.SE!
    – Mensch
    Commented Jan 10, 2023 at 16:58
  • \mathbf is a legacy command for the unicode-math package. Replacing \mathbf{Q}_i with \symbfit{Q}_i takes care of one problem.
    – Mico
    Commented Jan 10, 2023 at 17:29

1 Answer 1

7

I was asked to add a ConTeXt lmtx answer to this, I hope someone will be able to translate into LaTeX for you.

In ConTeXT lmtx it is easy to implement these changes in so-called goodie files. In this case, a bottom right kern seems to be what is needed. I added

{
  tweak = "kerns",
  list  = {
    [0x51]                  = { bottomright = 0.25 }, -- Upright Q
    [0x1D410]               = { bottomright = 0.2  }, -- Bold Q
    [0x1D478]               = { bottomright = 0.05 }, -- Bold italic Q
    [0x211A]                = { bottomright = 0.2  }, -- Blackboard bold Q
    [0x1D5B0]               = { bottomright = 0.05 }, -- Sans Q
          },
},

into the tweaks part of ebgaramond-math.lfg. Then the following test file

\setupbodyfont[ebgaramond-nt]
\showglyphs

\startbuffer
  $Q X \mathrm{Q} X \mathbf{Q} X \mathbi{Q} X \mathss{Q} X \mathcal{Q} X   \mathbb{Q} X  $\par
  $Q_i \mathrm{Q}_i \mathbf{Q}_i \mathbi{Q}_i \mathss{Q}_i \mathcal{Q}_i   \mathbb{Q}_i  $\par
\stopbuffer

\startTEXpage[offset=1dk]
Unfixed:\par

\getbuffer

\switchtobodyfont[ebgaramond]
Fixed:\par

\getbuffer
\stopTEXpage

gives the following output:

with and without fixes

2
  • 4
    who'd ask for such a thing? :-) +1 Commented Jan 10, 2023 at 17:29
  • 3
    Must be a secret ConTeXt user.
    – mickep
    Commented Jan 10, 2023 at 17:37

You must log in to answer this question.

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