When I write something like
$\mathrm{C}^*$-algebra
for a C*-algebra, the space between * and - is too large. How do I change this? Are there general criteria on how much such space should be shrinked?
Here's an analysis of what happens:
\documentclass[10pt]{article}
\usepackage{tabularx}
\usepackage[table]{xcolor}
\setlength{\fboxrule}{0.1pt}
\setlength{\fboxsep}{-\fboxrule}
\begin{document}
$\mathrm{C}^*$-algebra
\fbox{$\mathrm{C}^*$}-algebra
\fbox{$\mathrm{C}^{\fbox{$\scriptstyle*$}}$}-algebra
\begin{tabular}{@{}ll}
\fbox{$\mathrm{C}^*$}\kern-.1ex-algebra &
$\mathrm{C}^*$\kern-.1ex-algebra \\
\fbox{$\mathrm{C}^*$}\kern-.15ex-algebra &
$\mathrm{C}^*$\kern-.15ex-algebra \\
\fbox{$\mathrm{C}^*$}\kern-.2ex-algebra &
$\mathrm{C}^*$\kern-.2ex-algebra \\
\fbox{$\mathrm{C}^*$}\kern-.25ex-algebra &
$\mathrm{C}^*$\kern-.25ex-algebra \\
\fbox{$\mathrm{C}^*$}\kern-.3ex-algebra &
$\mathrm{C}^*$\kern-.3ex-algebra \\
\end{tabular}
\end{document}

The first three rows show the normal typesetting, which I don't find really bad, but it's subjective. The following rows show the same with increasing amount of (negative) kerning; on the left you can see the relation of the hyphen with the bounding box of “C*”. When you have decided the right amount, do
\newcommand{\csalg}{$\mathrm{C}^*$\kern-.1ex-algebra}
and type \csalg{} when you want to use the term. Choose the name you prefer, of course. It's probably worthy defining it even if you eventually decide for no kerning.
$K$-algebra and vector space over~$K$.. Especially the extra space to the between the K and the dot is annoying to look at. The only automatic solution I have found so far is to make a callback in LuaTeX to test for specific combinations.
– Gaussler
Jun 01 '16 at 18:18
This answer presents two other ideas:
microtypeThe TeX engine pdfteX supports a feature "character protrusion". Certain characters (e.g. -, ., ,) are allowed to move into the margins. This can improve the visual smoothness of the margins.
Macro \leftprotrude grabs the next character and looks at its value for the protrusion into the left margin. \lpcode<font><character slot> expands to an integer number, the unit is a per mill of 1em.
Package microtype enables character protrusion and configures some values for the protrusion (they are font-dependent).
For fun, the example also shows some alternatives:
\textsuperscript{*}\mathop).\documentclass{article}
\usepackage{microtype}
\newcommand*{\leftprotrude}[1]{%
\begingroup
\leavevmode
\kern-.001\dimexpr\numexpr(\lpcode\font`#1)em\relax
\endgroup
#1%
}
\newcommand*{\CalgA}[1]{%
\mbox{$\mathrm{C}^{*}$#1-algebra}%
}
\newcommand*{\CalgB}[1]{%
\mbox{$\mathop{\mathrm{C}}\nolimits^{*}$#1-algebra}%
}
\newcommand*{\CalgC}[1]{%
\mbox{C\textsuperscript{*}#1-algebra}%
}
\begin{document}
\begin{tabular}{l@{}|l@{}|l@{}|l}
\CalgA{} & \CalgB{} & \CalgC{} & \small(unmodified) \\
\CalgA{\leftprotrude} & \CalgB{\leftprotrude} & \CalgC{\leftprotrude}
& \small\verb|\leftprotrude| \\
\CalgA{\negthinspace} & \CalgB{\negthinspace} & \CalgC{\negthinspace}
& \small\verb|\negthinspace| \\
\end{tabular}
\end{document}
\!in mathmode for a small negative space. – Steven B. Segletes Jul 22 '13 at 14:00