使用括号代替花括号的情况

使用括号代替花括号的情况

我怎样才能使用带有 [] 的情况(两侧)而不是花括号,如附图所示?

谢谢。

在此处输入图片描述

答案1

可能是這樣。

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \[
  a=
  \left[\begin{aligned}
    &2 \rightarrow \text{John}\\
    &5 \rightarrow \text{Mary}\\
    &7 \rightarrow \text{Ann}
  \end{aligned}\right]\]
  \[
  a=
  \begin{bmatrix}
    2 &\rightarrow &\text{John}\\
    5 &\rightarrow &\text{Mary}\\
    7 &\rightarrow &\text{Ann}
  \end{bmatrix}\]
  \[
  a=
  \left[\begin{array}{@{}l@{\,}l@{\,}c@{}}
    2 &\rightarrow &\text{John}\\
    5 &\rightarrow &\text{Mary}\\
    7 &\rightarrow &\text{Ann}
  \end{array}\right]
  \]
\end{document}

在此处输入图片描述

相关内容