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.

Text in underbrace under sum is bigger than other.

\sum_{{\{a,b,c,d,e,f\}=\{\underbrace{a,b,c,d}_{4\ terms}},e,f\}}

enter image description here

How can I solve this neatly.

share|improve this question
1  
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Jul 2 at 18:45
    
Related: consistent math font size in a formula –  egreg Jul 2 at 19:23
add comment

1 Answer 1

You could add the math-mode directive \scriptstyle to the first argument of \underbrace:

enter image description here

\documentclass{article}
\usepackage{amsmath} % provides "\underbrace" and "\text" macros
\begin{document}
\[
\sum_{{\{a,b,c,d,e,f\}=\{\underbrace{\scriptstyle a,b,c,d}_{\text{4 terms}}},e,f\}}
\]
\end{document}

Addendum, prompted by a comment by @Werner:

A second issue (besides the one raised in your posting, about getting the font size right for the first argument of \underbrace) arises if the width of the material in the second argument of the \underbrace macro is greater than that of the first argument. In such cases, you can encase the second argument in a \mathclap directive. (\mathclap is a macro provided by the mathtools package.)

enter image description here

\documentclass{article}
\usepackage{mathtools}      % provides "\mathclap" macro,
                            %    loads amsmath package
\setlength\textwidth{2.5in} % just for this example
\begin{document}
without \verb|\mathclap|:
\[
\sum_{\{a,b,c,d,e,f\}=\{\underbrace{\scriptstyle a,b,c,d}_{\text{Lots and lots of terms}},e,f\}}
\]

\medskip
with \verb|\mathclap|:
\[
\sum_{\{a,b,c,d,e,f\}=\{\underbrace{\scriptstyle a,b,c,d}_{\mathclap{\text{Lots and lots of terms}}},e,f\}}
\]
\end{document}
share|improve this answer
2  
If 4 terms is wider than a,b,c,d, you may want to consider using \mathclap{..} from mathtools. –  Werner Jul 2 at 18:50
    
@Werner - I've provided an addendum to illustrate how \mathclap can fix the problem that arises if the width of the second argument of \underbrace exceeds that of the first argument. –  Mico Jul 2 at 21:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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