What is the \cdot alternative for comma, or any other punctuation symbol?
I want to raise comma symbol in a list of fractions to the fraction line. Comma is placed below when used next to fraction.
Asked
Active
Viewed 1.3k times
17
1 Answers
20
You can use \raisebox to move it where you want. Here is a comparison of the inline \frac and the displaystyle \dfrac. Based on @GonzaloMedina's suggestions I have provided two versions, each which provides slightly different spacing around the comma:
- one that uses
\mathbin(spacing similar to\cdot) and - another that uses
\mathpunct(spacing more like a punctuation)

Code:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\CommaBin}{\mathbin{\raisebox{0.5ex}{,}}}
\newcommand{\CommaPunct}{\mathpunct{\raisebox{0.5ex}{,}}}
\begin{document}
\verb|\mathbin|: $\frac{1}{2} \CommaBin \frac{3}{4} \CommaBin \dfrac{1}{2} \CommaBin \dfrac{3}{4}$
\bigskip
\verb|\mathpunct|: $\frac{1}{2} \CommaPunct \frac{3}{4} \CommaPunct \dfrac{1}{2} \CommaPunct \dfrac{3}{4}$
\end{document}
Peter Grill
- 223,288
\mathopso\Commawould behave as a math operator (like\cdot)? – Gonzalo Medina Mar 08 '12 at 03:58\mathpunctwould be better than\mathop. Since the intent is not clear (at least to me) you could suggest both options. – Gonzalo Medina Mar 08 '12 at 04:46\cdotis a\mathbin, not a\mathop. – egreg Mar 08 '12 at 10:08\cdotis defined as a binary symbol, not as an operator, so it should be\mathbininstead of\mathop. – Gonzalo Medina Mar 08 '12 at 12:22\mathbin. – Peter Grill Mar 08 '12 at 15:19