# Is there something like cdots that uses less space?

Is there an alternative where I still have three dots but less horizontal space is required?

For instance,

s_1s_2 \cdots s_L


results in:

I would like something more compact

You can define your own version, with negative kerning:

\documentclass{article}

\DeclareRobustCommand
\Compactcdots{\mathinner{\cdotp\mkern-2mu\cdotp\mkern-2mu\cdotp}}

\begin{document}
\pagenumbering{gobble}

$$s_1s_2 \cdots s_L$$

$$s_1s_2 \Compactcdots s_L$$

\end{document}


After egreg's comment:

Using the version above, with \cdotp (a \mathpunct), the space after each dot is \thinmuskip (which defaults to 3mu), so \cdotp\mkern-2mu\cdotp is the same as {{\cdot}\mkern3mu\mkern-2mu{\cdot}} which is the same as {{\cdot}\mkern1mu{\cdot}}. \cdot is a \mathbin, so {\cdot} kills the spacing around it.

One difference between these is that with the former, if you change \thinmuskip, the spacing changes accordingly. With the second, the spacing is fixed:

\documentclass{article}

\DeclareRobustCommand
\Compactcdots{\mathinner{\cdotp\mkern-2mu\cdotp\mkern-2mu\cdotp}}

\DeclareRobustCommand
\Fixedcdots{\mathinner{{\cdot}\mkern1mu{\cdot}\mkern1mu{\cdot}}}

\begin{document}

\begin{tabular}{*3{p{1.5cm}}}
$$s_1s_2 \cdots s_L$$ & $$s_1s_2 \Compactcdots s_L$$ & $$s_1s_2 \Fixedcdots s_L$$ \\
\end{tabular}

\thinmuskip=0mu
\begin{tabular}{*3{p{1.5cm}}}
$$s_1s_2 \cdots s_L$$ & $$s_1s_2 \Compactcdots s_L$$ & $$s_1s_2 \Fixedcdots s_L$$ \\
\end{tabular}

\end{document}


P.S. Don't ever use \thinmuskip=0mu.

• Why not {\cdot}\mkern1mu{\cdot}\mkern1mu{\cdot}? – egreg Oct 15 '18 at 14:39
• what would be the difference in that case? – Juan Leni Oct 15 '18 at 15:16
• Visually, none, as far as my myopia can see :P The \cdot is defined as a binary operator (\mathbin), so {\cdot} kills the binary spacing around it and the \mkern1mu adds some space. \cdotp (as I found out after egreg's comment) is defined as a punctuation (\mathpunct) and the negative kern kills some of the spacing. I don't know if there is another difference between one and another. @egreg? – Phelype Oleinik Oct 15 '18 at 15:26
• @PhelypeOleinik The spacing after punctuation is governed by \thinmuskip, whose default value is 3mu; adding 3mu and subtracting 2mu – egreg Oct 15 '18 at 15:27

There are better answers above for "compacting" variations on cdots, This answer is just to illustrate there is more to latex dots than may be obvious so without any manipulation dotsi (dots for integrals) generates a tighter overall length

    \documentclass{article}
\usepackage{amsmath,amssymb}

\DeclareRobustCommand % Copied for comparison with answer by Phelype Oleinik
\Compactcdots{\mathinner{\cdotp\mkern-2mu\cdotp\mkern-2mu\cdotp}}

\begin{document}

To indicate the omission of values in a repeated operation, a centred ellipsis is
used between two operation symbols (Midline horizontal ellipsis, or in LaTeX terms
three dots, centered). Due to it's ambiguity some authors [1] have recommended avoiding
its use in mathematics altogether.\\
\\
$s_1s_2\cdots s_L$ cdots\\
$s_1s_2\Compactcdots s_L$ Compactcdots\\
$s_1s_2\dotsb s_L$ dotsb\\
$s_1s_2\dotsi s_L$ dotsi\\
$s_1s_2\dotsm s_L$ dotsm\\

[1]  https://en.wikipedia.org/wiki/Ellipsis (cite ref-26) Roland Backhouse,\\
Program Construction: Calculating Implementations from Specifications.\\ Wiley (2003), page 138

\end{document}