I am trying to modify LaTeX's brackets (\cases) to make something like the one on the left:

click here

I could only find code for square box and brackets (\cases), but not for this particular variant on any forums. The problem is how to either how to add a "tip" on [ or straighten up the corners on \cases. Could anyone help me with this?


  • You can upload png files. Without the picture, it is hard to find out what you want. – marmot Jun 29 '18 at 3:01
  • 1
    Perhaps take a look at this advanced answer? – Ruixi Zhang Jun 29 '18 at 3:37

DISCLAIMER: This is almost entirely taken from Steven B. Segletes answer and what I made here is also more a matrix that can be abused for cases. But the upshot is that with Steven's code one can draw any bracket one wants after very simple adjustments. Of course, some basic knowledge of TikZ helps.

\documentclass{article} % https://tex.stackexchange.com/a/327584/121799
    ncbar angle/.initial=90,
        to path=(\tikztostart)
        -- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)
        -- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)
        -- (\tikztotarget)
    freaky dim/.default=4pt,
        to path={let \p1=(\tikztostart),\p2=(\tikztotarget) in (\tikztostart)
        -- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)
        -- ({\x1-#1},{(\y1+\y2)/2-abs(#1)})
        -- ({\x1-2*#1},{(\y1+\y2)/2})
        -- ({\x1-#1},{(\y1+\y2)/2+abs(#1)})
        -- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)
        -- (\tikztotarget)}

\tikzset{freaky left brace/.style={freaky=0.5ex}}
\tikzset{freaky right brace/.style={freaky=-0.5ex}}

\tikzset{square left brace/.style={ncbar=0.5ex}}
\tikzset{square right brace/.style={ncbar=-0.5ex}}

\tikzset{round left paren/.style={ncbar=0.3cm,out=115,in=-115}}
\tikzset{round right paren/.style={ncbar=0.3cm,out=65,in=-65}}

    \draw [thick] (0,\botdim) to [freaky left brace] (0,\topdim);


\[ f(x)=
   0 & \text{if}~x<0  \\ 
   \pi & \text{if}~x\ge0  


enter image description here

  • Wow, thanks. Segletes's code (you referred to ) works like charm. I'm still trying to comprehend his code and tweak it for my own use though. – user37891 Jun 29 '18 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.