17

How can I draw curly braces where the "pinch" is not in the middle of brace, i.e. one of the "legs" is longer than the other, using TikZ?

Tim N
  • 10,219
  • 13
  • 63
  • 88

1 Answers1

22

You can define a style and use the aspect key (which determines the fraction of the total length where the "middle part" of the brace will be) for the brace decoration:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

\tikzset{
mybrace/.style={decorate,decoration={brace,aspect=#1}}
}
\begin{document}

\begin{tikzpicture}
\draw[mybrace=0.5] (0,0) -- (3,1);
\draw[mybrace=0.75] (0,1) -- (3,2);
\draw[mybrace=0.25] (0,2) -- (3,3);
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128