TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My question is: How can I write an index above a set of dots? I mean

\mathbb{R} \cdots^{HERE} \mathbb{R}

just to say that I have "n" times cartesian product of R.

share|improve this question
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – clemens Feb 10 '13 at 10:43
Oh okey ^^ thanks for the tip :) – Dan Feb 10 '13 at 10:44

Let's make a more realistic example: you want to put n above the dots to denote an omission of terms. Here are possible codes:


\[ X_{1}\times \stackrel{n}{\cdots} \times X_{n} \]

\[ X_{1}\times \overset{n}{\cdots} \times X_{n} \]

\[ X_{1}\times \cdots \times X_{n} \]

The last is just for comparison. Here's the result:

enter image description here

As it's immediately seen, the first has all the spacing wrong because, by rule, TeX transforms the binary operation symbols \times into ordinary symbols since they aren't between "legal" operands. This doesn't happen with \overset and, in fact, the spacings are correct if we compare the second and third lines.

If the "superscripted \cdots doesn't appear between binary operators, it might be necessary to help TeX in adding the correct spacings and


would be the right incantation.

Final version

Taking into account all of the above, I believe that the best is to define a new command:


where an optional argument is reserved for additional spacing in case it's needed (I think to overlong superscripts); so



or, maybe,


if the superscript really clashes with the adjacent terms.

share|improve this answer
\[ a \stackrel{\scriptstyle\mathrm{HERE}}{\cdots}  b\]

enter image description here

An alternative if you use amsmath and want to make egreg happy would be \overset

\[ a \overset{\mathrm{HERE}}{\cdots}  b\]

enter image description here

share|improve this answer
Thank you very much!! :D – Dan Feb 10 '13 at 10:53
Wouldn't \overset be better? – egreg Feb 10 '13 at 11:07

If you place the n index above the dots, there may actually be some ambiguity as to whether the Cartesian product contains n or n+2 elements (since the qualifier may be perceived not to include the first and last element). To avoid any such ambiguity, you could use the \overbrace command to generate the following expression:

enter image description here

\[ \overbrace{\R\times\cdots\times\R}^{\text{$n$ times}} \]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.