Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

why does this give an error?

\begin{align*}
    $\sum_{i=0}^K n_{\text{i}} * P *  1000$
\end{align*}

why cant I use align* for my math formula which includes a summation?

share|improve this question
7  
Remove the dollar signs. align already enters math mode. The dollar signs are for inline math. –  Peter Grill Mar 10 '13 at 6:16
3  
Additionally, if your summation index i is used in the further formula, it's still a variable and should not be set in \text{i} but just as i. In this case especially (for math) to distinguish the variable i from the complex unit \text{i} - or as i prefer even \textrm{i}. –  Ronny Mar 10 '13 at 7:15
add comment

closed as too localized by zeroth, lockstep, Marco Daniel, egreg, cgnieder Mar 10 '13 at 19:09

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

In addition to the comments above, the align and align* environments need the amsmath package. Here is a working example.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align*}
    \sum_{i=0}^K n_i * P *  1000
\end{align*}
\end{document}

In most circumstances one would not use * for multiplatication, a blank is sufficient, or \times can be used instead for "emphasis". Also, your example contains no alignment point, so probably the ams environment equation* (for a single line) or gather* (if there are multiple lines) would be more appropriate.

share|improve this answer
    
Or \cdot for those who are used to those kind of things... :) –  zeroth Mar 10 '13 at 12:00
    
@zeroth Yes, that's a good alternative. –  Andrew Swann Mar 10 '13 at 12:01
add comment

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