[Tex/LaTex] Modify case equation’s brace

casesequations

I was wondering if there is a way to change, case's symbol(curly brace) to two arrows pointing up/left and down/left.

\documentclass[a4paper,11pt]{article}
\usepackage{kerkis}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{wasysym}
\usepackage{amsthm}
\usepackage{tikz}
\begin{document}
\begin{align}
\mathbf{\nabla}\times \mathbf{E}=&0\;\begin{cases}\mathbf{E}=-\mathbf{\nabla}\Phi \\     \hat{\eta}\times (\mathbf{E_2}-\mathbf{E_1})=0\mbox{(continiuty)}\end{cases}\\
1+1=&2
\end{align}
%TikZ code "illustrating" the new "brace"
\begin{tikzpicture}
\draw[->] (0,0) -- (1,1);
\draw[->] (0,0) -- (1,-1);
\end{tikzpicture}
\end{document}

Best Answer

Firstly here is a multiarrowed version:

Sample output

\documentclass[a4paper,11pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{tikz}
\usetikzlibrary{calc}

\tikzset{arrowcases/.style={matrix anchor=west,%
  nodes={anchor=base west,%
         name=arrc-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn},%
  execute at begin cell=\node\bgroup\math\displaystyle,%
  execute at end cell=\endmath\egroup;,%
  ampersand replacement=\&}}

\def\beginarrowcases#1\endarrowcases{
\begin{tikzpicture}[baseline=(O)]
  \matrix [arrowcases] {
  #1
  };
  \coordinate (A) at (arrc-1-1.west);
  \coordinate (B) at (arrc-\the\pgfmatrixcurrentrow-1.west);
  \coordinate (start) at ($(A)!0.5!(B) - (1em,0)$);
  \foreach \nn in {1,...,\pgfmatrixcurrentrow} {
    \draw[->] (start) -- (arrc-\nn-1.west);
  };
  \coordinate (O) at ($(start)-(0,0.5ex)$);
  \node at (-1em,0) {};
\end{tikzpicture}}

\begin{document}


\begin{align}
  \mathbf{\nabla}\times \mathbf{E}&=0
  \beginarrowcases
    \mathbf{E}=-\mathbf{\nabla}\Phi \\
    \hat{\eta}\times (\mathbf{E_2}-\mathbf{E_1})=0 \&
    \text{(continuity)} \\
    \mathbf{E}=-\mathbf{\nabla}\Phi \& \text{(again)}\\
  \endarrowcases \\
  1+1 &= 2
\end{align}

\end{document}

This is obtained by making a matrix of math nodes like construction in tikz to build a cases like setup and then drawing the arrows. The syntax requires \& instead of & and \\ at the end of each line, because of the way the matrix construction is set-up in tikz and becuase of interaction with the amsmath package.

Secondly, here is how one replaces the cases bracket with another delimiter directly in the cases environment:

Sample cases output

\documentclass[a4paper,11pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{tikz}

\makeatletter
\renewenvironment{cases}[1][\lbrace]{%
  \matrix@check\cases\env@cases{#1}
}{%
  \endarray\right.%
}

\def\env@cases#1{%
  \let\@ifnextchar\new@ifnextchar
  \left#1
  \def\arraystretch{1.2}%
  \array{@{}l@{\quad}l@{}}%
}
\makeatother

\begin{document}
\begin{align}
  \mathbf{\nabla}\times \mathbf{E}&=0
  \begin{cases}
    \mathbf{E}=-\mathbf{\nabla}\Phi \\
    \hat{\eta}\times (\mathbf{E_2}-\mathbf{E_1})=0
    &\text{(continiuty)}
  \end{cases}
  \\
  1+1&=2\\
  \mathbf{\nabla}\times \mathbf{E}&=0
  \begin{cases}[\langle]
    \mathbf{E}=-\mathbf{\nabla}\Phi \\
    \hat{\eta}\times (\mathbf{E_2}-\mathbf{E_1})=0
    &\text{(continiuty)}
  \end{cases}
\end{align}

\end{document}

This acheived by redefining the cases environment to take an optional argument and putting that in the code at the place where \lbrace was hard coded.

Using a tikz picture for such a brace in this version is problematic. For a start one needs a construction that can be resized via \left. Furthermore in your request, you have arrows pointing to each row and that is hard to control. Hence, the multiarrowed code above is probably more what you want.

Related Question