[Tex/LaTex] Spacing around \cdot when used as a wildcard

spacing

I have to use \cdot as a wildcard indicator in an expression like: K(\cdot,y).

My concern is: is the spacing around the \cdot correct? should I force something in either one side or the other of it?

Best Answer

For what it's worth, this is converted from comments. I'm no expert on mathematical typography, so these are if anything suggestions.


My first idea was

K({\cdot},y)

which produces the same spacing as

K(\cdot,y)

because neither ( nor , is treated as an ordinary character as 5 and x would be in 5 \cdot x.

If you rather want to reproduce the spacing from 5 \cdot x you can use empty groups to fake them.

K({}\cdot{},y)

does look more like something like

K(x,y)

You can, of course, specify any space around the \cdot with \mspace or the primitive \mkern which both take dimensions in mu (math unit: mu = 1/18 em):

{{\mkern 2mu\cdot\mkern 2mu}}

I recommend to define a macro for this kind of wildcard/placeholder so that, if you ever change your opinion about the correct spacing you can just change the macro's definition (aka “The LaTeX way”).

\newcommand*\wc{{\mkern 2mu\cdot\mkern 2mu}}

Code

\documentclass{article}
\newcommand*\wc{{}\cdot{}}
\begin{document}\noindent
\( K (  \cdot  , y ) \) \\
\( K ({ \cdot} , y ) \) \\
\( K ({}\cdot{}, y ) \) \\
\( K (  \wc    , y ) \) \\
\( K (        x, y ) \)
\end{document}

Output

Output