8

I noticed that, in the many math fonts, the letter f looks asymmetrical when it is to the right of a binary operator. I think it is because the spacing is computed from the bottom tip of the f, instead of from the middle of the f.

In the following example, the first row the f is to the left of the operator and looks fine. In the second row the f is to the right and looks like the space between the circle and the f is too wide. In the third row I kludged with a negative \! space before the f; it looks better but perhaps a bit too narrow.

Kerning examples with composition of f and g

As mentioned, the best workaround I could find is to manually add a \! before every single f. Is there a more robust or accurate way to fix this? I presume I must not be the first one to run into this issue where the function composition operator looks wonky when one of the functions is named f...

\documentclass{article} \begin{document} Hello $f \circ g$. Hello $g \circ f$. Hello $g \circ \! f$. \end{document} 
1
  • 1
    Have you tried \mkern-1mu or \mkern-2mu instead of \! -- which is equivalent to \mkern-3mu? (Thinspace equals 3mu, and negative thinspace equals -3mu.) Speaking for myself (who else??), I think $g \circ \mkern-1.5mu f$ looks best. :-) Commented Oct 7 at 6:07

1 Answer 1

4

Use a different command than \circ, so you can define it to suit your taste.

\documentclass[twocolumn]{article} \usepackage{amsmath} \ExplSyntaxOn \newcommand{\cmp} { \DOTSB \circ \peek_meaning:NT f { \mspace{-1.5mu} } } \ExplSyntaxOff \begin{document} With \verb|\circ| \[ f\circ g\quad g\circ f \] With \verb|\cmp| \[ f\cmp g\quad g\cmp f \] Dots and \verb|\circ| \[ g\circ\dots\circ f \] Dots and \verb|\cmp| \[ g\cmp\dots\cmp f \] \end{document} 

output

2
  • Yet for something like g \circ \varphi, the spacing looks OK to my eyes. Commented Oct 8 at 0:39
  • @murray The problem is only with f that's very slanted. Commented Oct 8 at 16:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.