6

I want to lay out a sequence of adjacent variables in math-mode with reasonable spacing between the letters. But LaTeX produces output which (to me) is "obviously wrong":

enter image description here

\documentclass{article}

\begin{document}
\[B X A \Gamma C\]
\[B\;X\;A\;\Gamma\;C\]
\[B\;X\;A\;G\;C\]
\[B A \Gamma C\]
\end{document}

To clarify, I don't want these to appear as one word, but as consecutive variables, as in a product or curried function application.

What's going on here? X is clearly causing problems, but even in the last example the A looks slightly too close to the gamma and too far away from the B.

Why does LaTeX perform so badly on such a simple example, and how do I get better kerning by default?

This question is related.

7
  • 2
    The middle two with hand spacing are bad, the top one looks about as good as can be expected with XA the bottom one isn't brilliant but there are no font-specified kerns between letters in different fonts, as is the case \Gamma C – David Carlisle Oct 18 '14 at 13:32
  • @egreg Yes, I want the consecutive letters to scan visually like a product (possibly with a little extra spacing, as with the explicit \;). But I didn't understand your explanation about italic correction - if I was typesetting this out by hand I would place the A slightly to the left, even in the first case. – Roly Oct 18 '14 at 13:34
  • @DavidCarlisle You seem to be saying that for the second example, the spacing is bad, but as good as can be expected. Well, I agree it's bad, but I expect better :) – Roly Oct 18 '14 at 13:36
  • @Mico Thanks, but that's not what I'm after; clarified the question accordingly. – Roly Oct 18 '14 at 13:38
  • 1
    If the font doesn't have this info then LaTeX doesn't have much to do. Besides this is our brain failing to match the borders of X and A. Try BX\!A\Gamma C – percusse Oct 18 '14 at 16:44
5

You can use math kerning, but its values will depend on the pair of letters, and probably on the math font that you use. How do you like this one:

\documentclass{article}

\begin{document}

\[B X \mkern-1mu N \mkern-2mu A\mkern2mu Γ \mkern1mu C\]

\[B X \mkern-1mu A\mkern2mu Γ \mkern1mu C\]

\[B A\mkern2mu Γ \mkern-0.5muA\]

\end{document} 

enter image description here

5
  • Your posted image doesn't match with the code you posted. – A.Ellett Oct 18 '14 at 16:06
  • This is a significant improvement (but see comment above :) – Roly Oct 18 '14 at 16:15
  • You need to put the A and X in the given order – percusse Oct 18 '14 at 16:41
  • @Roly: Right, they correspond to two different attempts. I'll math them at once. – Bernard Oct 18 '14 at 16:50
  • @percusse: Done. I wanted to draw attention to the fact that there were also problems with the letter N. – Bernard Oct 18 '14 at 16:52

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.