# How do I format the indices for an indexed equation? [closed]

I have a piecewise cubic function where I define the segments as follows:

\begin{align} \label{eq:segment}
s_i(x) &= a_i(x-x_i)^3 + b_i(x-x_i)^2 + c_i(x-x_i) + d_i &\text{for $i = 1, 2, \ldots, n-1$}.
\end{align}


Is there a standard way to specify the valid values of i? Here are things I've thought about and what I don't like about them:

• for $i = 1, 2, \ldots, n-1$ - takes up a lot of space (not ideal for longer equations).
• for $1 \le i \le n-1$ - makes i look continuous.
• for $i \in [1, n-1]$ - makes i look continuous.
• for $i \in \mathbb{N}(1, n-1)$ - I'm not sure if this is valid notation for a range of natural numbers, or even if a compact notation like this exists.
-
I'd go with one of the first two options. However, I don't think that this question is on-topic. – Caramdir Jul 27 '11 at 4:22
@Caramdir Do you mean the first of the four options? Would this question be more appropriate on Math.SE? If so, what's the best way to migrate it? – Brandon Jul 27 '11 at 4:30
It would take a moderator to move it to Math.SE. For what it's worth, for a compact notation I would go with option 2. The use of i and n certainly suggests that both are integers so I disagree with your conclusion. If you really feel that this is ambiguous (maybe because of earlier stuff) you could put a phrase before the equation "in which (i) is an integer" or even "in which (i) is an integer strictly between (0) and (n)". – Andrew Stacey Jul 27 '11 at 9:48
Those brackets should have been $$ and $$s. – Andrew Stacey Jul 27 '11 at 9:48
@Brandon: I meant that I'd use version one or version two. – Caramdir Jul 27 '11 at 16:02

## closed as off topic by egreg, Andrew Stacey, Caramdir, Brandon, Lev BishopAug 3 '11 at 5:02

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

There is also set notation:

\left\{ 1\le i \le n-1 \middle\vert i \in \mathbb{N} \right\}

It looks more 'mathematical' but does not save a lot of space.

P.S. It seems that the question has little to do with TeX.

-
 The above notation, referred to as set builder notation is defined according to ISO 80000-2:2009, Mathematical signs and symbols to be used in the natural sciences and technology. It superseded the historical ISO 31-11. – Werner Jul 27 '11 at 22:34

Of the options you listed, 2 is best. Although it looks continuous, the context makes it clear it's discrete. The first version is sloppy math (but done a lot); it looks like $i$ is equal to a finite sequence. Options 3 and 4 aren't standard.

I just realized that options 3 and 4 indicate that you probably aren't using the amsmath package. Put \usepackage{amsmath} in the preamble and try

for $i \in \{1,2, \ldots, n-1 \}$

This is the most precise way to define your cubic function.

-