1

So, I am currently trying to do this: enter image description here

And this is what I tried so far,

\[
\left[
\begin{array}{c}
\left.\begin{matrix}
    x_k \\
    y_k \\
    v_k \\
    \psi_k \\
\end{matrix}\right\} s_k^p \\

\left.\begin{matrix}
    b_k \\
\end{matrix}\right\} s_k^c
\end{array}
\right]
\]

but, I am getting the vertical curly brace on the inside of the matrix: enter image description here

I want it outside as shown in the figure, how do I achieve this? Thanks in advance!

1
  • Welcome to TeX.SE! Please make your code snippet be compilable, then we do not have to guess what you are doing ...
    – Mensch
    Commented Feb 23 at 18:29

2 Answers 2

1

With the package nicematrix and tikz to have the same thickness to the curly braces

\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calligraphy}

\begin{document}
\tikzset{
  MyBrace/.style = {
    decorate,
    decoration={
      calligraphic brace,
      raise=2pt
    },
  }
}
\[\begin{bNiceArray}{c}
    x_k \\
    y_k \\
    v_k \\
    \psi_k \\
    b_k
    \CodeAfter
    \tikz \draw [MyBrace] (1-|2) -- node[right=3pt] {$s_k^p$}(5-|2);
    \tikz \draw [MyBrace] (5-|2) -- node[right=3pt] {$s_k^c$} (6-|2);
    \end{bNiceArray}\]
\end{document}

enter image description here

Old answer With the package nicematrix (but not better for thickness to the curly braces).

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\[\begin{bNiceArray}{c}[last-col]
    x_k &\\
    y_k &\Block{2-1}{\hspace*{1.5em}s_k^p}\\
    v_k &\\
    \psi_k &\\
    b_k&\hspace*{1.5em}s_k^c
    \CodeAfter
    \SubMatrix{.}{1-1}{4-1}{\}}[right-xshift=1em]
    \SubMatrix{.}{5-1}{5-1}{\}}[right-xshift=1em]
    \end{bNiceArray}\]
\end{document}

enter image description here

1

I'm afraid I don't know how to assign equal thickness to the curly braces. (It may be necessary to pursue a tikz-based solution for that.)

enter image description here

\documentclass{article} 
\usepackage{amsmath,array}
  
\begin{document}

\[
\begin{bmatrix}
    x_k \\
    y_k \\
    v_k \\
    \psi_k \\
    b_k
\end{bmatrix}
\begin{array}{@{}c@{}}
  \left. \begin{array}{@{}c@{}} 
     \mathstrut\\ \mathstrut\\ \mathstrut\\ \mathstrut 
  \end{array}\right\} s_k^p \\
  \left. \begin{array}{@{}c@{}} 
     \mathstrut
  \end{array}\right\} s_k^c \\
\end{array}
\]

\end{document}

You must log in to answer this question.

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