如何对齐嵌套案例

如何对齐嵌套案例

我尝试将前两行的“=”符号与其余行对齐,但没有对齐?我在这里做错了什么吗?

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
        T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart,shapes,shadows,arrows,decorations.markings,trees,positioning,decorations.markings,calc,fit,chains,intersections,decorations.pathreplacing}
\usepackage[underline=true]{pgf-umlsd}
\usepackage{flexisym}
\usepackage{siunitx}
\usepackage{float}
\usepackage{supertabular,booktabs}
\usepackage{enumitem,kantlipsum}
\usepackage{tcolorbox}
\usepackage{longtable}
\usepackage{tikz-qtree}
\usetikzlibrary{positioning, shapes.geometric}
\usepackage{arydshln}
\usepackage{upgreek}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{float}

\DeclareMathSymbol{\al}  {\mathord}{letters}{"0B}
\DeclareMathSymbol{\be}   {\mathord}{letters}{"0C}
\DeclareMathSymbol{\ga}  {\mathord}{letters}{"0D}
\DeclareMathSymbol{\de}  {\mathord}{letters}{"0E}
\DeclareMathSymbol{\ep}{\mathord}{letters}{"0F}
\DeclareMathSymbol{\ze}   {\mathord}{letters}{"10}
\DeclareMathSymbol{\et}    {\mathord}{letters}{"11}
\DeclareMathSymbol{\thet}  {\mathord}{letters}{"12}
\DeclareMathSymbol{\io}   {\mathord}{letters}{"13}
\DeclareMathSymbol{\ka}  {\mathord}{letters}{"14}
\DeclareMathSymbol{\la} {\mathord}{letters}{"15}
\DeclareMathSymbol{\m}     {\mathord}{letters}{"16}
\DeclareMathSymbol{\n}     {\mathord}{letters}{"17}
\DeclareMathSymbol{\x}     {\mathord}{letters}{"18}
\DeclareMathSymbol{\p}     {\mathord}{letters}{"19}
\DeclareMathSymbol{\rh}    {\mathord}{letters}{"1A}
\DeclareMathSymbol{\sig}  {\mathord}{letters}{"1B}
\DeclareMathSymbol{\ta}    {\mathord}{letters}{"1C}
\DeclareMathSymbol{\up}{\mathord}{letters}{"1D}
\DeclareMathSymbol{\ph}    {\mathord}{letters}{"1E}
\DeclareMathSymbol{\ch}    {\mathord}{letters}{"1F}
\DeclareMathSymbol{\ps}    {\mathord}{letters}{"20}
\DeclareMathSymbol{\om}  {\mathord}{letters}{"21}
\DeclareMathSymbol{\va}{\mathord}{letters}{"22}
\DeclareMathSymbol{\va}{\mathord}{letters}{"23}
\DeclareMathSymbol{\va}  {\mathord}{letters}{"24}
\DeclareMathSymbol{\va} {\mathord}{letters}{"27}

\begin{document}

    \begin{align*}
    \sig_{ij} &=
    \begin{cases}
    A           &= g^{r_4}\\
    C           &= g^{\frac{1}{r_4 + H(m)}}\\
    \begin{rcases}
    D           &= \{K^{a}\}^{r_4}.\{K^{b}\}^{r_4}.\{K^{c}\}^{r_4}. ...\\
    &= g^{r_4{(\prod_{\forall k}^{}r_k)}(\Sigma_{\forall k}^{}AASK_k)}\\
    E_i         &= {D_{k}}^{r_4} = g^{r_4{(\prod_{\forall k}^{}r_k)}(\frac{q_x(0)}{t_i})}\\
    \end{rcases} {\scriptstyle \mid AA_k \in GetAA(\mathcal{T})}
    \end{cases}
    \end{align*}


\end{document}

在此处输入图片描述

答案1

一种非常手动的方法,使用array

\documentclass[]{article}

\usepackage[]{mathtools}

\begin{document}
\begin{equation*}
  \sigma_{ij} = \left\{
    \begin{array}{@{}r@{{}={}}l@{}l}
      A   & g^{r_4}\\
      C   & g^{\frac{1}{r_4 + H(m)}}\\
      D   & \{K^\alpha\}^{r_4}\cdot\{K^\beta\}^{r_4}\cdot\{K^\gamma\}^{r_4} \ldots\\
          & g^{r_4{(\prod_{\forall k}^{}r_k)}(\sum_{\forall k}^{}AASK_k)}
          &
        \smash
          {%
            \left.\begin{array}{@{}c@{}}
              \vphantom{\{K^\alpha\}^{r_4}\{K^\beta\}^{r_4}\{K^\gamma\}^{r_4}}\\
              \vphantom{g^{r_4{(\prod_{\forall k}^{}r_k)}(\sum_{\forall
              k}^{}AASK_k)}}\\
              \vphantom{{D_{k}}^{r_4}=g^{r_4{(\prod_{\forall
              k}^{}r_k)}(\frac{q_x(0)}{t_i})}}\\
            \end{array}\right\} \scriptstyle \mid AA_k \in GetAA(\mathcal{T})
          }
      \\
      E_i & {D_{k}}^{r_4}
           = g^{r_4{(\prod_{\forall k}^{}r_k)}(\frac{q_x(0)}{t_i})}\\
    \end{array}\right.
\end{equation*}
\end{document}

在此处输入图片描述

答案2

使用nicematrix

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{nicematrix}  % <---
\usetikzlibrary{decorations.pathreplacing,
                calligraphy}
\tikzset{
B/.style = {decorate,  % style for braces
            decoration={calligraphic brace, amplitude=4pt,
            raise=1pt, mirror},% for mirroring of brace
            thick,
            pen colour=black}
        }

\usepackage{lipsum} % for dummy text
\begin{document}
\lipsum[1]
    \[\setlength\arraycolsep{1pt}
\hspace*{-4em}\begin{NiceArray}{RCL}%
    [code-after={\tikz{\draw[B] (1-1.north -| 5-1.west) -- 
            node[left=2mm] {$\sigma_{ij}^{\vphantom{h}} =$}    (5-1.south west);
                       \draw[B] (3-3.east |- 5-3.south) -- 
            node[right=2mm,font=\scriptsize] {$\mid AA_k \in GetAA(\mathcal{T})$} 
                                            (3-3.north east) ;
                        }
                }
    ]
      A   &=& g^{r_4}\\
      C   &=& g^{\frac{1}{r_4 + H(m)}}\\
      D   &=& \{K^\alpha\}^{r_4}\cdot\{K^\beta\}^{r_4}\cdot\{K^\gamma\}^{r_4} \cdot\ldots  \\
          &=& g^{r_4{(\prod_{\forall k}^{}r_k)}(\sum_{\forall k}^{}AASK_k)}           \\
      E_i &=& {D_{k}}^{r_4}
           = g^{r_4{(\prod_{\forall k}^{}r_k)}(\frac{q_x(0)}{t_i})}                 \\
\end{NiceArray}
    \]
\lipsum[2-7]
\end{document}

经过两次编译后MWE的结果是:

在此处输入图片描述

答案3

\[
  \sig_{ij} =\left\{\!
  \begin{aligned}
    A   &= g^{r_4}\\
    C   &= g^{\frac{1}{r_4 + H(m)}}\\
    D   &= \{K^\al\}^{r_4}.\{K^\be\}^{r_4}.\{K^\ga\}^{r_4}. ...\\
        &= g^{r_4{(\prod_{\forall k}^{}r_k)}(\Sigma_{\forall k}^{}AASK_k)}
             \qquad\smash{\left.\rule{0pt}{2\normalbaselineskip}\right\} {\scriptstyle \mid AA_k \in GetAA(\mathcal{T})} } \\
    E_i &= {D_{k}}^{r_4} = g^{r_4{(\prod_{\forall k}^{}r_k)}(\frac{q_x(0)}{t_i})}
  \end{aligned}\right.
\]

在此处输入图片描述

答案4

以下解决方案采用 1 个cases环境和 2 个环境。它还通过减少参数 和 的值aligned来确保材料适合两列文档设置的窄列,这两个参数分别控制放置在和周围的空白填充量。IEEEtran\medmuskipthickmuskip\cdot=

在此处输入图片描述

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\newcommand\vn[1]{\mathit{#1}} % for "variable name"
\usepackage{mathtools,amssymb,lipsum}

\begin{document}
\[
\medmuskip=1mu    % default: 4mu
\thickmuskip=2mu  % default: 5mu
    \sigma_{ij} =
    \begin{cases}\!
    \begin{aligned}
    A &= g^{r_4}\\
    C &= g^{1/(r_4 + H(m))}
    \end{aligned}\\
    \mkern-8mu\begin{rcases}
    \begin{aligned}
    D
    &=\{K^{\alpha}\}^{r_4}\cdot\{K^{\beta}\}^{r_4}\cdot\{K^{\gamma}\}^{r_4}\cdot \dots \\[0.5ex]
    &= g^{r_4{(\prod_{\forall k}r_k)}(\sum_{\forall k} \vn{AASK}_k)}\\[1ex]
    E_i
    &= {D_{k}}^{r_4}
     = g^{r_4{(\prod_{\forall k}r_k)}(q_x(0)/t_i)}
    \end{aligned}
    \end{rcases} \scriptstyle \bigm\vert \vn{AA}_k \in \vn{GetAA}(\mathcal{T})
    \end{cases}
\]

\lipsum % generate several paragraphs of filler text
\end{document} 

相关内容