Sorry for my bad English.
I used fouriernc font for my document. But the right bracket is not beautiful.
I found a code can customize the right bracket so good but if there is a text beside, they stack up together like this.
Please help me fix the code to avoid that problem. Thank you a lot!
\documentclass{article} % https://tex.stackexchange.com/a/327584/121799
\usepackage{tikz,amsmath,environ,fourier}
\usetikzlibrary{decorations.pathreplacing,calc}
\tikzset{
ncbar angle/.initial=90,
ncbar/.style={
to path=(\tikztostart)
-- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)
-- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)
-- (\tikztotarget)
},
ncbar/.default=0.5cm
}
%
\tikzset{square left brace/.style={ncbar=1ex}}
\tikzset{square right brace/.style={ncbar=-1ex}}
%
\NewEnviron{rcases}{\setbox0=\hbox{$\,\begin{matrix}\BODY\end{matrix}\,$}%
\setbox2=\hbox{\begin{tikzpicture}
\draw (0,\botdim) to [square left brace] (0,\topdim);
\copy0
\end{tikzpicture}}
\vcenter{\hbox{\copy2}}%
}
\def\topdim{\the\dimexpr+\ht0+.5\ht\strutbox-.5\dp\strutbox-3pt\relax}
\def\botdim{\the\dimexpr-\ht0+.5\ht\strutbox-.5\dp\strutbox+3pt\relax}
\begin{document}
\[ \left[\begin{matrix}
0 & \text{if}~x<0\\
1 & \text{if}~x\ge0
\end{matrix} \right.
\]
\[
f(x)=
\begin{rcases}
0 & \text{if}~x<0 \\
1 & \text{if}~x\ge0
\end{rcases} x+y=0
\]
\end{document}
Best Answer
Using TikZ here seems an overkill to me.
(I called the environment
bcases
instead ofrcases
as the latter is provided by themathtools
package.)