8

I am interested in the matrix:

enter image description here

To make this matrix, I am using the following code:

$\left\{\!\!\!\left\{\begin{array}{l} A \\ B \end{array}\right\}\!\!\!\right\}$

What are other possible codes to make the same matrix?

3
  • Are you asking how to simplify or streamline \!\!\!?
    – Mico
    Aug 28, 2023 at 17:51
  • Yes and also if there are any other possible codes beside this which make the same matrix.
    – Alezigl
    Aug 28, 2023 at 17:54
  • For example, without using \begin and \end {array}
    – Alezigl
    Aug 28, 2023 at 17:55

4 Answers 4

9

Here are four possibilities. (Note that I've eliminated the whitespace padding around the column vector.)

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'Bmatrix' environment

\begin{document}
\[
\left\{ \!\!\! \left\{ \begin{array}{@{}l@{}} A\\B \end{array} \right\} \!\!\! \right\}
\quad
\left\{ \mkern-9mu \left\{ \begin{array}{@{}l@{}} A\\B \end{array} \right\} \mkern-9mu \right\}
\quad
\left\{  \mkern-9mu \begin{Bmatrix} A\\B \end{Bmatrix} \mkern-9mu \right\}
\quad
\biggl\{ \mkern-9mu \begin{Bmatrix} A\\B \end{Bmatrix} \mkern-9mu \biggr\}
\]
\end{document}
1
  • Thank you very much.
    – Alezigl
    Aug 29, 2023 at 8:51
10

I'd define a BBmatrix environment modelled on Bmatrix.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newenvironment{BBmatrix}{%
  \left\{\mspace{-8mu}\left\{\env@matrix
}{%
  \endmatrix\right\}\mspace{-8mu}\right\}%
}
\makeatother

\begin{document}

\[
\begin{BBmatrix} A \\ B \end{BBmatrix}
\quad
\begin{BBmatrix} A & B \\ C & D \end{BBmatrix}
\]

\end{document}

enter image description here

With -9mu instead of -8mu it looks less attractive, in my opinion:

enter image description here

Different math fonts might need different negative space: experiment by yourself.

1
  • Thank you very much.
    – Alezigl
    Aug 29, 2023 at 8:49
8

Here, with a stack (I took the liberty of kerning -8mu rather than -9mu):

\documentclass{article}
\usepackage{tabstackengine}
\begin{document}
\[\left\{\mkern-8mu\braceVectorstack{A\\B}\mkern-8mu\right\}\]
\end{document}

enter image description here

3
  • 1
    +1. Observe that \!\!\! corresponds to \mkern-9mu, though.
    – Mico
    Aug 28, 2023 at 18:07
  • 1
    @Mico Yes, I am aware. Once it gets more than two \!, I prefer to just use \mkern. I thought 8mu looked better than 9mu. Aug 28, 2023 at 18:08
  • Thank you very much.
    – Alezigl
    Aug 29, 2023 at 8:51
7

You can use \atopwithdelims TeX primitive:

$$ \left\{\mkern-9mu{A \atopwithdelims\{\} B}\mkern-9mu\right\} $$ 
1
  • Thank you very much.
    – Alezigl
    Aug 29, 2023 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .