4

the curly braces in the following picture are asymmetric:

\newcommand{\mydistance}{.7cm}
\newcommand{\mydistancee}{0.1cm}
\begin{tikzpicture}[decoration={brace,amplitude=7pt}]
\node(G)                                                {$G$};
\node(H1)   [below=\mydistance of G]                    {$H_1$};
\node(H2)   [below=\mydistance of H1]               {$H_2$};
\node(1)        [below=\mydistance of H2]               {$\left\{1\right\}$};

\node(Gb)   [right=\mydistancee of G]               {};
\node(H1b)  [right=\mydistancee of H1]              {};
\node(1b)   [right=\mydistancee of 1]               {};

\draw(G)--(H1) node[midway, left=0.1cm]{2};
\draw(H1)--(H2) node[midway, left=0.1cm]{4};
\draw(H2)--(1) node[midway, left=0.1cm]{3};

\draw[decorate] (Gb) -- (H1b) node[midway, right=0.3cm] {$C_2$};
\draw[decorate] (H1b) -- (1b) node[midway, right=0.3cm] {$A_4$};

\end{tikzpicture}

The upper curly brace is tilted slightly to the left. How do I get it to be straight?

Greetings and thanks for the help, Dominik

  • 1
    @Turion In most cases users aren't notified of comments unless you write @username, as I did in my two comments here. – Torbjørn T. Mar 14 '14 at 20:05

1 Answers1

5

You can use the orthogonal identifiers as explained in How to align a node vertical to one node and horizontal to another node?

\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\newcommand{\mydistance}{.7cm}
\newcommand{\mydistancee}{0.1cm}
\begin{document}
\begin{tikzpicture}[decoration={brace,amplitude=7pt}]
\node(G){$G$};
\begin{scope}[node distance=\mydistance]
\node(H1) [below=of G]  {$H_1$};
\node(H2) [below=of H1] {$H_2$};
\node(1)  [below=of H2] {$\left\{1\right\}$};
\end{scope}

\begin{scope}[node distance=\mydistancee]
\coordinate[right=of G]  (Gb)   ;
\coordinate[right=of H1] (H1b)  ;
\coordinate[right=of 1]  (1b)   ;
\end{scope}

\draw(G)--(H1)  node[midway, left=0.1cm]{2};
\draw(H1)--(H2) node[midway, left=0.1cm]{4};
\draw(H2)--(1)  node[midway, left=0.1cm]{3};

\draw[decorate] (Gb-|H1b) -- (H1b) node[midway, right=0.3cm] {$C_2$};
\draw[decorate] (H1b) -- (1b) node[midway, right=0.3cm] {$A_4$};

\end{tikzpicture}
\end{document}

enter image description here

percusse
  • 157,807