Regard the following document:




For each $k$ we denote by $\lambda_k$ the $k$th symmetric polynomial
in the $x_i$s; that is, we define
\[\textstyle\lambda_k := \sum_\mathrm{$I\subseteq\mathbb{N}_n$ such that $|I|=k$}x_I.\]


When I try to compile it, I get:

! Missing } inserted.
<inserted text> 
l.9 ...\mathrm{$I\subseteq\mathbb{N}_n$ such that $|I|=k$}

Why? The braces are surely balanced.

(Surrounding the call to \mathrm in a set of braces makes no difference.)


The \mathrm macro sets its input in a roman font, but it is still in (display) math mode. So the $s inside \mathrm are confusing TeX. It's as if you are trying to embed math mode within display math mode.

I think what you want instead is

    \lambda_k := \sum_{\text{$I\subseteq\N_n$ such that $|I|=k$}}x_I.

But that won't work either until you tell TeX what you mean by \N. So if you insert into the preamble or someplace else before the first use:


your document will successfully compile.

A few comments:

  • Why are you using \textstyle? In display math some symbols like the \sum operator are bigger. Try it without; you might like TeX's default choices.

  • Whitespace is your friend. When I type displayed equations I put the \[ and \] on their own lines and indent the equation in the middle. That way the source somewhat resembles the final document in that displayed math mode is "displayed."

  • You might find this discussion we had on colon-equals interesting: How to typeset $:=$ correctly?

  • I realised a few moments ago that I had used \mathrm when I meant \textrm.
    – Hammerite
    Feb 25 '11 at 1:05
  • With regards to \textstyle - I don't like the huge operators, fractions etc. TeX uses for displayed maths, but apart from that, if you have a large subscript to add to an operator it looks stupid because the operator floats centred above the subscript in a sea of whitespace. (Yes, I know it is possible to have TeX use the larger operator and position the subscript the way it is positioned when using \textstyle.)
    – Hammerite
    Feb 25 '11 at 1:13
  • @Hammerite: If you want to avoid large subscripts taking up horizontal space you can use \mathclap. See for example “Why do I have so much free space on the left-hand side of my tikz diagram?”. Feb 25 '11 at 1:27
  • 1
    @Matthew: Good answer, but I find your description of the problem in the first paragraph misleading: "confusing TeX" is OK, but I think that "then end regular math mode in the middle" doesn't fit. You just can't end regular math mode when you're in display math mode (maybe you didn't want to convey that, but it's hard not to read it like that). The problem at hand is more that you can't start regular math mode in display math mode. Feb 25 '11 at 8:17
  • @Hendrik: Good point. I edited; hope it makes more sense. Feb 25 '11 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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