10

I'm looking for a way to write something like this:

\lbrace A_i\rbrace _{i = 1}^{n}

My goal is to put a subscript and a superscript near the right curly brace. How can I do it? The subscript and the superscript should be below and above the ends of the right curly brace.

1
  • 1
    You could use some sort of \strut. \lbrace A_i\rbrace \rule[-1.5ex]{0pt}{4ex}_{i = 1}^{n} Sep 11, 2021 at 15:13

3 Answers 3

14

The subscript and the superscript should be below and [above] the ends of the right curly brace.

Something like this?

enter image description here

\documentclass{article}
\usepackage{amsmath} % for "\overunderset" macro
\begin{document}
$
\overunderset{n}{i=1}{\rbrace}     \quad
\overunderset{n}{i=1}{\big\rbrace} \quad
\overunderset{n}{i=1}{\Big\rbrace} \quad
\overunderset{n}{i=1}{\bigg\rbrace}\quad
\overunderset{n}{i=1}{\Bigg\rbrace}
$
\end{document}
1
  • 1
    Hi @Mico thank you very much for your great answer. Sep 11, 2021 at 22:35
8

Using another approach with \mathop,

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\begin{document}
$\mathop{\}}\limits_{i=1}^{n}$,
$\mathop{\bigr\}}\limits_{i=1}^{n}$,
$\mathop{\biggr\}}\limits_{i=1}^{n}$,
$\mathop{\Bigr\}}\limits_{i=1}^{n}$,
$\mathop{\Biggr\}}\limits_{i=1}^{n}$
\end{document}

enter image description here

2
  • 2
    Hello @Sebastiano I appreciate your contributiom. Sep 11, 2021 at 22:37
  • 2
    @GennaroArguzzi Holà..I am glady to help you...my regards from Sicily.
    – Sebastiano
    Sep 12, 2021 at 10:32
8

One needs to declare the object as a closing delimiter.

\documentclass{article}
\usepackage{amsmath}

\NewDocumentCommand{\rbracex}{O{}e{^_}}{%
  \mathclose{%
    \IfNoValueTF{#2}{% #2 is the possible superscript
      \underset{#2}{#1\rbrace}%
    }{%
      \IfNoValueTF{#3}{% #3 is the possible subscript
        \overset{#2}{#1\rbrace}%
      }{%
        \overunderset{#2}{#3}{#1\rbrace}%
      }%
    }%
  }% matching \mathclose
}

\begin{document}

\[
\lbrace A\rbracex_{i=1}^n
\quad
\big\lbrace A\rbracex[\big]_{i=1}^n
\quad
\Big\lbrace A\rbracex[\Big]_{i=1}^n
\]

\end{document}

enter image description here

I'd avoid this notation with great care.

A possible improvement, prompted by comments by barbara beeton:

\documentclass{article}
\usepackage{amsmath}

\NewDocumentCommand{\rbracex}{O{}e{^_}}{%
  \mathclose{%
    % let's compute the amount of backing up
    \sbox0{\mathsurround=0pt$#1\rbrace$}%
    \sbox2{\mathsurround=0pt
      $\IfNoValueTF{#2}{% #2 is the possible superscript
        \underset{#2}{#1\rbrace}%
      }{%
        \IfNoValueTF{#3}{% #3 is the possible subscript
          \overset{#2}{#1\rbrace}%
        }{%
          \overunderset{#2}{#3}{#1\rbrace}%
        }%
      }$%
    }% end of \sbox2
   \ifdim\wd0>\wd2
     % do nothing
   \else
     \kern\dimexpr(\wd0-\wd2)/2\relax
   \fi
   \usebox{2}%
  }% matching \mathclose
}

\begin{document}

\[
\lbrace A_i\rbracex_{i=1}^n
\quad
\big\lbrace A_i\rbracex[\big]_{i=1}^n
\quad
\Big\lbrace A_i\rbracex[\Big]_{i=1}^n
\]

\end{document}

enter image description here

Well, not really an improvement, I'm afraid.

6
  • The width of the "lower limit" makes what's inside the braces look off center (which, of course, it is), and the shape of the A makes that look even worse. I'm not qualified to say whether there's a compelling mathematical reason for this, but I can't believe that closing up that space to match the space on the left would change the meaning. (Maybe just ignore the width of the lower limit.) Sep 11, 2021 at 21:51
  • 1
    @barbarabeeton It's maybe possible to measure the objects and back up; but what if the thing inside is A_n? Clash would be unavoidable. Anyway, I can't see any compelling reason and actually see a few reasons for not going along with this. The main reason being that the sub/superscripts don't belong to the brace, but to the whole {...} thing. Perhaps I'm influenced by not being a fan of \{a_n\}_{i=1}^n to begin with.
    – egreg
    Sep 11, 2021 at 21:53
  • @barbarabeeton See this picture
    – egreg
    Sep 11, 2021 at 21:59
  • With the subscript, that looks much more balanced. But the space on the right looks smaller, and I think it's not entirely the fact that something has been added. If I measured the spaces at the baseline, I think the right-hand space after the subscript is a bit narrower than the space with no subscript. Is it all my imagination, or did you make an adjustment? Sep 12, 2021 at 0:43
  • 1
    @barbarabeeton It was just a cheap experiment, with the backing up measured “by sight”, to show that the output is not really that nice.
    – egreg
    Sep 12, 2021 at 8:40

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.