1

I'm writing a math equation inside which I have to express curly brackets. What I intend to write should look like {h_n}^infinity_0

My code is:

\par 
    The problem asks for estimates of the sizes of the coefficients $\{h_{n}\}\limit_{0}^{\infty}$.

While the preview shows this as exactly what I want, when I try compiling it I get an error message that calls it an "undefined control sequence".

I don't understand why: could anyone help explain this?

  • 2
    You are probably looking for \limits, not \limit. – Werner Feb 28 '15 at 19:22
2

I wouldn't use \limits in this case since it'll end up placing the lower and upper limits of the sequence below and above the right-hand curly brace -- probably not what you intended.

If you write \{h_{n}\}_{0}^{\infty}$ (see the middle example below, labelled "not awful"), the upper and lower limits may look like they're too close to each other, especially in text-style math mode. One way to fix this is to encase the closing curly brace, \}, in a pair of braces to change its status from "math-close" to "math-ordinary"; doing so will loosen the spacing quite a bit.

It may be best, though, to define a custom macro called, say, \seqwlimits to standardize the task at hand and to assure adequate vertical separation of the upper and lower limits.

enter image description here

\documentclass{article}
\newcommand\seqwlimits[3]{\{#1\}_{\mathstrut#2}^{\mathstrut#3}}
\begin{document}
\begin{tabular}{ll}
huh??    & ${\{h_{n}\}}\limits_{0}^{\infty}$\\[2ex]
awful    & $\{h_{n}\}\limits_{0}^{\infty}$\\[2ex]
not awful& $\{h_{n}\}_{0}^{\infty}$\\[2ex]
better   & $\{h_{n}{\}}_{0}^{\infty}$\\[2ex]  % note the extra { and }
best     & $\seqwlimits{h_n}{0}{\infty}$\\
\end{tabular}
\end{document}
|improve this answer|||||
  • I agree that your best solution is better than your better solution, which is better than the bad one. So, why isn't \mathstrut used by default? Is it better only with 2 scripts? – Sigur Feb 28 '15 at 19:46
  • 1
    @sigur - I've modified my answer to provide two more possibilities. By default, \} (the closing curly brace) is assigned state "math-close" by TeX, and any subsequent sub- and superscripts are set in very tight mode by design. One way to overcome the cramped look is to change the state of the closing curly brace to "math-ordinary", e.g., by encasing it in curly braces (see the case labelled "better" in the example). To get even better spacing, IMNSHO, I suggest using \mathstrut directives, which insert invisible objects with height and depth of parentheses. – Mico Feb 28 '15 at 20:10
  • I ended up getting a similar error to my original one when I tried your Best solution, but your Not Awful and Better work great. Thank you very much! – Sammieo Mar 1 '15 at 15:35

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.