1. I am interested in the matrix:

enter image description here

To make this matrix, I am using the following code (the full document):

\left\llbracket \begin{matrix} #1 \end{matrix} \right\rrbracket}
\bbrack{ A\\ B}

What are other possible codes to make the same matrix?

2. I would like to make the same style of matrix as before but with \llparenthesis and \rrparenthesis. What are all the possible codes to make this matrix?

  • 1
    Rather than asking for all possible ways to do something, wouldn't it be better to tell us why you think your current approach isn't sufficient? There are many ways to do the same thing in TeX... Commented Sep 18, 2023 at 19:05
  • 3
    there are infinitely many tex inputs that would make that output what is your actual question? Commented Sep 18, 2023 at 19:35

2 Answers 2


There is no single way to do it. I can propose bbmatrix based on amsmath and ppmatrix built by measuring the contents in order to push the parentheses near to each other.



  \settoheight{\ppmatrixdimtwo}{$\begin{matrix} 0 \\ 0 \end{matrix}$}%
  \settoheight{\ppmatrixdimthree}{$\begin{matrix} 0 \\ 0 \\ 0 \end{matrix}$}%

\muskip_new:N \l_alezig_ppmatrix_muskip

  \settoheight{\ppmatrixdim}{$\begin{matrix} #1 \end{matrix}$}
    { \dim_compare_p:n { \ppmatrixdim < \ppmatrixdimtwo } }
      { \muskip_set:Nn \l_alezig_ppmatrix_muskip { -3mu } }
    { \dim_compare_p:n { \ppmatrixdim < \ppmatrixdimthree } }
      { \muskip_set:Nn \l_alezig_ppmatrix_muskip { -7mu } }
    \muskip_set:Nn \l_alezig_ppmatrix_muskip { -9mu }
  \begin{matrix} #1 \end{matrix}



\begin{bbmatrix} a \end{bbmatrix} \\
\begin{bbmatrix} a \\ b \end{bbmatrix} \\
\begin{bbmatrix} a \\ b \\ c \end{bbmatrix} \\
\begin{ppmatrix} a \end{ppmatrix} \\
\begin{ppmatrix} a \\ b \end{ppmatrix} \\
\begin{ppmatrix} a \\ b \\ c \end{ppmatrix} \\
\begin{ppmatrix} a \\ b \\ c \\ d \end{ppmatrix}


enter image description here

You can try your hand for the small versions.


Here is what you can do with nicematrix (but it's probably an overuse).



a \\ b \\ c 

a \\ b \\ c 


Output of the above code

  • I don't know why but I cannot run this code. It doesn't provide an error, it doesn't even build the pdf.
    – Alezigl
    Commented Sep 23, 2023 at 11:58
  • Your TeX installation is probably not up-to-date. Commented Sep 23, 2023 at 14:32

You must log in to answer this question.

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