$\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n\] $
Do I need a special package, or is something else wrong with this?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIt seems you are struggling with some very basic tasks of LaTeX. Please consider consulting an introductory text. You can find an exhaustive list here:
You are trying to nest displayed math inside inline math. This cannot work. You can only use one of the two at a time.
Display math is introduced by \[ ... \]
whereas inline math is delimited by $ ... $
. Without context it's hard to say which one is more appropriate here, but I guess it is display math (i.e. centered horizontally and on a separate line).
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n \]
\end{document}
$\sum\limits_{k=0}^{n} \binom{n}{k} = 2^n$
.
Apr 2, 2022 at 18:22
You can use the command \displaystyle
in an inline expression (with $...$
) to have equations displayed as in isolated math mode (the one you obtain with \[...\]
).
In your example, it would be:
$\displaystyle\sum_{k=0}^n \binom{n}{k} = 2^n$
.
\[...\]
and $...$
. Though it is not proper typography, it can prove useful in some context, and it is the author decision to make.
Apr 6, 2022 at 11:56
\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n\]
.\[
inside$
use$
for inline math or\[
for display math, not both.\binom
is not defined by default, (comes fromamsmath
)$ $$ \sum_{k=0}^n ... $$ $
which seems to be over complicated.